Merge lp:~jbicha/unity-settings-daemon/drop-updates-plugin into lp:unity-settings-daemon
- drop-updates-plugin
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Robert Ancell |
Approved revision: | 4158 |
Merged at revision: | 4157 |
Proposed branch: | lp:~jbicha/unity-settings-daemon/drop-updates-plugin |
Merge into: | lp:unity-settings-daemon |
Diff against target: |
4349 lines (+1/-4202) 17 files modified
configure.ac (+0/-29) debian/rules (+1/-1) gnome-settings-daemon/gnome-settings-plugin-info.c (+0/-28) gnome-settings-daemon/gnome-settings-plugin-info.h (+0/-4) plugins/Makefile.am (+0/-6) plugins/updates/Makefile.am (+0/-55) plugins/updates/gsd-updates-common.h (+0/-44) plugins/updates/gsd-updates-firmware.c (+0/-1040) plugins/updates/gsd-updates-firmware.h (+0/-52) plugins/updates/gsd-updates-manager.c (+0/-1456) plugins/updates/gsd-updates-manager.h (+0/-57) plugins/updates/gsd-updates-plugin.c (+0/-29) plugins/updates/gsd-updates-refresh.c (+0/-572) plugins/updates/gsd-updates-refresh.h (+0/-52) plugins/updates/updates-design.svg (+0/-765) plugins/updates/updates.gnome-settings-plugin.in (+0/-9) po/POTFILES.in (+0/-3) |
To merge this branch: | bzr merge lp:~jbicha/unity-settings-daemon/drop-updates-plugin |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Robert Ancell | Approve | ||
Review via email: mp+319275@code.launchpad.net |
Commit message
Drop updates plugin (handled by GNOME Software, dropped by gnome-settings-
Description of the change
* Merge changes from gnome-settings-
- Drop updates plugin (now handled by GNOME Software; this plugin was disabled by Ubuntu and Ubuntu GNOME anyway)
Robert Ancell (robert-ancell) wrote : | # |
This would be easier to review in two MPs - the two changes aren't related right?
- 4157. By Jeremy Bícha
-
updates: Remove the updates plugin
The functionality now lives in gnome-software that has its own session
service for update polling.https:/
/git.gnome. org/browse/ gnome-settings- daemon/ commit/ ?id=fc22a8100 - 4158. By Jeremy Bícha
-
Drop obsolete --disable-
packagekit from debian/rules
Jeremy Bícha (jbicha) wrote : | # |
Ok, I split the FTBFS fix to
https:/
Robert Ancell (robert-ancell) wrote : | # |
LGTM, thanks!
Robert Ancell (robert-ancell) wrote : | # |
The removal of gnome_settings_
$ /usr/lib/
/usr/lib/
Robert Ancell (robert-ancell) wrote : | # |
See bug 1675612
Preview Diff
1 | === modified file 'configure.ac' |
2 | --- configure.ac 2016-05-15 01:00:17 +0000 |
3 | +++ configure.ac 2017-03-22 16:14:50 +0000 |
4 | @@ -303,33 +303,6 @@ |
5 | AM_CONDITIONAL(HAVE_WACOM, test x$have_wacom = xyes) |
6 | |
7 | dnl ============================================== |
8 | -dnl PackageKit section |
9 | -dnl ============================================== |
10 | - |
11 | -have_packagekit=false |
12 | -AC_ARG_ENABLE(packagekit, |
13 | - AC_HELP_STRING([--disable-packagekit], |
14 | - [turn off PackageKit support]), |
15 | - [case "${enableval}" in |
16 | - yes) WANT_PACKAGEKIT=yes ;; |
17 | - no) WANT_PACKAGEKIT=no ;; |
18 | - *) AC_MSG_ERROR(bad value ${enableval} for --disable-packagekit) ;; |
19 | - esac], |
20 | - [WANT_PACKAGEKIT=yes]) dnl Default value |
21 | - |
22 | -if test x$WANT_PACKAGEKIT = xyes ; then |
23 | - PK_REQUIRED_VERSION=0.7.4 |
24 | - PKG_CHECK_MODULES(PACKAGEKIT, glib-2.0 packagekit-glib2 >= $PK_REQUIRED_VERSION upower-glib >= $UPOWER_REQUIRED_VERSION gudev-1.0 libnotify >= $LIBNOTIFY_REQUIRED_VERSION, |
25 | - [have_packagekit=true |
26 | - AC_DEFINE(HAVE_PACKAGEKIT, 1, [Define if PackageKit should be used])], |
27 | - [have_packagekit=false]) |
28 | -fi |
29 | -AM_CONDITIONAL(HAVE_PACKAGEKIT, test "x$have_packagekit" = "xtrue") |
30 | - |
31 | -AC_SUBST(PACKAGEKIT_CFLAGS) |
32 | -AC_SUBST(PACKAGEKIT_LIBS) |
33 | - |
34 | -dnl ============================================== |
35 | dnl smartcard section |
36 | dnl ============================================== |
37 | have_smartcard_support=false |
38 | @@ -498,7 +471,6 @@ |
39 | plugins/screensaver-proxy/Makefile |
40 | plugins/smartcard/Makefile |
41 | plugins/sound/Makefile |
42 | -plugins/updates/Makefile |
43 | plugins/wacom/Makefile |
44 | plugins/xrandr/Makefile |
45 | plugins/xsettings/Makefile |
46 | @@ -539,7 +511,6 @@ |
47 | IBus support: ${enable_ibus} |
48 | Fcitx support: ${enable_fcitx} |
49 | Libnotify support: ${have_libnotify} |
50 | - PackageKit support: ${have_packagekit} |
51 | Smartcard support: ${have_smartcard_support} |
52 | Cups support: ${enable_cups} |
53 | Wacom support: ${have_wacom} |
54 | |
55 | === modified file 'debian/rules' |
56 | --- debian/rules 2016-01-29 18:10:00 +0000 |
57 | +++ debian/rules 2017-03-22 16:14:50 +0000 |
58 | @@ -8,7 +8,7 @@ |
59 | |
60 | DEB_DH_MAKESHLIBS_ARGS_ALL += -X/usr/lib/unity-settings-daemon-1.0 |
61 | DEB_CONFIGURE_SCRIPT := ./autogen.sh |
62 | -DEB_CONFIGURE_EXTRA_FLAGS = --enable-systemd --disable-packagekit --enable-ibus --enable-fcitx |
63 | +DEB_CONFIGURE_EXTRA_FLAGS = --enable-systemd --enable-ibus --enable-fcitx |
64 | |
65 | build/unity-settings-daemon:: |
66 | gcc -o gnome-settings-daemon/gnome-update-wallpaper-cache debian/gnome-update-wallpaper-cache.c `pkg-config --cflags --libs glib-2.0 gdk-3.0 gdk-x11-3.0 gio-2.0 gnome-desktop-3.0` |
67 | |
68 | === modified file 'gnome-settings-daemon/gnome-settings-plugin-info.c' |
69 | --- gnome-settings-daemon/gnome-settings-plugin-info.c 2016-05-24 21:10:25 +0000 |
70 | +++ gnome-settings-daemon/gnome-settings-plugin-info.c 2017-03-22 16:14:50 +0000 |
71 | @@ -296,25 +296,6 @@ |
72 | } |
73 | } |
74 | |
75 | -void |
76 | -gnome_settings_plugin_info_set_settings_prefix (GnomeSettingsPluginInfo *info, |
77 | - const char *settings_prefix) |
78 | -{ |
79 | - int priority; |
80 | - |
81 | - info->priv->settings = g_settings_new (settings_prefix); |
82 | - info->priv->enabled = g_settings_get_boolean (info->priv->settings, "active"); |
83 | - |
84 | - priority = g_settings_get_int (info->priv->settings, "priority"); |
85 | - if (priority > 0) |
86 | - info->priv->priority = priority; |
87 | - |
88 | - g_signal_connect (G_OBJECT (info->priv->settings), |
89 | - "changed", |
90 | - G_CALLBACK (plugin_enabled_cb), |
91 | - info); |
92 | -} |
93 | - |
94 | static void |
95 | _deactivate_plugin (GnomeSettingsPluginInfo *info) |
96 | { |
97 | @@ -516,12 +497,3 @@ |
98 | |
99 | return info->priv->priority; |
100 | } |
101 | - |
102 | -void |
103 | -gnome_settings_plugin_info_set_priority (GnomeSettingsPluginInfo *info, |
104 | - int priority) |
105 | -{ |
106 | - g_return_if_fail (GNOME_IS_SETTINGS_PLUGIN_INFO (info)); |
107 | - |
108 | - info->priv->priority = priority; |
109 | -} |
110 | |
111 | === modified file 'gnome-settings-daemon/gnome-settings-plugin-info.h' |
112 | --- gnome-settings-daemon/gnome-settings-plugin-info.h 2010-10-05 14:30:32 +0000 |
113 | +++ gnome-settings-daemon/gnome-settings-plugin-info.h 2017-03-22 16:14:50 +0000 |
114 | @@ -52,7 +52,6 @@ |
115 | |
116 | GnomeSettingsPluginInfo *gnome_settings_plugin_info_new_from_file (const char *filename); |
117 | |
118 | -void gnome_settings_plugin_info_set_settings_prefix (GnomeSettingsPluginInfo *info, const char *settings_prefix); |
119 | gboolean gnome_settings_plugin_info_activate (GnomeSettingsPluginInfo *info); |
120 | gboolean gnome_settings_plugin_info_deactivate (GnomeSettingsPluginInfo *info); |
121 | |
122 | @@ -68,9 +67,6 @@ |
123 | const char *gnome_settings_plugin_info_get_location (GnomeSettingsPluginInfo *info); |
124 | int gnome_settings_plugin_info_get_priority (GnomeSettingsPluginInfo *info); |
125 | |
126 | -void gnome_settings_plugin_info_set_priority (GnomeSettingsPluginInfo *info, |
127 | - int priority); |
128 | - |
129 | G_END_DECLS |
130 | |
131 | #endif /* __GNOME_SETTINGS_PLUGIN_INFO_H__ */ |
132 | |
133 | === modified file 'plugins/Makefile.am' |
134 | --- plugins/Makefile.am 2016-03-15 20:26:48 +0000 |
135 | +++ plugins/Makefile.am 2017-03-22 16:14:50 +0000 |
136 | @@ -23,12 +23,6 @@ |
137 | |
138 | disabled_plugins = $(NULL) |
139 | |
140 | -if HAVE_PACKAGEKIT |
141 | -enabled_plugins += updates |
142 | -else |
143 | -disabled_plugins += updates |
144 | -endif |
145 | - |
146 | if SMARTCARD_SUPPORT |
147 | enabled_plugins += smartcard |
148 | else |
149 | |
150 | === removed directory 'plugins/updates' |
151 | === removed file 'plugins/updates/Makefile.am' |
152 | --- plugins/updates/Makefile.am 2012-12-20 16:54:09 +0000 |
153 | +++ plugins/updates/Makefile.am 1970-01-01 00:00:00 +0000 |
154 | @@ -1,55 +0,0 @@ |
155 | -plugin_name = updates |
156 | - |
157 | -plugin_LTLIBRARIES = \ |
158 | - libupdates.la |
159 | - |
160 | -libupdates_la_SOURCES = \ |
161 | - gsd-updates-common.h \ |
162 | - gsd-updates-plugin.c \ |
163 | - gsd-updates-refresh.h \ |
164 | - gsd-updates-refresh.c \ |
165 | - gsd-updates-firmware.h \ |
166 | - gsd-updates-firmware.c \ |
167 | - gsd-updates-manager.h \ |
168 | - gsd-updates-manager.c |
169 | - |
170 | -libupdates_la_CPPFLAGS = \ |
171 | - -I$(top_srcdir)/gnome-settings-daemon \ |
172 | - -DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\" \ |
173 | - $(AM_CPPFLAGS) |
174 | - |
175 | -libupdates_la_CFLAGS = \ |
176 | - $(PLUGIN_CFLAGS) \ |
177 | - $(SETTINGS_PLUGIN_CFLAGS) \ |
178 | - $(GUDEV_CFLAGS) \ |
179 | - -DG_UDEV_API_IS_SUBJECT_TO_CHANGE \ |
180 | - $(PACKAGEKIT_CFLAGS) \ |
181 | - -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \ |
182 | - -DDATADIR=\"$(datadir)\" \ |
183 | - -DBINDIR=\"$(bindir)\" \ |
184 | - -DLIBEXECDIR=\"$(libexecdir)\" \ |
185 | - -I$(top_srcdir)/data \ |
186 | - $(AM_CFLAGS) |
187 | - |
188 | -libupdates_la_LDFLAGS = \ |
189 | - $(GSD_PLUGIN_LDFLAGS) |
190 | - |
191 | -libupdates_la_LIBADD = \ |
192 | - $(SETTINGS_PLUGIN_LIBS) \ |
193 | - $(PACKAGEKIT_LIBS) |
194 | - |
195 | -plugin_in_files = \ |
196 | - updates.gnome-settings-plugin.in |
197 | - |
198 | -plugin_DATA = $(plugin_in_files:.gnome-settings-plugin.in=.gnome-settings-plugin) |
199 | - |
200 | -EXTRA_DIST = \ |
201 | - $(plugin_in_files) |
202 | - |
203 | -CLEANFILES = \ |
204 | - $(plugin_DATA) |
205 | - |
206 | -DISTCLEANFILES = \ |
207 | - $(plugin_DATA) |
208 | - |
209 | -@GSD_INTLTOOL_PLUGIN_RULE@ |
210 | |
211 | === removed file 'plugins/updates/gsd-updates-common.h' |
212 | --- plugins/updates/gsd-updates-common.h 2012-06-29 11:56:58 +0000 |
213 | +++ plugins/updates/gsd-updates-common.h 1970-01-01 00:00:00 +0000 |
214 | @@ -1,44 +0,0 @@ |
215 | -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- |
216 | - * |
217 | - * Copyright (C) 2011 Richard Hughes <richard@hughsie.com> |
218 | - * |
219 | - * Licensed under the GNU General Public License Version 2 |
220 | - * |
221 | - * This program is free software; you can redistribute it and/or modify |
222 | - * it under the terms of the GNU General Public License as published by |
223 | - * the Free Software Foundation; either version 2 of the License, or |
224 | - * (at your option) any later version. |
225 | - * |
226 | - * This program is distributed in the hope that it will be useful, |
227 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
228 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
229 | - * GNU General Public License for more details. |
230 | - * |
231 | - * You should have received a copy of the GNU General Public License |
232 | - * along with this program; if not, write to the Free Software |
233 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
234 | - */ |
235 | - |
236 | -#ifndef __GSD_UPDATES_COMMON_H |
237 | -#define __GSD_UPDATES_COMMON_H |
238 | - |
239 | -G_BEGIN_DECLS |
240 | - |
241 | -#define GSD_SETTINGS_BANNED_FIRMWARE "banned-firmware" |
242 | -#define GSD_SETTINGS_CONNECTION_USE_MOBILE "connection-use-mobile" |
243 | -#define GSD_SETTINGS_ENABLE_CHECK_FIRMWARE "enable-check-firmware" |
244 | -#define GSD_SETTINGS_FREQUENCY_GET_UPDATES "frequency-get-updates" |
245 | -#define GSD_SETTINGS_FREQUENCY_GET_UPGRADES "frequency-get-upgrades" |
246 | -#define GSD_SETTINGS_FREQUENCY_REFRESH_CACHE "frequency-refresh-cache" |
247 | -#define GSD_SETTINGS_FREQUENCY_UPDATES_NOTIFICATION "frequency-updates-notification" |
248 | -#define GSD_SETTINGS_IGNORED_DEVICES "ignored-devices" |
249 | -#define GSD_SETTINGS_LAST_UPDATES_NOTIFICATION "last-updates-notification" |
250 | -#define GSD_SETTINGS_MEDIA_REPO_FILENAMES "media-repo-filenames" |
251 | -#define GSD_SETTINGS_NOTIFY_DISTRO_UPGRADES "notify-distro-upgrades" |
252 | -#define GSD_SETTINGS_SCHEMA "org.gnome.settings-daemon.plugins.updates" |
253 | -#define GSD_SETTINGS_UPDATE_BATTERY "update-battery" |
254 | -#define GSD_SETTINGS_AUTO_DOWNLOAD_UPDATES "auto-download-updates" |
255 | - |
256 | -G_END_DECLS |
257 | - |
258 | -#endif /* __GSD_UPDATES_COMMON_H */ |
259 | |
260 | === removed file 'plugins/updates/gsd-updates-firmware.c' |
261 | --- plugins/updates/gsd-updates-firmware.c 2013-02-19 07:45:28 +0000 |
262 | +++ plugins/updates/gsd-updates-firmware.c 1970-01-01 00:00:00 +0000 |
263 | @@ -1,1040 +0,0 @@ |
264 | -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- |
265 | - * |
266 | - * Copyright (C) 2007-2012 Richard Hughes <richard@hughsie.com> |
267 | - * |
268 | - * Licensed under the GNU General Public License Version 2 |
269 | - * |
270 | - * This program is free software; you can redistribute it and/or modify |
271 | - * it under the terms of the GNU General Public License as published by |
272 | - * the Free Software Foundation; either version 2 of the License, or |
273 | - * (at your option) any later version. |
274 | - * |
275 | - * This program is distributed in the hope that it will be useful, |
276 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
277 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
278 | - * GNU General Public License for more details. |
279 | - * |
280 | - * You should have received a copy of the GNU General Public License |
281 | - * along with this program; if not, write to the Free Software |
282 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
283 | - */ |
284 | - |
285 | -#include "config.h" |
286 | - |
287 | -#include <stdlib.h> |
288 | -#include <string.h> |
289 | -#include <stdio.h> |
290 | -#include <time.h> |
291 | -#include <errno.h> |
292 | - |
293 | -#include <string.h> |
294 | -#include <sys/time.h> |
295 | -#include <sys/types.h> |
296 | -#ifdef HAVE_UNISTD_H |
297 | -#include <unistd.h> |
298 | -#endif /* HAVE_UNISTD_H */ |
299 | -#include <glib/gi18n.h> |
300 | -#include <gio/gio.h> |
301 | -#include <libnotify/notify.h> |
302 | -#include <packagekit-glib2/packagekit.h> |
303 | -#ifdef HAVE_GUDEV |
304 | -#include <gudev/gudev.h> |
305 | -#endif |
306 | - |
307 | -#include "gsd-updates-common.h" |
308 | -#include "gsd-updates-firmware.h" |
309 | - |
310 | -static void gsd_updates_firmware_finalize (GObject *object); |
311 | - |
312 | -#define GSD_UPDATES_FIRMWARE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_UPDATES_TYPE_FIRMWARE, GsdUpdatesFirmwarePrivate)) |
313 | -#define GSD_UPDATES_FIRMWARE_MISSING_DIR "/run/udev/firmware-missing" |
314 | -#define GSD_UPDATES_FIRMWARE_LOADING_DIR "/lib/firmware" |
315 | -#define GSD_UPDATES_FIRMWARE_LOGIN_DELAY 10 /* seconds */ |
316 | -#define GSD_UPDATES_FIRMWARE_PROCESS_DELAY 2 /* seconds */ |
317 | -#define GSD_UPDATES_FIRMWARE_INSERT_DELAY 2 /* seconds */ |
318 | -#define GSD_UPDATES_FIRMWARE_DEVICE_REBIND_PROGRAM "/usr/sbin/pk-device-rebind" |
319 | - |
320 | -struct GsdUpdatesFirmwarePrivate |
321 | -{ |
322 | - GSettings *settings; |
323 | - GFileMonitor *monitor; |
324 | - GPtrArray *array_requested; |
325 | - PkTask *task; |
326 | - GPtrArray *packages_found; |
327 | - guint timeout_id; |
328 | -}; |
329 | - |
330 | -typedef enum { |
331 | - FIRMWARE_SUBSYSTEM_USB, |
332 | - FIRMWARE_SUBSYSTEM_PCI, |
333 | - FIRMWARE_SUBSYSTEM_UNKNOWN |
334 | -} FirmwareSubsystem; |
335 | - |
336 | -typedef struct { |
337 | - gchar *filename; |
338 | - gchar *sysfs_path; |
339 | - gchar *model; |
340 | - gchar *id; |
341 | - FirmwareSubsystem subsystem; |
342 | -} GsdUpdatesFirmwareRequest; |
343 | - |
344 | -G_DEFINE_TYPE (GsdUpdatesFirmware, gsd_updates_firmware, G_TYPE_OBJECT) |
345 | - |
346 | -static void install_package_ids (GsdUpdatesFirmware *firmware); |
347 | -static void ignore_devices (GsdUpdatesFirmware *firmware); |
348 | - |
349 | -static gboolean |
350 | -subsystem_can_replug (FirmwareSubsystem subsystem) |
351 | -{ |
352 | - if (subsystem == FIRMWARE_SUBSYSTEM_USB) |
353 | - return TRUE; |
354 | - return FALSE; |
355 | -} |
356 | - |
357 | -static GsdUpdatesFirmwareRequest * |
358 | -request_new (const gchar *filename, const gchar *sysfs_path) |
359 | -{ |
360 | - GsdUpdatesFirmwareRequest *req; |
361 | -#ifdef HAVE_GUDEV |
362 | - GUdevDevice *device; |
363 | - GUdevClient *client; |
364 | - const gchar *subsystem; |
365 | - const gchar *model; |
366 | - const gchar *id_vendor; |
367 | - const gchar *id_product; |
368 | -#endif |
369 | - |
370 | - req = g_new0 (GsdUpdatesFirmwareRequest, 1); |
371 | - req->filename = g_strdup (filename); |
372 | - req->sysfs_path = g_strdup (sysfs_path); |
373 | - req->subsystem = FIRMWARE_SUBSYSTEM_UNKNOWN; |
374 | -#ifdef HAVE_GUDEV |
375 | - |
376 | - /* get all subsystems */ |
377 | - client = g_udev_client_new (NULL); |
378 | - device = g_udev_client_query_by_sysfs_path (client, sysfs_path); |
379 | - if (device == NULL) |
380 | - goto out; |
381 | - |
382 | - /* find subsystem, which will affect if we have to replug, or reboot */ |
383 | - subsystem = g_udev_device_get_subsystem (device); |
384 | - if (g_strcmp0 (subsystem, "usb") == 0) { |
385 | - req->subsystem = FIRMWARE_SUBSYSTEM_USB; |
386 | - } else if (g_strcmp0 (subsystem, "pci") == 0) { |
387 | - req->subsystem = FIRMWARE_SUBSYSTEM_PCI; |
388 | - } else { |
389 | - g_warning ("subsystem unrecognised: %s", subsystem); |
390 | - } |
391 | - |
392 | - /* get model, so we can show something sensible */ |
393 | - model = g_udev_device_get_property (device, "ID_MODEL"); |
394 | - if (model != NULL && model[0] != '\0') { |
395 | - req->model = g_strdup (model); |
396 | - /* replace invalid chars */ |
397 | - g_strdelimit (req->model, "_", ' '); |
398 | - } |
399 | - |
400 | - /* create ID so we can ignore the specific device */ |
401 | - id_vendor = g_udev_device_get_property (device, "ID_VENDOR"); |
402 | - id_product = g_udev_device_get_property (device, "ID_MODEL_ID"); |
403 | - req->id = g_strdup_printf ("%s_%s", id_vendor, id_product); |
404 | -out: |
405 | - if (device != NULL) |
406 | - g_object_unref (device); |
407 | - g_object_unref (client); |
408 | -#endif |
409 | - return req; |
410 | -} |
411 | - |
412 | -static void |
413 | -request_free (GsdUpdatesFirmwareRequest *req) |
414 | -{ |
415 | - g_free (req->filename); |
416 | - g_free (req->model); |
417 | - g_free (req->sysfs_path); |
418 | - g_free (req->id); |
419 | - g_free (req); |
420 | -} |
421 | - |
422 | -static gboolean |
423 | -device_rebind (GsdUpdatesFirmware *firmware) |
424 | -{ |
425 | - gboolean ret; |
426 | - gchar *argv[4]; |
427 | - gchar *rebind_stderr = NULL; |
428 | - gchar *rebind_stdout = NULL; |
429 | - GError *error = NULL; |
430 | - gint exit_status = 0; |
431 | - guint i; |
432 | - GPtrArray *array; |
433 | - const GsdUpdatesFirmwareRequest *req; |
434 | - GString *string; |
435 | - |
436 | - string = g_string_new (""); |
437 | - |
438 | - /* make a string array of all the devices to replug */ |
439 | - array = firmware->priv->array_requested; |
440 | - for (i=0; i<array->len; i++) { |
441 | - req = g_ptr_array_index (array, i); |
442 | - g_string_append_printf (string, "%s ", req->sysfs_path); |
443 | - } |
444 | - |
445 | - /* remove trailing space */ |
446 | - if (string->len > 0) |
447 | - g_string_set_size (string, string->len-1); |
448 | - |
449 | - /* use PolicyKit to do this as root */ |
450 | - argv[0] = "pkexec"; |
451 | - argv[1] = GSD_UPDATES_FIRMWARE_DEVICE_REBIND_PROGRAM; |
452 | - argv[2] = string->str; |
453 | - argv[3] = NULL; |
454 | - ret = g_spawn_sync (NULL, |
455 | - argv, |
456 | - NULL, |
457 | - G_SPAWN_SEARCH_PATH, |
458 | - NULL, NULL, |
459 | - &rebind_stdout, |
460 | - &rebind_stderr, |
461 | - &exit_status, |
462 | - &error); |
463 | - if (!ret) { |
464 | - g_warning ("failed to spawn '%s': %s", |
465 | - argv[1], error->message); |
466 | - g_error_free (error); |
467 | - goto out; |
468 | - } |
469 | - |
470 | - /* if we failed to rebind the device */ |
471 | - if (exit_status != 0) { |
472 | - g_warning ("failed to rebind: %s, %s", |
473 | - rebind_stdout, rebind_stderr); |
474 | - ret = FALSE; |
475 | - goto out; |
476 | - } |
477 | -out: |
478 | - g_free (rebind_stdout); |
479 | - g_free (rebind_stderr); |
480 | - g_string_free (string, TRUE); |
481 | - return ret; |
482 | -} |
483 | -static void |
484 | -libnotify_cb (NotifyNotification *notification, gchar *action, gpointer data) |
485 | -{ |
486 | - GsdUpdatesFirmware *firmware = GSD_UPDATES_FIRMWARE (data); |
487 | - |
488 | - if (g_strcmp0 (action, "install-firmware") == 0) { |
489 | - install_package_ids (firmware); |
490 | - } else if (g_strcmp0 (action, "ignore-devices") == 0) { |
491 | - ignore_devices (firmware); |
492 | - } else { |
493 | - g_warning ("unknown action id: %s", action); |
494 | - } |
495 | - notify_notification_close (notification, NULL); |
496 | -} |
497 | - |
498 | -static void |
499 | -on_notification_closed (NotifyNotification *notification, gpointer data) |
500 | -{ |
501 | - g_object_unref (notification); |
502 | -} |
503 | - |
504 | -static void |
505 | -require_restart (GsdUpdatesFirmware *firmware) |
506 | -{ |
507 | - const gchar *message; |
508 | - gboolean ret; |
509 | - GError *error = NULL; |
510 | - NotifyNotification *notification; |
511 | - |
512 | - /* TRANSLATORS: we need to restart so the new hardware can re-request the firmware */ |
513 | - message = _("You will need to restart this computer before the hardware will work correctly."); |
514 | - |
515 | - /* TRANSLATORS: title of libnotify bubble */ |
516 | - notification = notify_notification_new (_("Additional software was installed"), message, NULL); |
517 | - notify_notification_set_hint_string (notification, "desktop-entry", "gpk-update-viewer"); |
518 | - notify_notification_set_app_name (notification, _("Software Updates")); |
519 | - notify_notification_set_timeout (notification, NOTIFY_EXPIRES_NEVER); |
520 | - notify_notification_set_urgency (notification, NOTIFY_URGENCY_LOW); |
521 | - g_signal_connect (notification, "closed", |
522 | - G_CALLBACK (on_notification_closed), NULL); |
523 | - |
524 | - /* show the bubble */ |
525 | - ret = notify_notification_show (notification, &error); |
526 | - if (!ret) { |
527 | - g_warning ("error: %s", error->message); |
528 | - g_error_free (error); |
529 | - } |
530 | -} |
531 | - |
532 | -static void |
533 | -require_replug (GsdUpdatesFirmware *firmware) |
534 | -{ |
535 | - const gchar *message; |
536 | - gboolean ret; |
537 | - GError *error = NULL; |
538 | - NotifyNotification *notification; |
539 | - |
540 | - /* TRANSLATORS: we need to remove an replug so the new hardware can re-request the firmware */ |
541 | - message = _("You will need to remove and then reinsert the hardware before it will work correctly."); |
542 | - |
543 | - /* TRANSLATORS: title of libnotify bubble */ |
544 | - notification = notify_notification_new (_("Additional software was installed"), message, NULL); |
545 | - notify_notification_set_hint_string (notification, "desktop-entry", "gpk-update-viewer"); |
546 | - notify_notification_set_app_name (notification, _("Software Updates")); |
547 | - notify_notification_set_timeout (notification, NOTIFY_EXPIRES_NEVER); |
548 | - notify_notification_set_urgency (notification, NOTIFY_URGENCY_LOW); |
549 | - g_signal_connect (notification, "closed", |
550 | - G_CALLBACK (on_notification_closed), NULL); |
551 | - |
552 | - /* show the bubble */ |
553 | - ret = notify_notification_show (notification, &error); |
554 | - if (!ret) { |
555 | - g_warning ("error: %s", error->message); |
556 | - g_error_free (error); |
557 | - } |
558 | -} |
559 | - |
560 | -static void |
561 | -require_nothing (GsdUpdatesFirmware *firmware) |
562 | -{ |
563 | - const gchar *message; |
564 | - gboolean ret; |
565 | - GError *error = NULL; |
566 | - NotifyNotification *notification; |
567 | - |
568 | - /* TRANSLATORS: we need to remove an replug so the new hardware can re-request the firmware */ |
569 | - message = _("Your hardware has been set up and is now ready to use."); |
570 | - |
571 | - /* TRANSLATORS: title of libnotify bubble */ |
572 | - notification = notify_notification_new (_("Additional software was installed"), message, NULL); |
573 | - notify_notification_set_hint_string (notification, "desktop-entry", "gpk-update-viewer"); |
574 | - notify_notification_set_app_name (notification, _("Software Updates")); |
575 | - notify_notification_set_timeout (notification, NOTIFY_EXPIRES_NEVER); |
576 | - notify_notification_set_urgency (notification, NOTIFY_URGENCY_LOW); |
577 | - g_signal_connect (notification, "closed", |
578 | - G_CALLBACK (on_notification_closed), NULL); |
579 | - |
580 | - /* show the bubble */ |
581 | - ret = notify_notification_show (notification, &error); |
582 | - if (!ret) { |
583 | - g_warning ("error: %s", error->message); |
584 | - g_error_free (error); |
585 | - } |
586 | -} |
587 | - |
588 | -static void |
589 | -install_packages_cb (GObject *object, |
590 | - GAsyncResult *res, |
591 | - GsdUpdatesFirmware *firmware) |
592 | -{ |
593 | - PkClient *client = PK_CLIENT (object); |
594 | - GError *error = NULL; |
595 | - PkResults *results = NULL; |
596 | - GPtrArray *array = NULL; |
597 | - gboolean restart = FALSE; |
598 | - const GsdUpdatesFirmwareRequest *req; |
599 | - gboolean ret; |
600 | - guint i; |
601 | - PkError *error_code = NULL; |
602 | - |
603 | - /* get the results */ |
604 | - results = pk_client_generic_finish (client, res, &error); |
605 | - if (results == NULL) { |
606 | - g_warning ("failed to install file: %s", error->message); |
607 | - g_error_free (error); |
608 | - goto out; |
609 | - } |
610 | - |
611 | - /* check error code */ |
612 | - error_code = pk_results_get_error_code (results); |
613 | - if (error_code != NULL) { |
614 | - g_warning ("failed to install file: %s, %s", |
615 | - pk_error_enum_to_string (pk_error_get_code (error_code)), |
616 | - pk_error_get_details (error_code)); |
617 | - goto out; |
618 | - } |
619 | - |
620 | - /* go through all the requests, and find the worst type */ |
621 | - array = firmware->priv->array_requested; |
622 | - for (i=0; i<array->len; i++) { |
623 | - req = g_ptr_array_index (array, i); |
624 | - ret = subsystem_can_replug (req->subsystem); |
625 | - if (!ret) { |
626 | - restart = TRUE; |
627 | - break; |
628 | - } |
629 | - } |
630 | - |
631 | - /* can we just rebind the device */ |
632 | - ret = g_file_test (GSD_UPDATES_FIRMWARE_DEVICE_REBIND_PROGRAM, G_FILE_TEST_EXISTS); |
633 | - if (ret) { |
634 | - ret = device_rebind (firmware); |
635 | - if (ret) { |
636 | - require_nothing (firmware); |
637 | - goto out; |
638 | - } |
639 | - } else { |
640 | - /* give the user the correct message */ |
641 | - if (restart) |
642 | - require_restart (firmware); |
643 | - else |
644 | - require_replug (firmware); |
645 | - } |
646 | - |
647 | - /* clear array */ |
648 | - g_ptr_array_set_size (firmware->priv->array_requested, 0); |
649 | -out: |
650 | - if (error_code != NULL) |
651 | - g_object_unref (error_code); |
652 | - if (array != NULL) |
653 | - g_ptr_array_unref (array); |
654 | - if (results != NULL) |
655 | - g_object_unref (results); |
656 | -} |
657 | - |
658 | -static gchar ** |
659 | -package_array_to_strv (GPtrArray *array) |
660 | -{ |
661 | - PkPackage *item; |
662 | - gchar **results; |
663 | - guint i; |
664 | - |
665 | - results = g_new0 (gchar *, array->len+1); |
666 | - for (i=0; i<array->len; i++) { |
667 | - item = g_ptr_array_index (array, i); |
668 | - results[i] = g_strdup (pk_package_get_id (item)); |
669 | - } |
670 | - return results; |
671 | -} |
672 | - |
673 | -static void |
674 | -install_package_ids (GsdUpdatesFirmware *firmware) |
675 | -{ |
676 | - gchar **package_ids; |
677 | - |
678 | - /* install all of the firmware files */ |
679 | - package_ids = package_array_to_strv (firmware->priv->packages_found); |
680 | - pk_client_install_packages_async (PK_CLIENT(firmware->priv->task), |
681 | - TRUE, package_ids, |
682 | - NULL, |
683 | - NULL, NULL, |
684 | - (GAsyncReadyCallback) install_packages_cb, |
685 | - firmware); |
686 | - g_strfreev (package_ids); |
687 | -} |
688 | - |
689 | -static void |
690 | -ignore_devices (GsdUpdatesFirmware *firmware) |
691 | -{ |
692 | - gchar *existing = NULL; |
693 | - GsdUpdatesFirmwareRequest *req; |
694 | - GPtrArray *array; |
695 | - GString *string; |
696 | - guint i; |
697 | - |
698 | - /* get from settings */ |
699 | - existing = g_settings_get_string (firmware->priv->settings, |
700 | - GSD_SETTINGS_IGNORED_DEVICES); |
701 | - |
702 | - /* get existing string */ |
703 | - string = g_string_new (existing); |
704 | - if (string->len > 0) |
705 | - g_string_append (string, ","); |
706 | - |
707 | - /* add all listed devices */ |
708 | - array = firmware->priv->array_requested; |
709 | - for (i=0; i<array->len; i++) { |
710 | - req = g_ptr_array_index (array, i); |
711 | - g_string_append_printf (string, "%s,", req->id); |
712 | - } |
713 | - |
714 | - /* remove final ',' */ |
715 | - if (string->len > 2) |
716 | - g_string_set_size (string, string->len - 1); |
717 | - |
718 | - /* set new string */ |
719 | - g_settings_set_string (firmware->priv->settings, |
720 | - GSD_SETTINGS_IGNORED_DEVICES, |
721 | - string->str); |
722 | - |
723 | - g_free (existing); |
724 | - g_string_free (string, TRUE); |
725 | -} |
726 | - |
727 | -static PkPackage * |
728 | -check_available (GsdUpdatesFirmware *firmware, const gchar *filename) |
729 | -{ |
730 | - guint length = 0; |
731 | - GPtrArray *array = NULL; |
732 | - GError *error = NULL; |
733 | - PkPackage *item = NULL; |
734 | - PkBitfield filter; |
735 | - PkResults *results; |
736 | - gchar **values = NULL; |
737 | - PkError *error_code = NULL; |
738 | - |
739 | - /* search for newest not installed package */ |
740 | - filter = pk_bitfield_from_enums (PK_FILTER_ENUM_NOT_INSTALLED, |
741 | - PK_FILTER_ENUM_NEWEST, -1); |
742 | - values = g_strsplit (filename, "&", -1); |
743 | - results = pk_client_search_files (PK_CLIENT(firmware->priv->task), |
744 | - filter, |
745 | - values, |
746 | - NULL, |
747 | - NULL, NULL, |
748 | - &error); |
749 | - if (results == NULL) { |
750 | - g_warning ("failed to search file %s: %s", |
751 | - filename, error->message); |
752 | - g_error_free (error); |
753 | - goto out; |
754 | - } |
755 | - |
756 | - /* check error code */ |
757 | - error_code = pk_results_get_error_code (results); |
758 | - if (error_code != NULL) { |
759 | - g_warning ("failed to search file: %s, %s", |
760 | - pk_error_enum_to_string (pk_error_get_code (error_code)), |
761 | - pk_error_get_details (error_code)); |
762 | - goto out; |
763 | - } |
764 | - |
765 | - /* make sure we have one package */ |
766 | - array = pk_results_get_package_array (results); |
767 | - if (array->len == 0) |
768 | - g_debug ("no package providing %s found", filename); |
769 | - else if (array->len != 1) |
770 | - g_warning ("not one package providing %s found (%i)", filename, length); |
771 | - else |
772 | - item = g_object_ref (g_ptr_array_index (array, 0)); |
773 | -out: |
774 | - g_strfreev (values); |
775 | - if (error_code != NULL) |
776 | - g_object_unref (error_code); |
777 | - if (array != NULL) |
778 | - g_ptr_array_unref (array); |
779 | - if (results != NULL) |
780 | - g_object_unref (results); |
781 | - return item; |
782 | -} |
783 | - |
784 | -static void |
785 | -remove_duplicate (GPtrArray *array) |
786 | -{ |
787 | - guint i, j; |
788 | - const gchar *val; |
789 | - const gchar *val_tmp; |
790 | - |
791 | - /* remove each duplicate entry */ |
792 | - for (i=0; i<array->len; i++) { |
793 | - val = g_ptr_array_index (array, i); |
794 | - for (j=i+1; j<array->len; j++) { |
795 | - val_tmp = g_ptr_array_index (array, j); |
796 | - if (g_strcmp0 (val_tmp, val) == 0) |
797 | - g_ptr_array_remove_index_fast (array, j); |
798 | - } |
799 | - } |
800 | -} |
801 | - |
802 | -static gboolean |
803 | -delay_timeout_cb (gpointer data) |
804 | -{ |
805 | - guint i; |
806 | - gboolean ret; |
807 | - GString *string; |
808 | - GsdUpdatesFirmware *firmware = GSD_UPDATES_FIRMWARE (data); |
809 | - NotifyNotification *notification; |
810 | - GPtrArray *array; |
811 | - GError *error = NULL; |
812 | - PkPackage *item = NULL; |
813 | - const GsdUpdatesFirmwareRequest *req; |
814 | - gboolean has_data = FALSE; |
815 | - |
816 | - /* message string */ |
817 | - string = g_string_new (""); |
818 | - |
819 | - /* try to find each firmware file in an available package */ |
820 | - array = firmware->priv->array_requested; |
821 | - for (i=0; i<array->len; i++) { |
822 | - req = g_ptr_array_index (array, i); |
823 | - /* save to new array if we found one package for this file */ |
824 | - item = check_available (firmware, req->filename); |
825 | - if (item != NULL) { |
826 | - g_ptr_array_add (firmware->priv->packages_found, item); |
827 | - g_object_unref (item); |
828 | - } |
829 | - } |
830 | - |
831 | - /* nothing to do */ |
832 | - if (firmware->priv->packages_found->len == 0) { |
833 | - g_debug ("no packages providing any of the missing firmware"); |
834 | - goto out; |
835 | - } |
836 | - |
837 | - /* check we don't want the same package more than once */ |
838 | - remove_duplicate (firmware->priv->packages_found); |
839 | - |
840 | - /* have we got any models to array */ |
841 | - for (i=0; i<array->len; i++) { |
842 | - req = g_ptr_array_index (array, i); |
843 | - if (req->model != NULL) { |
844 | - has_data = TRUE; |
845 | - break; |
846 | - } |
847 | - } |
848 | - |
849 | - /* TRANSLATORS: we need another package to keep udev quiet */ |
850 | - g_string_append (string, _("Additional firmware is required to make hardware in this computer function correctly.")); |
851 | - |
852 | - /* sdd what information we have */ |
853 | - if (has_data) { |
854 | - g_string_append (string, "\n"); |
855 | - for (i=0; i<array->len; i++) { |
856 | - req = g_ptr_array_index (array, i); |
857 | - if (req->model != NULL) |
858 | - g_string_append_printf (string, "\n• %s", req->model); |
859 | - } |
860 | - g_string_append (string, "\n"); |
861 | - } |
862 | - |
863 | - /* TRANSLATORS: title of libnotify bubble */ |
864 | - notification = notify_notification_new (_("Additional firmware required"), string->str, NULL); |
865 | - notify_notification_set_hint_string (notification, "desktop-entry", "gpk-update-viewer"); |
866 | - notify_notification_set_app_name (notification, _("Software Updates")); |
867 | - notify_notification_set_timeout (notification, NOTIFY_EXPIRES_NEVER); |
868 | - notify_notification_set_urgency (notification, NOTIFY_URGENCY_LOW); |
869 | - notify_notification_add_action (notification, "install-firmware", |
870 | - /* TRANSLATORS: button label */ |
871 | - _("Install firmware"), libnotify_cb, firmware, NULL); |
872 | - notify_notification_add_action (notification, "ignore-devices", |
873 | - /* TRANSLATORS: we should ignore this device and not ask anymore */ |
874 | - _("Ignore devices"), libnotify_cb, firmware, NULL); |
875 | - g_signal_connect (notification, "closed", |
876 | - G_CALLBACK (on_notification_closed), NULL); |
877 | - |
878 | - ret = notify_notification_show (notification, &error); |
879 | - if (!ret) { |
880 | - g_warning ("error: %s", error->message); |
881 | - g_error_free (error); |
882 | - } |
883 | - |
884 | -out: |
885 | - g_string_free (string, TRUE); |
886 | - /* never repeat */ |
887 | - return FALSE; |
888 | -} |
889 | - |
890 | -static void |
891 | -remove_banned (GsdUpdatesFirmware *firmware, GPtrArray *array) |
892 | -{ |
893 | - gboolean ret; |
894 | - gchar **banned = NULL; |
895 | - gchar *banned_str; |
896 | - GsdUpdatesFirmwareRequest *req; |
897 | - guint i, j; |
898 | - |
899 | - /* get from settings */ |
900 | - banned_str = g_settings_get_string (firmware->priv->settings, |
901 | - GSD_SETTINGS_BANNED_FIRMWARE); |
902 | - if (banned_str == NULL) { |
903 | - g_warning ("could not read banned list"); |
904 | - goto out; |
905 | - } |
906 | - |
907 | - /* nothing in list, common case */ |
908 | - if (banned_str[0] == '\0') { |
909 | - g_debug ("nothing in banned list"); |
910 | - goto out; |
911 | - } |
912 | - |
913 | - /* split using "," */ |
914 | - banned = g_strsplit (banned_str, ",", 0); |
915 | - |
916 | - /* remove any banned pattern matches */ |
917 | - i = 0; |
918 | - while (i < array->len) { |
919 | - ret = FALSE; |
920 | - req = g_ptr_array_index (array, i); |
921 | - for (j=0; banned[j] != NULL; j++) { |
922 | - ret = g_pattern_match_simple (banned[j], req->filename); |
923 | - if (ret) { |
924 | - g_debug ("match %s for %s, removing", |
925 | - banned[j], req->filename); |
926 | - g_ptr_array_remove_index_fast (array, i); |
927 | - break; |
928 | - } |
929 | - } |
930 | - if (!ret) |
931 | - i++; |
932 | - } |
933 | -out: |
934 | - g_free (banned_str); |
935 | - g_strfreev (banned); |
936 | -} |
937 | - |
938 | -static void |
939 | -remove_ignored (GsdUpdatesFirmware *firmware, GPtrArray *array) |
940 | -{ |
941 | - gboolean ret; |
942 | - gchar **ignored = NULL; |
943 | - gchar *ignored_str; |
944 | - GsdUpdatesFirmwareRequest *req; |
945 | - guint i, j; |
946 | - |
947 | - /* get from settings */ |
948 | - ignored_str = g_settings_get_string (firmware->priv->settings, |
949 | - GSD_SETTINGS_IGNORED_DEVICES); |
950 | - if (ignored_str == NULL) { |
951 | - g_warning ("could not read ignored list"); |
952 | - goto out; |
953 | - } |
954 | - |
955 | - /* nothing in list, common case */ |
956 | - if (ignored_str[0] == '\0') { |
957 | - g_debug ("nothing in ignored list"); |
958 | - goto out; |
959 | - } |
960 | - |
961 | - /* split using "," */ |
962 | - ignored = g_strsplit (ignored_str, ",", 0); |
963 | - |
964 | - /* remove any ignored pattern matches */ |
965 | - i = 0; |
966 | - while (i < array->len) { |
967 | - ret = FALSE; |
968 | - req = g_ptr_array_index (array, i); |
969 | - if (req->id == NULL) |
970 | - continue; |
971 | - for (j=0; ignored[j] != NULL; j++) { |
972 | - ret = g_pattern_match_simple (ignored[j], req->id); |
973 | - if (ret) { |
974 | - g_debug ("match %s for %s, removing", ignored[j], req->id); |
975 | - g_ptr_array_remove_index_fast (array, i); |
976 | - break; |
977 | - } |
978 | - } |
979 | - if (!ret) |
980 | - i++; |
981 | - } |
982 | -out: |
983 | - g_free (ignored_str); |
984 | - g_strfreev (ignored); |
985 | -} |
986 | - |
987 | -static gchar * |
988 | -udev_text_decode (const gchar *data) |
989 | -{ |
990 | - guint i; |
991 | - guint j; |
992 | - gchar *decode; |
993 | - |
994 | - decode = g_strdup (data); |
995 | - for (i = 0, j = 0; data[i] != '\0'; j++) { |
996 | - if (memcmp (&data[i], "\\x2f", 4) == 0) { |
997 | - decode[j] = '/'; |
998 | - i += 4; |
999 | - } else if (memcmp (&data[i], "\\x5c", 4) == 0) { |
1000 | - decode[j] = '\\'; |
1001 | - i += 4; |
1002 | - } else { |
1003 | - decode[j] = data[i]; |
1004 | - i++; |
1005 | - } |
1006 | - } |
1007 | - decode[j] = '\0'; |
1008 | - return decode; |
1009 | -} |
1010 | - |
1011 | -static gchar * |
1012 | -get_device (GsdUpdatesFirmware *firmware, const gchar *filename) |
1013 | -{ |
1014 | - GFile *file; |
1015 | - GFileInfo *info; |
1016 | - const gchar *symlink_path; |
1017 | - gchar *syspath = NULL; |
1018 | - GError *error = NULL; |
1019 | - gchar *target = NULL; |
1020 | - gchar *tmp; |
1021 | - |
1022 | - /* get the file data */ |
1023 | - file = g_file_new_for_path (filename); |
1024 | - info = g_file_query_info (file, |
1025 | - G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET, |
1026 | - G_FILE_QUERY_INFO_NONE, |
1027 | - NULL, |
1028 | - &error); |
1029 | - if (info == NULL) { |
1030 | - g_warning ("Failed to get symlink: %s", |
1031 | - error->message); |
1032 | - g_error_free (error); |
1033 | - goto out; |
1034 | - } |
1035 | - |
1036 | - /* /devices/pci0000:00/0000:00:1d.0/usb5/5-2/firmware/5-2 */ |
1037 | - symlink_path = g_file_info_get_symlink_target (info); |
1038 | - if (symlink_path == NULL) { |
1039 | - g_warning ("failed to get symlink target"); |
1040 | - goto out; |
1041 | - } |
1042 | - |
1043 | - /* prepend sys to make '/sys/devices/pci0000:00/0000:00:1d.0/usb5/5-2/firmware/5-2' */ |
1044 | - syspath = g_strconcat ("/sys", symlink_path, NULL); |
1045 | - |
1046 | - /* start with the longest, and try to find a sub-path that exists */ |
1047 | - tmp = &syspath[strlen (syspath)]; |
1048 | - while (tmp != NULL) { |
1049 | - *tmp = '\0'; |
1050 | - g_debug ("testing %s", target); |
1051 | - if (g_file_test (syspath, G_FILE_TEST_EXISTS)) { |
1052 | - target = g_strdup (syspath); |
1053 | - goto out; |
1054 | - } |
1055 | - tmp = g_strrstr (syspath, "/"); |
1056 | - } |
1057 | -out: |
1058 | - if (info != NULL) |
1059 | - g_object_unref (info); |
1060 | - g_object_unref (file); |
1061 | - g_free (syspath); |
1062 | - return target; |
1063 | -} |
1064 | - |
1065 | -static void |
1066 | -add_filename (GsdUpdatesFirmware *firmware, const gchar *filename_no_path) |
1067 | -{ |
1068 | - gboolean ret; |
1069 | - gchar *filename_path = NULL; |
1070 | - gchar *missing_path = NULL; |
1071 | - gchar *sysfs_path = NULL; |
1072 | - GsdUpdatesFirmwareRequest *req; |
1073 | - GPtrArray *array; |
1074 | - guint i; |
1075 | - |
1076 | - /* this is the file we want to load */ |
1077 | - filename_path = g_build_filename (GSD_UPDATES_FIRMWARE_LOADING_DIR, |
1078 | - filename_no_path, NULL); |
1079 | - |
1080 | - /* file already exists */ |
1081 | - ret = g_file_test (filename_path, G_FILE_TEST_EXISTS); |
1082 | - if (ret) |
1083 | - goto out; |
1084 | - |
1085 | - /* this is the file that udev created for us */ |
1086 | - missing_path = g_build_filename (GSD_UPDATES_FIRMWARE_MISSING_DIR, |
1087 | - filename_no_path, NULL); |
1088 | - g_debug ("filename=%s -> %s", missing_path, filename_path); |
1089 | - |
1090 | - /* get symlink target */ |
1091 | - sysfs_path = get_device (firmware, missing_path); |
1092 | - if (sysfs_path == NULL) |
1093 | - goto out; |
1094 | - |
1095 | - /* find any previous requests with this path or firmware */ |
1096 | - array = firmware->priv->array_requested; |
1097 | - for (i=0; i<array->len; i++) { |
1098 | - req = g_ptr_array_index (array, i); |
1099 | - if (g_strcmp0 (sysfs_path, req->sysfs_path) == 0) { |
1100 | - g_debug ("ignoring previous sysfs request for %s", |
1101 | - sysfs_path); |
1102 | - goto out; |
1103 | - } |
1104 | - if (g_strcmp0 (filename_path, req->filename) == 0) { |
1105 | - g_debug ("ignoring previous filename request for %s", |
1106 | - filename_path); |
1107 | - goto out; |
1108 | - } |
1109 | - } |
1110 | - |
1111 | - /* create new request object */ |
1112 | - req = request_new (filename_path, sysfs_path); |
1113 | - g_ptr_array_add (firmware->priv->array_requested, req); |
1114 | -out: |
1115 | - g_free (missing_path); |
1116 | - g_free (filename_path); |
1117 | - g_free (sysfs_path); |
1118 | -} |
1119 | - |
1120 | -static void |
1121 | -scan_directory (GsdUpdatesFirmware *firmware) |
1122 | -{ |
1123 | - gboolean ret; |
1124 | - GError *error = NULL; |
1125 | - GDir *dir; |
1126 | - const gchar *filename; |
1127 | - gchar *filename_decoded; |
1128 | - guint i; |
1129 | - GPtrArray *array; |
1130 | - const GsdUpdatesFirmwareRequest *req; |
1131 | - guint scan_id = 0; |
1132 | - |
1133 | - /* should we check and show the user */ |
1134 | - ret = g_settings_get_boolean (firmware->priv->settings, |
1135 | - GSD_SETTINGS_ENABLE_CHECK_FIRMWARE); |
1136 | - if (!ret) { |
1137 | - g_debug ("not showing thanks to GSettings"); |
1138 | - return; |
1139 | - } |
1140 | - |
1141 | - /* open the directory of requests */ |
1142 | - dir = g_dir_open (GSD_UPDATES_FIRMWARE_MISSING_DIR, 0, &error); |
1143 | - if (dir == NULL) { |
1144 | - if (error->code != G_FILE_ERROR_NOENT) { |
1145 | - g_warning ("failed to open directory: %s", |
1146 | - error->message); |
1147 | - } |
1148 | - g_error_free (error); |
1149 | - return; |
1150 | - } |
1151 | - |
1152 | - /* find all the firmware requests */ |
1153 | - filename = g_dir_read_name (dir); |
1154 | - while (filename != NULL) { |
1155 | - |
1156 | - filename_decoded = udev_text_decode (filename); |
1157 | - add_filename (firmware, filename_decoded); |
1158 | - g_free (filename_decoded); |
1159 | - |
1160 | - /* next file */ |
1161 | - filename = g_dir_read_name (dir); |
1162 | - } |
1163 | - g_dir_close (dir); |
1164 | - |
1165 | - /* debugging */ |
1166 | - array = firmware->priv->array_requested; |
1167 | - for (i=0; i<array->len; i++) { |
1168 | - req = g_ptr_array_index (array, i); |
1169 | - g_debug ("requested: %s", req->filename); |
1170 | - } |
1171 | - |
1172 | - /* remove banned files */ |
1173 | - remove_banned (firmware, array); |
1174 | - |
1175 | - /* remove ignored devices */ |
1176 | - remove_ignored (firmware, array); |
1177 | - |
1178 | - /* debugging */ |
1179 | - array = firmware->priv->array_requested; |
1180 | - for (i=0; i<array->len; i++) { |
1181 | - req = g_ptr_array_index (array, i); |
1182 | - g_debug ("searching for: %s", req->filename); |
1183 | - } |
1184 | - |
1185 | - /* don't spam the user at startup, so wait a little delay */ |
1186 | - if (array->len > 0) { |
1187 | - scan_id = g_timeout_add_seconds (GSD_UPDATES_FIRMWARE_PROCESS_DELAY, |
1188 | - delay_timeout_cb, |
1189 | - firmware); |
1190 | - g_source_set_name_by_id (scan_id, "[GsdUpdatesFirmware] process"); |
1191 | - } |
1192 | -} |
1193 | - |
1194 | -static gboolean |
1195 | -scan_directory_cb (GsdUpdatesFirmware *firmware) |
1196 | -{ |
1197 | - scan_directory (firmware); |
1198 | - firmware->priv->timeout_id = 0; |
1199 | - return FALSE; |
1200 | -} |
1201 | - |
1202 | -static void |
1203 | -monitor_changed_cb (GFileMonitor *monitor, |
1204 | - GFile *file, |
1205 | - GFile *other_file, |
1206 | - GFileMonitorEvent event_type, |
1207 | - GsdUpdatesFirmware *firmware) |
1208 | -{ |
1209 | - if (firmware->priv->timeout_id > 0) { |
1210 | - g_debug ("clearing timeout as device changed"); |
1211 | - g_source_remove (firmware->priv->timeout_id); |
1212 | - } |
1213 | - |
1214 | - /* wait for the device to settle */ |
1215 | - firmware->priv->timeout_id = |
1216 | - g_timeout_add_seconds (GSD_UPDATES_FIRMWARE_INSERT_DELAY, |
1217 | - (GSourceFunc) scan_directory_cb, |
1218 | - firmware); |
1219 | - g_source_set_name_by_id (firmware->priv->timeout_id, |
1220 | - "[GsdUpdatesFirmware] changed"); |
1221 | -} |
1222 | - |
1223 | -static void |
1224 | -gsd_updates_firmware_class_init (GsdUpdatesFirmwareClass *klass) |
1225 | -{ |
1226 | - GObjectClass *object_class = G_OBJECT_CLASS (klass); |
1227 | - object_class->finalize = gsd_updates_firmware_finalize; |
1228 | - g_type_class_add_private (klass, sizeof (GsdUpdatesFirmwarePrivate)); |
1229 | -} |
1230 | - |
1231 | -static void |
1232 | -gsd_updates_firmware_init (GsdUpdatesFirmware *firmware) |
1233 | -{ |
1234 | - GFile *file; |
1235 | - GError *error = NULL; |
1236 | - |
1237 | - firmware->priv = GSD_UPDATES_FIRMWARE_GET_PRIVATE (firmware); |
1238 | - firmware->priv->timeout_id = 0; |
1239 | - firmware->priv->packages_found = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref); |
1240 | - firmware->priv->array_requested = g_ptr_array_new_with_free_func ((GDestroyNotify) request_free); |
1241 | - firmware->priv->settings = g_settings_new (GSD_SETTINGS_SCHEMA); |
1242 | - firmware->priv->task = pk_task_new (); |
1243 | - g_object_set (firmware->priv->task, |
1244 | - "background", TRUE, |
1245 | - NULL); |
1246 | - |
1247 | - /* setup watch for new hardware */ |
1248 | - file = g_file_new_for_path (GSD_UPDATES_FIRMWARE_MISSING_DIR); |
1249 | - firmware->priv->monitor = g_file_monitor (file, |
1250 | - G_FILE_MONITOR_NONE, |
1251 | - NULL, |
1252 | - &error); |
1253 | - if (firmware->priv->monitor == NULL) { |
1254 | - g_warning ("failed to setup monitor: %s", error->message); |
1255 | - g_error_free (error); |
1256 | - goto out; |
1257 | - } |
1258 | - |
1259 | - /* limit to one per second */ |
1260 | - g_file_monitor_set_rate_limit (firmware->priv->monitor, 1000); |
1261 | - |
1262 | - /* get notified of changes */ |
1263 | - g_signal_connect (firmware->priv->monitor, "changed", |
1264 | - G_CALLBACK (monitor_changed_cb), firmware); |
1265 | -out: |
1266 | - g_object_unref (file); |
1267 | - firmware->priv->timeout_id = |
1268 | - g_timeout_add_seconds (GSD_UPDATES_FIRMWARE_LOGIN_DELAY, |
1269 | - (GSourceFunc) scan_directory_cb, |
1270 | - firmware); |
1271 | - g_source_set_name_by_id (firmware->priv->timeout_id, |
1272 | - "[GsdUpdatesFirmware] login coldplug"); |
1273 | -} |
1274 | - |
1275 | -static void |
1276 | -gsd_updates_firmware_finalize (GObject *object) |
1277 | -{ |
1278 | - GsdUpdatesFirmware *firmware; |
1279 | - |
1280 | - g_return_if_fail (GSD_UPDATES_IS_FIRMWARE (object)); |
1281 | - |
1282 | - firmware = GSD_UPDATES_FIRMWARE (object); |
1283 | - |
1284 | - g_return_if_fail (firmware->priv != NULL); |
1285 | - g_ptr_array_unref (firmware->priv->array_requested); |
1286 | - g_ptr_array_unref (firmware->priv->packages_found); |
1287 | - g_object_unref (PK_CLIENT(firmware->priv->task)); |
1288 | - g_object_unref (firmware->priv->settings); |
1289 | - if (firmware->priv->monitor != NULL) |
1290 | - g_object_unref (firmware->priv->monitor); |
1291 | - if (firmware->priv->timeout_id > 0) |
1292 | - g_source_remove (firmware->priv->timeout_id); |
1293 | - |
1294 | - G_OBJECT_CLASS (gsd_updates_firmware_parent_class)->finalize (object); |
1295 | -} |
1296 | - |
1297 | -GsdUpdatesFirmware * |
1298 | -gsd_updates_firmware_new (void) |
1299 | -{ |
1300 | - GsdUpdatesFirmware *firmware; |
1301 | - firmware = g_object_new (GSD_UPDATES_TYPE_FIRMWARE, NULL); |
1302 | - return GSD_UPDATES_FIRMWARE (firmware); |
1303 | -} |
1304 | |
1305 | === removed file 'plugins/updates/gsd-updates-firmware.h' |
1306 | --- plugins/updates/gsd-updates-firmware.h 2011-02-16 22:42:51 +0000 |
1307 | +++ plugins/updates/gsd-updates-firmware.h 1970-01-01 00:00:00 +0000 |
1308 | @@ -1,52 +0,0 @@ |
1309 | -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- |
1310 | - * |
1311 | - * Copyright (C) 2007-2011 Richard Hughes <richard@hughsie.com> |
1312 | - * |
1313 | - * Licensed under the GNU General Public License Version 2 |
1314 | - * |
1315 | - * This program is free software; you can redistribute it and/or modify |
1316 | - * it under the terms of the GNU General Public License as published by |
1317 | - * the Free Software Foundation; either version 2 of the License, or |
1318 | - * (at your option) any later version. |
1319 | - * |
1320 | - * This program is distributed in the hope that it will be useful, |
1321 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1322 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1323 | - * GNU General Public License for more details. |
1324 | - * |
1325 | - * You should have received a copy of the GNU General Public License |
1326 | - * along with this program; if not, write to the Free Software |
1327 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
1328 | - */ |
1329 | - |
1330 | -#ifndef __GSD_UPDATES_FIRMWARE_H |
1331 | -#define __GSD_UPDATES_FIRMWARE_H |
1332 | - |
1333 | -#include <glib-object.h> |
1334 | - |
1335 | -G_BEGIN_DECLS |
1336 | - |
1337 | -#define GSD_UPDATES_TYPE_FIRMWARE (gsd_updates_firmware_get_type ()) |
1338 | -#define GSD_UPDATES_FIRMWARE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_UPDATES_TYPE_FIRMWARE, GsdUpdatesFirmware)) |
1339 | -#define GSD_UPDATES_FIRMWARE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSD_UPDATES_TYPE_FIRMWARE, GsdUpdatesFirmwareClass)) |
1340 | -#define GSD_UPDATES_IS_FIRMWARE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_UPDATES_TYPE_FIRMWARE)) |
1341 | - |
1342 | -typedef struct GsdUpdatesFirmwarePrivate GsdUpdatesFirmwarePrivate; |
1343 | - |
1344 | -typedef struct |
1345 | -{ |
1346 | - GObject parent; |
1347 | - GsdUpdatesFirmwarePrivate *priv; |
1348 | -} GsdUpdatesFirmware; |
1349 | - |
1350 | -typedef struct |
1351 | -{ |
1352 | - GObjectClass parent_class; |
1353 | -} GsdUpdatesFirmwareClass; |
1354 | - |
1355 | -GType gsd_updates_firmware_get_type (void); |
1356 | -GsdUpdatesFirmware *gsd_updates_firmware_new (void); |
1357 | - |
1358 | -G_END_DECLS |
1359 | - |
1360 | -#endif /* __GSD_UPDATES_FIRMWARE_H */ |
1361 | |
1362 | === removed file 'plugins/updates/gsd-updates-manager.c' |
1363 | --- plugins/updates/gsd-updates-manager.c 2016-05-20 16:50:05 +0000 |
1364 | +++ plugins/updates/gsd-updates-manager.c 1970-01-01 00:00:00 +0000 |
1365 | @@ -1,1456 +0,0 @@ |
1366 | -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- |
1367 | - * |
1368 | - * Copyright (C) 2011 Richard Hughes <richard@hughsie.com> |
1369 | - * |
1370 | - * This program is free software; you can redistribute it and/or modify |
1371 | - * it under the terms of the GNU General Public License as published by |
1372 | - * the Free Software Foundation; either version 2 of the License, or |
1373 | - * (at your option) any later version. |
1374 | - * |
1375 | - * This program is distributed in the hope that it will be useful, |
1376 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1377 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1378 | - * GNU General Public License for more details. |
1379 | - * |
1380 | - * You should have received a copy of the GNU General Public License |
1381 | - * along with this program; if not, write to the Free Software |
1382 | - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1383 | - * |
1384 | - */ |
1385 | - |
1386 | -#include "config.h" |
1387 | - |
1388 | -#include <locale.h> |
1389 | - |
1390 | -#include <glib.h> |
1391 | -#include <glib/gi18n.h> |
1392 | -#include <gtk/gtk.h> |
1393 | -#include <packagekit-glib2/packagekit.h> |
1394 | -#include <libnotify/notify.h> |
1395 | -#include <gdesktop-enums.h> |
1396 | - |
1397 | -#include "gsd-enums.h" |
1398 | -#include "gsd-updates-manager.h" |
1399 | -#include "gsd-updates-firmware.h" |
1400 | -#include "gsd-updates-refresh.h" |
1401 | -#include "gsd-updates-common.h" |
1402 | -#include "gnome-settings-profile.h" |
1403 | -#include "gnome-settings-bus.h" |
1404 | - |
1405 | -#define GSD_UPDATES_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_UPDATES_MANAGER, GsdUpdatesManagerPrivate)) |
1406 | - |
1407 | -#define MAX_FAILED_GET_UPDATES 10 /* the maximum number of tries */ |
1408 | -#define GSD_UPDATES_ICON_NORMAL "software-update-available-symbolic" |
1409 | -#define GSD_UPDATES_ICON_URGENT "software-update-urgent-symbolic" |
1410 | -#define GSD_UPDATES_CHECK_OFFLINE_TIMEOUT 30 /* time in seconds */ |
1411 | - |
1412 | -struct GsdUpdatesManagerPrivate |
1413 | -{ |
1414 | - GCancellable *cancellable; |
1415 | - GsdUpdatesRefresh *refresh; |
1416 | - GsdUpdatesFirmware *firmware; |
1417 | - GSettings *settings_proxy; |
1418 | - GSettings *settings_ftp; |
1419 | - GSettings *settings_gsd; |
1420 | - GSettings *settings_http; |
1421 | - guint number_updates_critical_last_shown; |
1422 | - guint offline_update_id; |
1423 | - PkError *offline_update_error; |
1424 | - NotifyNotification *notification_updates; |
1425 | - PkControl *control; |
1426 | - PkTask *task; |
1427 | - guint inhibit_cookie; |
1428 | - GsdSessionManager *proxy_session; |
1429 | - guint update_viewer_watcher_id; |
1430 | - GVolumeMonitor *volume_monitor; |
1431 | - guint failed_get_updates_count; |
1432 | - GPtrArray *update_packages; |
1433 | -}; |
1434 | - |
1435 | -static void gsd_updates_manager_class_init (GsdUpdatesManagerClass *klass); |
1436 | -static void gsd_updates_manager_init (GsdUpdatesManager *updates_manager); |
1437 | - |
1438 | -G_DEFINE_TYPE (GsdUpdatesManager, gsd_updates_manager, G_TYPE_OBJECT) |
1439 | - |
1440 | -static gpointer manager_object = NULL; |
1441 | - |
1442 | -static void |
1443 | -child_exit_cb (GPid pid, gint status, gpointer user_data) |
1444 | -{ |
1445 | - g_spawn_close_pid (pid); |
1446 | -} |
1447 | - |
1448 | -static void |
1449 | -clear_offline_updates_message (void) |
1450 | -{ |
1451 | - gboolean ret; |
1452 | - GError *error = NULL; |
1453 | - gchar *argv[3]; |
1454 | - GPid pid; |
1455 | - |
1456 | - argv[0] = "pkexec"; |
1457 | - argv[1] = LIBEXECDIR "/pk-clear-offline-update"; |
1458 | - argv[2] = NULL; |
1459 | - ret = g_spawn_async (NULL, |
1460 | - argv, |
1461 | - NULL, |
1462 | - G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH, |
1463 | - NULL, |
1464 | - NULL, |
1465 | - &pid, |
1466 | - &error); |
1467 | - if (!ret) { |
1468 | - g_warning ("Failure clearing offline update message: %s", |
1469 | - error->message); |
1470 | - g_error_free (error); |
1471 | - return; |
1472 | - } |
1473 | - g_child_watch_add (pid, child_exit_cb, NULL); |
1474 | -} |
1475 | - |
1476 | -static void |
1477 | -show_offline_updates_error (GsdUpdatesManager *manager) |
1478 | -{ |
1479 | - const gchar *title; |
1480 | - gboolean show_geeky = FALSE; |
1481 | - GString *msg; |
1482 | - GtkWidget *dialog; |
1483 | - |
1484 | - /* TRANSLATORS: this is when the offline update failed */ |
1485 | - title = _("Failed To Update"); |
1486 | - msg = g_string_new (""); |
1487 | - switch (pk_error_get_code (manager->priv->offline_update_error)) { |
1488 | - case PK_ERROR_ENUM_UNFINISHED_TRANSACTION: |
1489 | - /* TRANSLATORS: the transaction could not be completed |
1490 | - * as a previous transaction was unfinished */ |
1491 | - g_string_append (msg, _("A previous update was unfinished.")); |
1492 | - show_geeky = TRUE; |
1493 | - break; |
1494 | - case PK_ERROR_ENUM_PACKAGE_DOWNLOAD_FAILED: |
1495 | - case PK_ERROR_ENUM_NO_CACHE: |
1496 | - case PK_ERROR_ENUM_NO_NETWORK: |
1497 | - case PK_ERROR_ENUM_NO_MORE_MIRRORS_TO_TRY: |
1498 | - case PK_ERROR_ENUM_CANNOT_FETCH_SOURCES: |
1499 | - /* TRANSLATORS: the package manager needed to download |
1500 | - * something with no network available */ |
1501 | - g_string_append (msg, _("Network access was required but not available.")); |
1502 | - break; |
1503 | - case PK_ERROR_ENUM_BAD_GPG_SIGNATURE: |
1504 | - case PK_ERROR_ENUM_CANNOT_UPDATE_REPO_UNSIGNED: |
1505 | - case PK_ERROR_ENUM_GPG_FAILURE: |
1506 | - case PK_ERROR_ENUM_MISSING_GPG_SIGNATURE: |
1507 | - case PK_ERROR_ENUM_PACKAGE_CORRUPT: |
1508 | - /* TRANSLATORS: if the package is not signed correctly |
1509 | - * */ |
1510 | - g_string_append (msg, _("An update was not signed in the correct way.")); |
1511 | - show_geeky = TRUE; |
1512 | - break; |
1513 | - case PK_ERROR_ENUM_DEP_RESOLUTION_FAILED: |
1514 | - case PK_ERROR_ENUM_FILE_CONFLICTS: |
1515 | - case PK_ERROR_ENUM_INCOMPATIBLE_ARCHITECTURE: |
1516 | - case PK_ERROR_ENUM_PACKAGE_CONFLICTS: |
1517 | - /* TRANSLATORS: the transaction failed in a way the user |
1518 | - * probably cannot comprehend. Package management systems |
1519 | - * really are teh suck.*/ |
1520 | - g_string_append (msg, _("The update could not be completed.")); |
1521 | - show_geeky = TRUE; |
1522 | - break; |
1523 | - case PK_ERROR_ENUM_TRANSACTION_CANCELLED: |
1524 | - /* TRANSLATORS: the user aborted the update manually */ |
1525 | - g_string_append (msg, _("The update was cancelled.")); |
1526 | - break; |
1527 | - case PK_ERROR_ENUM_NO_PACKAGES_TO_UPDATE: |
1528 | - case PK_ERROR_ENUM_UPDATE_NOT_FOUND: |
1529 | - /* TRANSLATORS: the user must have updated manually after |
1530 | - * the updates were prepared */ |
1531 | - g_string_append (msg, _("An offline update was requested but no packages required updating.")); |
1532 | - break; |
1533 | - case PK_ERROR_ENUM_NO_SPACE_ON_DEVICE: |
1534 | - /* TRANSLATORS: we ran out of disk space */ |
1535 | - g_string_append (msg, _("No space was left on the drive.")); |
1536 | - break; |
1537 | - case PK_ERROR_ENUM_PACKAGE_FAILED_TO_BUILD: |
1538 | - case PK_ERROR_ENUM_PACKAGE_FAILED_TO_INSTALL: |
1539 | - case PK_ERROR_ENUM_PACKAGE_FAILED_TO_REMOVE: |
1540 | - /* TRANSLATORS: the update process failed in a general |
1541 | - * way, usually this message will come from source distros |
1542 | - * like gentoo */ |
1543 | - g_string_append (msg, _("An update failed to install correctly.")); |
1544 | - show_geeky = TRUE; |
1545 | - break; |
1546 | - default: |
1547 | - /* TRANSLATORS: We didn't handle the error type */ |
1548 | - g_string_append (msg, _("The offline update failed in an unexpected way.")); |
1549 | - show_geeky = TRUE; |
1550 | - break; |
1551 | - } |
1552 | - if (show_geeky) { |
1553 | - g_string_append_printf (msg, "\n%s\n\n%s", |
1554 | - /* TRANSLATORS: these are geeky messages from the |
1555 | - * package manager no mortal is supposed to understand, |
1556 | - * but google might know what they mean */ |
1557 | - _("Detailed errors from the package manager follow:"), |
1558 | - pk_error_get_details (manager->priv->offline_update_error)); |
1559 | - } |
1560 | - dialog = gtk_message_dialog_new (NULL, |
1561 | - 0, |
1562 | - GTK_MESSAGE_INFO, |
1563 | - GTK_BUTTONS_CLOSE, |
1564 | - "%s", title); |
1565 | - gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), |
1566 | - "%s", msg->str); |
1567 | - g_signal_connect_swapped (dialog, "response", |
1568 | - G_CALLBACK (gtk_widget_destroy), |
1569 | - dialog); |
1570 | - gtk_widget_show (dialog); |
1571 | - clear_offline_updates_message (); |
1572 | - g_string_free (msg, TRUE); |
1573 | -} |
1574 | - |
1575 | -static void |
1576 | -libnotify_action_cb (NotifyNotification *notification, |
1577 | - gchar *action, |
1578 | - gpointer user_data) |
1579 | -{ |
1580 | - gboolean ret; |
1581 | - GError *error = NULL; |
1582 | - GsdUpdatesManager *manager = GSD_UPDATES_MANAGER (user_data); |
1583 | - |
1584 | - notify_notification_close (notification, NULL); |
1585 | - if (g_strcmp0 (action, "distro-upgrade-info") == 0) { |
1586 | - ret = g_spawn_command_line_async (DATADIR "/PackageKit/pk-upgrade-distro.sh", |
1587 | - &error); |
1588 | - if (!ret) { |
1589 | - g_warning ("Failure launching pk-upgrade-distro.sh: %s", |
1590 | - error->message); |
1591 | - g_error_free (error); |
1592 | - } |
1593 | - goto out; |
1594 | - } |
1595 | - if (g_strcmp0 (action, "show-update-viewer") == 0) { |
1596 | - ret = g_spawn_command_line_async (BINDIR "/gpk-update-viewer", |
1597 | - &error); |
1598 | - if (!ret) { |
1599 | - g_warning ("Failure launching update viewer: %s", |
1600 | - error->message); |
1601 | - g_error_free (error); |
1602 | - } |
1603 | - goto out; |
1604 | - } |
1605 | - if (g_strcmp0 (action, "clear-offline-updates") == 0) { |
1606 | - clear_offline_updates_message (); |
1607 | - goto out; |
1608 | - } |
1609 | - if (g_strcmp0 (action, "error-offline-updates") == 0) { |
1610 | - show_offline_updates_error (manager); |
1611 | - goto out; |
1612 | - } |
1613 | - if (g_strcmp0 (action, "cancel") == 0) { |
1614 | - /* try to cancel */ |
1615 | - g_cancellable_cancel (manager->priv->cancellable); |
1616 | - goto out; |
1617 | - } |
1618 | - g_warning ("unknown action id: %s", action); |
1619 | -out: |
1620 | - return; |
1621 | -} |
1622 | - |
1623 | -static void |
1624 | -on_notification_closed (NotifyNotification *notification, gpointer data) |
1625 | -{ |
1626 | - g_object_unref (notification); |
1627 | -} |
1628 | - |
1629 | -static void |
1630 | -get_distro_upgrades_finished_cb (GObject *object, |
1631 | - GAsyncResult *res, |
1632 | - GsdUpdatesManager *manager) |
1633 | -{ |
1634 | - const gchar *title; |
1635 | - gboolean ret; |
1636 | - gchar *name = NULL; |
1637 | - GError *error = NULL; |
1638 | - GPtrArray *array = NULL; |
1639 | - GString *string = NULL; |
1640 | - guint i; |
1641 | - NotifyNotification *notification; |
1642 | - PkClient *client = PK_CLIENT(object); |
1643 | - PkDistroUpgrade *item; |
1644 | - PkError *error_code = NULL; |
1645 | - PkResults *results; |
1646 | - PkUpdateStateEnum state; |
1647 | - |
1648 | - /* get the results */ |
1649 | - results = pk_client_generic_finish (PK_CLIENT(client), res, &error); |
1650 | - if (results == NULL) { |
1651 | - if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { |
1652 | - g_error_free (error); |
1653 | - return; |
1654 | - } |
1655 | - if (error->domain != PK_CLIENT_ERROR || |
1656 | - error->code != PK_CLIENT_ERROR_NOT_SUPPORTED) { |
1657 | - g_warning ("failed to get upgrades: %s", |
1658 | - error->message); |
1659 | - } |
1660 | - g_error_free (error); |
1661 | - goto out; |
1662 | - } |
1663 | - |
1664 | - /* check error code */ |
1665 | - error_code = pk_results_get_error_code (results); |
1666 | - if (error_code != NULL) { |
1667 | - g_warning ("failed to get upgrades: %s, %s", |
1668 | - pk_error_enum_to_string (pk_error_get_code (error_code)), |
1669 | - pk_error_get_details (error_code)); |
1670 | - goto out; |
1671 | - } |
1672 | - |
1673 | - /* process results */ |
1674 | - array = pk_results_get_distro_upgrade_array (results); |
1675 | - |
1676 | - /* any updates? */ |
1677 | - if (array->len == 0) { |
1678 | - g_debug ("no upgrades"); |
1679 | - goto out; |
1680 | - } |
1681 | - |
1682 | - /* do we do the notification? */ |
1683 | - ret = g_settings_get_boolean (manager->priv->settings_gsd, |
1684 | - GSD_SETTINGS_NOTIFY_DISTRO_UPGRADES); |
1685 | - if (!ret) { |
1686 | - g_debug ("ignoring due to GSettings"); |
1687 | - goto out; |
1688 | - } |
1689 | - |
1690 | - /* find the upgrade string */ |
1691 | - string = g_string_new (""); |
1692 | - for (i=0; i < array->len; i++) { |
1693 | - item = (PkDistroUpgrade *) g_ptr_array_index (array, i); |
1694 | - g_object_get (item, |
1695 | - "name", &name, |
1696 | - "state", &state, |
1697 | - NULL); |
1698 | - g_string_append_printf (string, "%s (%s)\n", |
1699 | - name, |
1700 | - pk_distro_upgrade_enum_to_string (state)); |
1701 | - g_free (name); |
1702 | - } |
1703 | - if (string->len != 0) |
1704 | - g_string_set_size (string, string->len-1); |
1705 | - |
1706 | - /* TRANSLATORS: a distro update is available, e.g. Fedora 8 to Fedora 9 */ |
1707 | - title = _("Distribution upgrades available"); |
1708 | - notification = notify_notification_new (title, |
1709 | - string->str, |
1710 | - GSD_UPDATES_ICON_NORMAL); |
1711 | - notify_notification_set_hint_string (notification, "desktop-entry", "gpk-update-viewer"); |
1712 | - notify_notification_set_app_name (notification, _("Software Updates")); |
1713 | - notify_notification_set_timeout (notification, NOTIFY_EXPIRES_NEVER); |
1714 | - notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL); |
1715 | - notify_notification_add_action (notification, "distro-upgrade-info", |
1716 | - /* TRANSLATORS: provides more information about the upgrade */ |
1717 | - _("More information"), |
1718 | - libnotify_action_cb, |
1719 | - manager, NULL); |
1720 | - g_signal_connect (notification, "closed", |
1721 | - G_CALLBACK (on_notification_closed), NULL); |
1722 | - ret = notify_notification_show (notification, &error); |
1723 | - if (!ret) { |
1724 | - g_warning ("error: %s", error->message); |
1725 | - g_error_free (error); |
1726 | - } |
1727 | -out: |
1728 | - if (error_code != NULL) |
1729 | - g_object_unref (error_code); |
1730 | - if (array != NULL) |
1731 | - g_ptr_array_unref (array); |
1732 | - if (string != NULL) |
1733 | - g_string_free (string, TRUE); |
1734 | - if (results != NULL) |
1735 | - g_object_unref (results); |
1736 | -} |
1737 | - |
1738 | -static void |
1739 | -due_get_upgrades_cb (GsdUpdatesRefresh *refresh, GsdUpdatesManager *manager) |
1740 | -{ |
1741 | - /* optimize the amount of downloaded data by setting the cache age */ |
1742 | - pk_client_set_cache_age (PK_CLIENT(manager->priv->task), |
1743 | - g_settings_get_int (manager->priv->settings_gsd, |
1744 | - GSD_SETTINGS_FREQUENCY_GET_UPGRADES)); |
1745 | - |
1746 | - /* get new distro upgrades list */ |
1747 | - pk_client_get_distro_upgrades_async (PK_CLIENT(manager->priv->task), |
1748 | - NULL, |
1749 | - NULL, NULL, |
1750 | - (GAsyncReadyCallback) get_distro_upgrades_finished_cb, |
1751 | - manager); |
1752 | -} |
1753 | - |
1754 | -static void |
1755 | -refresh_cache_finished_cb (GObject *object, GAsyncResult *res, GsdUpdatesManager *manager) |
1756 | -{ |
1757 | - PkClient *client = PK_CLIENT(object); |
1758 | - PkResults *results; |
1759 | - GError *error = NULL; |
1760 | - PkError *error_code = NULL; |
1761 | - |
1762 | - /* get the results */ |
1763 | - results = pk_client_generic_finish (PK_CLIENT(client), res, &error); |
1764 | - if (results == NULL) { |
1765 | - if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { |
1766 | - g_error_free (error); |
1767 | - return; |
1768 | - } |
1769 | - g_warning ("failed to refresh the cache: %s", |
1770 | - error->message); |
1771 | - g_error_free (error); |
1772 | - return; |
1773 | - } |
1774 | - |
1775 | - /* check error code */ |
1776 | - error_code = pk_results_get_error_code (results); |
1777 | - if (error_code != NULL) { |
1778 | - g_warning ("failed to refresh the cache: %s, %s", |
1779 | - pk_error_enum_to_string (pk_error_get_code (error_code)), |
1780 | - pk_error_get_details (error_code)); |
1781 | - } |
1782 | - |
1783 | - if (error_code != NULL) |
1784 | - g_object_unref (error_code); |
1785 | - if (results != NULL) |
1786 | - g_object_unref (results); |
1787 | -} |
1788 | - |
1789 | -static void |
1790 | -due_refresh_cache_cb (GsdUpdatesRefresh *refresh, GsdUpdatesManager *manager) |
1791 | -{ |
1792 | - /* optimize the amount of downloaded data by setting the cache age */ |
1793 | - pk_client_set_cache_age (PK_CLIENT(manager->priv->task), |
1794 | - g_settings_get_int (manager->priv->settings_gsd, |
1795 | - GSD_SETTINGS_FREQUENCY_REFRESH_CACHE)); |
1796 | - |
1797 | - pk_client_refresh_cache_async (PK_CLIENT(manager->priv->task), |
1798 | - TRUE, |
1799 | - NULL, |
1800 | - NULL, NULL, |
1801 | - (GAsyncReadyCallback) refresh_cache_finished_cb, |
1802 | - manager); |
1803 | -} |
1804 | - |
1805 | -static void |
1806 | -notify_critical_updates (GsdUpdatesManager *manager, GPtrArray *array) |
1807 | -{ |
1808 | - const gchar *message; |
1809 | - const gchar *title; |
1810 | - gboolean ret; |
1811 | - GError *error = NULL; |
1812 | - NotifyNotification *notification; |
1813 | - |
1814 | - /* if the number of critical updates is the same as the last notification, |
1815 | - * then skip the notifcation as we don't want to bombard the user every hour */ |
1816 | - if (array->len == manager->priv->number_updates_critical_last_shown) { |
1817 | - g_debug ("ignoring as user ignored last warning"); |
1818 | - return; |
1819 | - } |
1820 | - |
1821 | - /* save for comparison later */ |
1822 | - manager->priv->number_updates_critical_last_shown = array->len; |
1823 | - |
1824 | - /* TRANSLATORS: title in the libnotify popup */ |
1825 | - title = ngettext ("Update", "Updates", array->len); |
1826 | - |
1827 | - /* TRANSLATORS: message when there are security updates */ |
1828 | - message = ngettext ("An important software update is available", |
1829 | - "Important software updates are available", array->len); |
1830 | - |
1831 | - /* close any existing notification */ |
1832 | - if (manager->priv->notification_updates != NULL) { |
1833 | - notify_notification_close (manager->priv->notification_updates, NULL); |
1834 | - manager->priv->notification_updates = NULL; |
1835 | - } |
1836 | - |
1837 | - /* do the bubble */ |
1838 | - g_debug ("title=%s, message=%s", title, message); |
1839 | - notification = notify_notification_new (title, |
1840 | - message, |
1841 | - GSD_UPDATES_ICON_URGENT); |
1842 | - notify_notification_set_hint_string (notification, "desktop-entry", "gpk-update-viewer"); |
1843 | - notify_notification_set_app_name (notification, _("Software Updates")); |
1844 | - notify_notification_set_timeout (notification, 15000); |
1845 | - notify_notification_set_urgency (notification, NOTIFY_URGENCY_CRITICAL); |
1846 | - notify_notification_add_action (notification, "show-update-viewer", |
1847 | - /* TRANSLATORS: button: open the update viewer to install updates*/ |
1848 | - _("Install updates"), libnotify_action_cb, manager, NULL); |
1849 | - g_signal_connect (notification, "closed", |
1850 | - G_CALLBACK (on_notification_closed), NULL); |
1851 | - ret = notify_notification_show (notification, &error); |
1852 | - if (!ret) { |
1853 | - g_warning ("error: %s", error->message); |
1854 | - g_error_free (error); |
1855 | - } |
1856 | - /* track so we can prevent doubled notifications */ |
1857 | - manager->priv->notification_updates = notification; |
1858 | - g_object_add_weak_pointer (G_OBJECT (manager->priv->notification_updates), |
1859 | - (void **) &manager->priv->notification_updates); |
1860 | -} |
1861 | - |
1862 | -static void |
1863 | -notify_normal_updates_maybe (GsdUpdatesManager *manager, GPtrArray *array) |
1864 | -{ |
1865 | - const gchar *message; |
1866 | - const gchar *title; |
1867 | - gboolean ret; |
1868 | - GError *error = NULL; |
1869 | - guint64 time_last_notify; |
1870 | - guint64 time_now; |
1871 | - guint freq_updates_notify; |
1872 | - NotifyNotification *notification; |
1873 | - |
1874 | - /* find out if enough time has passed since the last notification */ |
1875 | - time_now = g_get_real_time () / 1000000; |
1876 | - freq_updates_notify = g_settings_get_int (manager->priv->settings_gsd, |
1877 | - GSD_SETTINGS_FREQUENCY_UPDATES_NOTIFICATION); |
1878 | - g_settings_get (manager->priv->settings_gsd, |
1879 | - GSD_SETTINGS_LAST_UPDATES_NOTIFICATION, |
1880 | - "t", &time_last_notify); |
1881 | - if (time_last_notify > 0 && |
1882 | - (guint64) freq_updates_notify > time_now - time_last_notify) { |
1883 | - g_debug ("not showing non-critical notification as already shown %i hours ago", |
1884 | - (guint) (time_now - time_last_notify) / (60 * 60)); |
1885 | - return; |
1886 | - } |
1887 | - |
1888 | - /* TRANSLATORS: title in the libnotify popup */ |
1889 | - title = ngettext ("Update", "Updates", array->len); |
1890 | - |
1891 | - /* TRANSLATORS: message when there are non-security updates */ |
1892 | - message = ngettext ("A software update is available.", |
1893 | - "Software updates are available.", array->len); |
1894 | - |
1895 | - /* close any existing notification */ |
1896 | - if (manager->priv->notification_updates != NULL) { |
1897 | - notify_notification_close (manager->priv->notification_updates, NULL); |
1898 | - manager->priv->notification_updates = NULL; |
1899 | - } |
1900 | - |
1901 | - /* do the bubble */ |
1902 | - g_debug ("title=%s, message=%s", title, message); |
1903 | - notification = notify_notification_new (title, |
1904 | - message, |
1905 | - GSD_UPDATES_ICON_NORMAL); |
1906 | - notify_notification_set_hint_string (notification, "desktop-entry", "gpk-update-viewer"); |
1907 | - notify_notification_set_app_name (notification, _("Software Updates")); |
1908 | - notify_notification_set_timeout (notification, 15000); |
1909 | - notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL); |
1910 | - notify_notification_add_action (notification, "show-update-viewer", |
1911 | - /* TRANSLATORS: button: open the update viewer to install updates*/ |
1912 | - _("Install updates"), libnotify_action_cb, manager, NULL); |
1913 | - g_signal_connect (notification, "closed", |
1914 | - G_CALLBACK (on_notification_closed), NULL); |
1915 | - ret = notify_notification_show (notification, &error); |
1916 | - if (!ret) { |
1917 | - g_warning ("error: %s", error->message); |
1918 | - g_error_free (error); |
1919 | - } |
1920 | - |
1921 | - /* reset notification time */ |
1922 | - g_settings_set (manager->priv->settings_gsd, |
1923 | - GSD_SETTINGS_LAST_UPDATES_NOTIFICATION, |
1924 | - "t", time_now); |
1925 | - |
1926 | - /* track so we can prevent doubled notifications */ |
1927 | - manager->priv->notification_updates = notification; |
1928 | - g_object_add_weak_pointer (G_OBJECT (manager->priv->notification_updates), |
1929 | - (void **) &manager->priv->notification_updates); |
1930 | -} |
1931 | - |
1932 | -static void |
1933 | -notify_failed_get_updates_maybe (GsdUpdatesManager *manager) |
1934 | -{ |
1935 | - const gchar *button; |
1936 | - const gchar *message; |
1937 | - const gchar *title; |
1938 | - gboolean ret; |
1939 | - GError *error = NULL; |
1940 | - NotifyNotification *notification; |
1941 | - |
1942 | - /* give the user a break */ |
1943 | - if (manager->priv->failed_get_updates_count++ < MAX_FAILED_GET_UPDATES) { |
1944 | - g_debug ("failed GetUpdates, but will retry %i more times before notification", |
1945 | - MAX_FAILED_GET_UPDATES - manager->priv->failed_get_updates_count); |
1946 | - goto out; |
1947 | - } |
1948 | - |
1949 | - /* TRANSLATORS: the updates mechanism */ |
1950 | - title = _("Updates"); |
1951 | - |
1952 | - /* TRANSLATORS: we failed to get the updates multiple times, |
1953 | - * and now we need to inform the user that something might be wrong */ |
1954 | - message = _("Unable to access software updates"); |
1955 | - |
1956 | - /* TRANSLATORS: try again, this time launching the update viewer */ |
1957 | - button = _("Try again"); |
1958 | - |
1959 | - notification = notify_notification_new (title, |
1960 | - message, |
1961 | - GSD_UPDATES_ICON_NORMAL); |
1962 | - notify_notification_set_hint_string (notification, "desktop-entry", "gpk-update-viewer"); |
1963 | - notify_notification_set_app_name (notification, _("Software Updates")); |
1964 | - notify_notification_set_timeout (notification, 120*1000); |
1965 | - notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL); |
1966 | - notify_notification_add_action (notification, "show-update-viewer", |
1967 | - button, |
1968 | - libnotify_action_cb, |
1969 | - manager, NULL); |
1970 | - g_signal_connect (notification, "closed", |
1971 | - G_CALLBACK (on_notification_closed), NULL); |
1972 | - ret = notify_notification_show (notification, &error); |
1973 | - if (!ret) { |
1974 | - g_warning ("failed to show notification: %s", |
1975 | - error->message); |
1976 | - g_error_free (error); |
1977 | - } |
1978 | -out: |
1979 | - /* reset, even if the message failed */ |
1980 | - manager->priv->failed_get_updates_count = 0; |
1981 | -} |
1982 | - |
1983 | -static void |
1984 | -check_updates_for_importance (GsdUpdatesManager *manager) |
1985 | -{ |
1986 | - guint i; |
1987 | - PkPackage *pkg; |
1988 | - GPtrArray *important_array; |
1989 | - |
1990 | - /* check each package */ |
1991 | - important_array = g_ptr_array_new (); |
1992 | - for (i = 0; i < manager->priv->update_packages->len; i++) { |
1993 | - pkg = g_ptr_array_index (manager->priv->update_packages, i); |
1994 | - if (pk_package_get_info (pkg) == PK_INFO_ENUM_SECURITY || |
1995 | - pk_package_get_info (pkg) == PK_INFO_ENUM_IMPORTANT) |
1996 | - g_ptr_array_add (important_array, pkg); |
1997 | - } |
1998 | - if (important_array->len > 0) { |
1999 | - notify_critical_updates (manager, |
2000 | - important_array); |
2001 | - } else { |
2002 | - notify_normal_updates_maybe (manager, |
2003 | - manager->priv->update_packages); |
2004 | - } |
2005 | - g_ptr_array_unref (important_array); |
2006 | -} |
2007 | - |
2008 | -static void |
2009 | -package_download_finished_cb (GObject *object, |
2010 | - GAsyncResult *res, |
2011 | - GsdUpdatesManager *manager) |
2012 | -{ |
2013 | - PkClient *client = PK_CLIENT(object); |
2014 | - PkResults *results; |
2015 | - GError *error = NULL; |
2016 | - PkError *error_code = NULL; |
2017 | - |
2018 | - /* get the results */ |
2019 | - results = pk_client_generic_finish (PK_CLIENT(client), res, &error); |
2020 | - if (results == NULL) { |
2021 | - if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { |
2022 | - g_error_free (error); |
2023 | - return; |
2024 | - } |
2025 | - g_warning ("failed to download: %s", |
2026 | - error->message); |
2027 | - g_error_free (error); |
2028 | - notify_failed_get_updates_maybe (manager); |
2029 | - return; |
2030 | - } |
2031 | - |
2032 | - /* check error code */ |
2033 | - error_code = pk_results_get_error_code (results); |
2034 | - if (error_code != NULL) { |
2035 | - g_warning ("failed to download: %s, %s", |
2036 | - pk_error_enum_to_string (pk_error_get_code (error_code)), |
2037 | - pk_error_get_details (error_code)); |
2038 | - switch (pk_error_get_code (error_code)) { |
2039 | - case PK_ERROR_ENUM_CANCELLED_PRIORITY: |
2040 | - case PK_ERROR_ENUM_TRANSACTION_CANCELLED: |
2041 | - g_debug ("ignoring error"); |
2042 | - break; |
2043 | - default: |
2044 | - notify_failed_get_updates_maybe (manager); |
2045 | - break; |
2046 | - } |
2047 | - goto out; |
2048 | - } |
2049 | - |
2050 | - /* check to see if should notify */ |
2051 | - check_updates_for_importance (manager); |
2052 | - |
2053 | -out: |
2054 | - if (error_code != NULL) |
2055 | - g_object_unref (error_code); |
2056 | - if (results != NULL) |
2057 | - g_object_unref (results); |
2058 | -} |
2059 | - |
2060 | -static void |
2061 | -auto_download_updates (GsdUpdatesManager *manager) |
2062 | -{ |
2063 | - gchar **package_ids; |
2064 | - guint i; |
2065 | - PkPackage *pkg; |
2066 | - |
2067 | - /* download each package */ |
2068 | - package_ids = g_new0 (gchar *, manager->priv->update_packages->len + 1); |
2069 | - for (i = 0; i < manager->priv->update_packages->len; i++) { |
2070 | - pkg = g_ptr_array_index (manager->priv->update_packages, i); |
2071 | - package_ids[i] = g_strdup (pk_package_get_id (pkg)); |
2072 | - } |
2073 | - |
2074 | -#if PK_CHECK_VERSION(0,8,1) |
2075 | - /* we've set only-download in PkTask */ |
2076 | - pk_task_update_packages_async (manager->priv->task, |
2077 | - package_ids, |
2078 | - manager->priv->cancellable, |
2079 | - NULL, NULL, |
2080 | - (GAsyncReadyCallback) package_download_finished_cb, |
2081 | - manager); |
2082 | -#else |
2083 | - /* download them all */ |
2084 | - pk_client_download_packages_async (PK_CLIENT(manager->priv->task), |
2085 | - package_ids, |
2086 | - NULL, /* this means system cache */ |
2087 | - manager->priv->cancellable, |
2088 | - NULL, NULL, |
2089 | - (GAsyncReadyCallback) package_download_finished_cb, |
2090 | - manager); |
2091 | -#endif |
2092 | - g_strfreev (package_ids); |
2093 | -} |
2094 | - |
2095 | -static void |
2096 | -get_updates_finished_cb (GObject *object, |
2097 | - GAsyncResult *res, |
2098 | - GsdUpdatesManager *manager) |
2099 | -{ |
2100 | - PkClient *client = PK_CLIENT(object); |
2101 | - PkResults *results; |
2102 | - GError *error = NULL; |
2103 | - gboolean ret; |
2104 | - PkError *error_code = NULL; |
2105 | - |
2106 | - /* get the results */ |
2107 | - results = pk_client_generic_finish (PK_CLIENT(client), res, &error); |
2108 | - if (results == NULL) { |
2109 | - if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { |
2110 | - g_error_free (error); |
2111 | - return; |
2112 | - } |
2113 | - g_warning ("failed to get updates: %s", |
2114 | - error->message); |
2115 | - g_error_free (error); |
2116 | - notify_failed_get_updates_maybe (manager); |
2117 | - goto out; |
2118 | - } |
2119 | - |
2120 | - /* check error code */ |
2121 | - error_code = pk_results_get_error_code (results); |
2122 | - if (error_code != NULL) { |
2123 | - g_warning ("failed to get updates: %s, %s", |
2124 | - pk_error_enum_to_string (pk_error_get_code (error_code)), |
2125 | - pk_error_get_details (error_code)); |
2126 | - switch (pk_error_get_code (error_code)) { |
2127 | - case PK_ERROR_ENUM_CANCELLED_PRIORITY: |
2128 | - case PK_ERROR_ENUM_TRANSACTION_CANCELLED: |
2129 | - g_debug ("ignoring error"); |
2130 | - break; |
2131 | - default: |
2132 | - notify_failed_get_updates_maybe (manager); |
2133 | - break; |
2134 | - } |
2135 | - goto out; |
2136 | - } |
2137 | - |
2138 | - /* we succeeded, so clear the count */ |
2139 | - manager->priv->failed_get_updates_count = 0; |
2140 | - |
2141 | - /* so we can download or check for important & security updates */ |
2142 | - if (manager->priv->update_packages != NULL) |
2143 | - g_ptr_array_unref (manager->priv->update_packages); |
2144 | - manager->priv->update_packages = pk_results_get_package_array (results); |
2145 | - |
2146 | - /* we have no updates */ |
2147 | - if (manager->priv->update_packages->len == 0) { |
2148 | - g_debug ("no updates"); |
2149 | - goto out; |
2150 | - } |
2151 | - |
2152 | - /* should we auto-download the updates? */ |
2153 | - ret = g_settings_get_boolean (manager->priv->settings_gsd, |
2154 | - GSD_SETTINGS_AUTO_DOWNLOAD_UPDATES); |
2155 | - if (ret) { |
2156 | - auto_download_updates (manager); |
2157 | - goto out; |
2158 | - } |
2159 | - |
2160 | - /* just check to see if should notify */ |
2161 | - check_updates_for_importance (manager); |
2162 | -out: |
2163 | - if (error_code != NULL) |
2164 | - g_object_unref (error_code); |
2165 | - if (results != NULL) |
2166 | - g_object_unref (results); |
2167 | -} |
2168 | - |
2169 | -static void |
2170 | -query_updates (GsdUpdatesManager *manager) |
2171 | -{ |
2172 | - /* optimize the amount of downloaded data by setting the cache age */ |
2173 | - pk_client_set_cache_age (PK_CLIENT(manager->priv->task), |
2174 | - g_settings_get_int (manager->priv->settings_gsd, |
2175 | - GSD_SETTINGS_FREQUENCY_GET_UPDATES)); |
2176 | - |
2177 | - /* get new update list */ |
2178 | - pk_client_get_updates_async (PK_CLIENT(manager->priv->task), |
2179 | - pk_bitfield_value (PK_FILTER_ENUM_NONE), |
2180 | - manager->priv->cancellable, |
2181 | - NULL, NULL, |
2182 | - (GAsyncReadyCallback) get_updates_finished_cb, |
2183 | - manager); |
2184 | -} |
2185 | - |
2186 | -static void |
2187 | -due_get_updates_cb (GsdUpdatesRefresh *refresh, GsdUpdatesManager *manager) |
2188 | -{ |
2189 | - query_updates (manager); |
2190 | -} |
2191 | - |
2192 | -static gchar * |
2193 | -get_proxy_http (GsdUpdatesManager *manager) |
2194 | -{ |
2195 | - gboolean ret; |
2196 | - gchar *host = NULL; |
2197 | - gchar *password = NULL; |
2198 | - gchar *proxy = NULL; |
2199 | - gchar *username = NULL; |
2200 | - GString *string = NULL; |
2201 | - guint port; |
2202 | - GDesktopProxyMode proxy_mode; |
2203 | - |
2204 | - proxy_mode = g_settings_get_enum (manager->priv->settings_proxy, "mode"); |
2205 | - if (proxy_mode != G_DESKTOP_PROXY_MODE_MANUAL) |
2206 | - goto out; |
2207 | - |
2208 | - host = g_settings_get_string (manager->priv->settings_http, |
2209 | - "host"); |
2210 | - if (host == NULL) |
2211 | - goto out; |
2212 | - port = g_settings_get_int (manager->priv->settings_http, |
2213 | - "port"); |
2214 | - |
2215 | - /* use an HTTP auth string? */ |
2216 | - ret = g_settings_get_boolean (manager->priv->settings_http, |
2217 | - "use-authentication"); |
2218 | - if (ret) { |
2219 | - username = g_settings_get_string (manager->priv->settings_http, |
2220 | - "authentication-user"); |
2221 | - password = g_settings_get_string (manager->priv->settings_http, |
2222 | - "authentication-password"); |
2223 | - } |
2224 | - |
2225 | - /* make PackageKit proxy string */ |
2226 | - string = g_string_new (host); |
2227 | - if (port > 0) |
2228 | - g_string_append_printf (string, ":%i", port); |
2229 | - if (username != NULL && password != NULL) |
2230 | - g_string_append_printf (string, "@%s:%s", username, password); |
2231 | - else if (username != NULL) |
2232 | - g_string_append_printf (string, "@%s", username); |
2233 | - else if (password != NULL) |
2234 | - g_string_append_printf (string, "@:%s", password); |
2235 | - proxy = g_string_free (string, FALSE); |
2236 | -out: |
2237 | - g_free (host); |
2238 | - g_free (username); |
2239 | - g_free (password); |
2240 | - return proxy; |
2241 | -} |
2242 | - |
2243 | -static gchar * |
2244 | -get_proxy_ftp (GsdUpdatesManager *manager) |
2245 | -{ |
2246 | - gchar *host = NULL; |
2247 | - gchar *proxy = NULL; |
2248 | - GString *string = NULL; |
2249 | - guint port; |
2250 | - GDesktopProxyMode proxy_mode; |
2251 | - |
2252 | - proxy_mode = g_settings_get_enum (manager->priv->settings_proxy, "mode"); |
2253 | - if (proxy_mode != G_DESKTOP_PROXY_MODE_MANUAL) |
2254 | - goto out; |
2255 | - |
2256 | - host = g_settings_get_string (manager->priv->settings_ftp, |
2257 | - "host"); |
2258 | - if (host == NULL) |
2259 | - goto out; |
2260 | - port = g_settings_get_int (manager->priv->settings_ftp, |
2261 | - "port"); |
2262 | - if (port == 0) |
2263 | - goto out; |
2264 | - |
2265 | - /* make PackageKit proxy string */ |
2266 | - string = g_string_new (host); |
2267 | - if (port > 0) |
2268 | - g_string_append_printf (string, ":%i", port); |
2269 | - proxy = g_string_free (string, FALSE); |
2270 | -out: |
2271 | - g_free (host); |
2272 | - return proxy; |
2273 | -} |
2274 | - |
2275 | - |
2276 | -static void |
2277 | -set_proxy_cb (GObject *object, GAsyncResult *res, gpointer user_data) |
2278 | -{ |
2279 | - gboolean ret; |
2280 | - GError *error = NULL; |
2281 | - PkControl *control = PK_CONTROL (object); |
2282 | - |
2283 | - /* get the result */ |
2284 | - ret = pk_control_set_proxy_finish (control, res, &error); |
2285 | - if (!ret) { |
2286 | - if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) |
2287 | - g_warning ("failed to set proxies: %s", error->message); |
2288 | - g_error_free (error); |
2289 | - } |
2290 | -} |
2291 | - |
2292 | -static void |
2293 | -reload_proxy_settings (GsdUpdatesManager *manager) |
2294 | -{ |
2295 | - gchar *proxy_http; |
2296 | - gchar *proxy_ftp; |
2297 | - |
2298 | - proxy_http = get_proxy_http (manager); |
2299 | - proxy_ftp = get_proxy_ftp (manager); |
2300 | - |
2301 | - /* send to daemon */ |
2302 | - pk_control_set_proxy_async (manager->priv->control, |
2303 | - proxy_http, |
2304 | - proxy_ftp, |
2305 | - NULL, |
2306 | - set_proxy_cb, |
2307 | - manager); |
2308 | - |
2309 | - g_free (proxy_http); |
2310 | - g_free (proxy_ftp); |
2311 | -} |
2312 | - |
2313 | -static void |
2314 | -settings_changed_cb (GSettings *settings, |
2315 | - const char *key, |
2316 | - GsdUpdatesManager *manager) |
2317 | -{ |
2318 | - reload_proxy_settings (manager); |
2319 | -} |
2320 | - |
2321 | -static void |
2322 | -settings_gsd_changed_cb (GSettings *settings, |
2323 | - const char *key, |
2324 | - GsdUpdatesManager *manager) |
2325 | -{ |
2326 | -} |
2327 | - |
2328 | -static void |
2329 | -session_inhibit (GsdUpdatesManager *manager) |
2330 | -{ |
2331 | - const gchar *reason; |
2332 | - GError *error = NULL; |
2333 | - GVariant *retval = NULL; |
2334 | - |
2335 | - /* state invalid somehow */ |
2336 | - if (manager->priv->inhibit_cookie != 0) { |
2337 | - g_warning ("already locked"); |
2338 | - goto out; |
2339 | - } |
2340 | - |
2341 | - /* TRANSLATORS: the reason why we've inhibited it */ |
2342 | - reason = _("A transaction that cannot be interrupted is running"); |
2343 | - retval = g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->proxy_session), |
2344 | - "Inhibit", |
2345 | - g_variant_new ("(susu)", |
2346 | - "gnome-settings-daemon", /* app-id */ |
2347 | - 0, /* xid */ |
2348 | - reason, /* reason */ |
2349 | - 4 /* flags */), |
2350 | - G_DBUS_CALL_FLAGS_NONE, |
2351 | - -1, |
2352 | - manager->priv->cancellable, |
2353 | - &error); |
2354 | - if (retval == NULL) { |
2355 | - g_warning ("failed to inhibit gnome-session: %s", |
2356 | - error->message); |
2357 | - g_error_free (error); |
2358 | - goto out; |
2359 | - } |
2360 | - |
2361 | - /* get cookie */ |
2362 | - g_variant_get (retval, "(u)", |
2363 | - &manager->priv->inhibit_cookie); |
2364 | -out: |
2365 | - if (retval != NULL) |
2366 | - g_variant_unref (retval); |
2367 | -} |
2368 | - |
2369 | -static void |
2370 | -session_uninhibit (GsdUpdatesManager *manager) |
2371 | -{ |
2372 | - GError *error = NULL; |
2373 | - GVariant *retval = NULL; |
2374 | - |
2375 | - /* state invalid somehow */ |
2376 | - if (manager->priv->inhibit_cookie == 0) { |
2377 | - g_warning ("not locked"); |
2378 | - goto out; |
2379 | - } |
2380 | - retval = g_dbus_proxy_call_sync (G_DBUS_PROXY (manager->priv->proxy_session), |
2381 | - "Uninhibit", |
2382 | - g_variant_new ("(u)", |
2383 | - manager->priv->inhibit_cookie), |
2384 | - G_DBUS_CALL_FLAGS_NONE, |
2385 | - -1, |
2386 | - manager->priv->cancellable, |
2387 | - &error); |
2388 | - if (retval == NULL) { |
2389 | - g_warning ("failed to uninhibit gnome-session: %s", |
2390 | - error->message); |
2391 | - g_error_free (error); |
2392 | - goto out; |
2393 | - } |
2394 | -out: |
2395 | - manager->priv->inhibit_cookie = 0; |
2396 | - if (retval != NULL) |
2397 | - g_variant_unref (retval); |
2398 | -} |
2399 | - |
2400 | -static void |
2401 | -notify_locked_cb (PkControl *control, |
2402 | - GParamSpec *pspec, |
2403 | - GsdUpdatesManager *manager) |
2404 | -{ |
2405 | - gboolean locked; |
2406 | - |
2407 | - g_object_get (control, "locked", &locked, NULL); |
2408 | - |
2409 | - /* TODO: locked is a bit harsh, we can probably still allow |
2410 | - * reboot when packages are downloading or the transaction is |
2411 | - * depsolving */ |
2412 | - if (locked) { |
2413 | - session_inhibit (manager); |
2414 | - } else { |
2415 | - session_uninhibit (manager); |
2416 | - } |
2417 | -} |
2418 | - |
2419 | -static void |
2420 | -update_viewer_appeared_cb (GDBusConnection *connection, |
2421 | - const gchar *name, |
2422 | - const gchar *name_owner, |
2423 | - gpointer user_data) |
2424 | -{ |
2425 | - GsdUpdatesManager *manager = GSD_UPDATES_MANAGER (user_data); |
2426 | - |
2427 | - /* close any existing notification */ |
2428 | - if (manager->priv->notification_updates != NULL) { |
2429 | - g_debug ("update viewer on the bus, clearing bubble"); |
2430 | - notify_notification_close (manager->priv->notification_updates, NULL); |
2431 | - manager->priv->notification_updates = NULL; |
2432 | - } |
2433 | -} |
2434 | - |
2435 | -static gboolean |
2436 | -file_exists_in_root (const gchar *root, const gchar *filename) |
2437 | -{ |
2438 | - gboolean ret = FALSE; |
2439 | - GFile *source; |
2440 | - gchar *source_path; |
2441 | - |
2442 | - source_path = g_build_filename (root, filename, NULL); |
2443 | - source = g_file_new_for_path (source_path); |
2444 | - |
2445 | - /* ignore virtual mountpoints */ |
2446 | - if (!g_file_is_native (source)) |
2447 | - goto out; |
2448 | - |
2449 | - /* an interesting file exists */ |
2450 | - ret = g_file_query_exists (source, NULL); |
2451 | - g_debug ("checking for %s: %s", source_path, ret ? "yes" : "no"); |
2452 | - if (!ret) |
2453 | - goto out; |
2454 | -out: |
2455 | - g_free (source_path); |
2456 | - g_object_unref (source); |
2457 | - return ret; |
2458 | -} |
2459 | - |
2460 | -static void |
2461 | -mount_added_cb (GVolumeMonitor *volume_monitor, |
2462 | - GMount *mount, |
2463 | - GsdUpdatesManager *manager) |
2464 | -{ |
2465 | - gboolean ret = FALSE; |
2466 | - gchar **filenames = NULL; |
2467 | - gchar *media_repo_filenames; |
2468 | - gchar *root_path; |
2469 | - GFile *root; |
2470 | - guint i; |
2471 | - |
2472 | - /* check if any installed media is an install disk */ |
2473 | - root = g_mount_get_root (mount); |
2474 | - root_path = g_file_get_path (root); |
2475 | - |
2476 | - /* use settings */ |
2477 | - media_repo_filenames = g_settings_get_string (manager->priv->settings_gsd, |
2478 | - GSD_SETTINGS_MEDIA_REPO_FILENAMES); |
2479 | - if (media_repo_filenames == NULL) { |
2480 | - g_warning ("failed to get media repo filenames"); |
2481 | - goto out; |
2482 | - } |
2483 | - |
2484 | - /* search each possible filename */ |
2485 | - filenames = g_strsplit (media_repo_filenames, ",", -1); |
2486 | - for (i=0; filenames[i] != NULL; i++) { |
2487 | - ret = file_exists_in_root (root_path, filenames[i]); |
2488 | - if (ret) |
2489 | - break; |
2490 | - } |
2491 | - |
2492 | - /* do an updates check with the new media */ |
2493 | - if (ret) |
2494 | - query_updates (manager); |
2495 | -out: |
2496 | - g_strfreev (filenames); |
2497 | - g_free (media_repo_filenames); |
2498 | - g_free (root_path); |
2499 | - g_object_unref (root); |
2500 | -} |
2501 | - |
2502 | -#define PK_OFFLINE_UPDATE_RESULTS_GROUP "PackageKit Offline Update Results" |
2503 | -#define PK_OFFLINE_UPDATE_RESULTS_FILENAME "/var/lib/PackageKit/offline-update-competed" |
2504 | - |
2505 | -static gboolean |
2506 | -check_offline_update_cb (gpointer user_data) |
2507 | -{ |
2508 | - const gchar *message; |
2509 | - const gchar *title; |
2510 | - gboolean ret; |
2511 | - gboolean success; |
2512 | - gchar *error_code = NULL; |
2513 | - gchar *error_details = NULL; |
2514 | - gchar *packages = NULL; |
2515 | - GError *error = NULL; |
2516 | - GKeyFile *key_file = NULL; |
2517 | - GsdUpdatesManager *manager = (GsdUpdatesManager *) user_data; |
2518 | - guint i; |
2519 | - guint num_packages = 1; |
2520 | - NotifyNotification *notification; |
2521 | - PkErrorEnum error_enum = PK_ERROR_ENUM_UNKNOWN; |
2522 | - |
2523 | - /* was any offline update attempted */ |
2524 | - if (!g_file_test (PK_OFFLINE_UPDATE_RESULTS_FILENAME, G_FILE_TEST_EXISTS)) |
2525 | - goto out; |
2526 | - |
2527 | - /* open the file and see what happened */ |
2528 | - key_file = g_key_file_new (); |
2529 | - ret = g_key_file_load_from_file (key_file, |
2530 | - PK_OFFLINE_UPDATE_RESULTS_FILENAME, |
2531 | - G_KEY_FILE_NONE, |
2532 | - &error); |
2533 | - if (!ret) { |
2534 | - g_warning ("failed to open %s: %s", |
2535 | - PK_OFFLINE_UPDATE_RESULTS_FILENAME, |
2536 | - error->message); |
2537 | - g_error_free (error); |
2538 | - goto out; |
2539 | - } |
2540 | - success = g_key_file_get_boolean (key_file, |
2541 | - PK_OFFLINE_UPDATE_RESULTS_GROUP, |
2542 | - "Success", |
2543 | - NULL); |
2544 | - if (success) { |
2545 | - packages = g_key_file_get_string (key_file, |
2546 | - PK_OFFLINE_UPDATE_RESULTS_GROUP, |
2547 | - "Packages", |
2548 | - NULL); |
2549 | - if (packages == NULL) { |
2550 | - g_warning ("No 'Packages' in %s", |
2551 | - PK_OFFLINE_UPDATE_RESULTS_FILENAME); |
2552 | - goto out; |
2553 | - } |
2554 | - |
2555 | - /* count the packages for translators */ |
2556 | - for (i = 0; packages[i] != '\0'; i++) { |
2557 | - if (packages[i] == ',') |
2558 | - num_packages++; |
2559 | - } |
2560 | - |
2561 | - /* TRANSLATORS: title in the libnotify popup */ |
2562 | - title = ngettext ("Software Update Installed", |
2563 | - "Software Updates Installed", |
2564 | - num_packages); |
2565 | - |
2566 | - /* TRANSLATORS: message when we've done offline updates */ |
2567 | - message = ngettext ("An important OS update has been installed.", |
2568 | - "Important OS updates have been installed.", |
2569 | - num_packages); |
2570 | - |
2571 | - /* no need to keep the file around anymore */ |
2572 | - clear_offline_updates_message (); |
2573 | - } else { |
2574 | - /* get error details */ |
2575 | - manager->priv->offline_update_error = pk_error_new (); |
2576 | - |
2577 | - error_code = g_key_file_get_string (key_file, |
2578 | - PK_OFFLINE_UPDATE_RESULTS_GROUP, |
2579 | - "ErrorCode", |
2580 | - NULL); |
2581 | - if (error_code != NULL) |
2582 | - error_enum = pk_error_enum_from_string (error_code); |
2583 | - error_details = g_key_file_get_string (key_file, |
2584 | - PK_OFFLINE_UPDATE_RESULTS_GROUP, |
2585 | - "ErrorDetails", |
2586 | - NULL); |
2587 | - g_object_set (manager->priv->offline_update_error, |
2588 | - "code", error_enum, |
2589 | - "details", error_details, |
2590 | - NULL); |
2591 | - |
2592 | - /* TRANSLATORS: title in the libnotify popup */ |
2593 | - title = _("Software Updates Failed"); |
2594 | - |
2595 | - /* TRANSLATORS: message when we've not done offline updates */ |
2596 | - message = _("An important OS update failed to be installed."); |
2597 | - } |
2598 | - |
2599 | - /* do the bubble */ |
2600 | - g_debug ("title=%s, message=%s", title, message); |
2601 | - notification = notify_notification_new (title, |
2602 | - message, |
2603 | - GSD_UPDATES_ICON_URGENT); |
2604 | - notify_notification_set_hint_string (notification, "desktop-entry", "gpk-update-viewer"); |
2605 | - notify_notification_set_app_name (notification, _("Software Updates")); |
2606 | - notify_notification_set_timeout (notification, -1); |
2607 | - notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL); |
2608 | - if (success) { |
2609 | -#if 0 |
2610 | - notify_notification_add_action (notification, "review-offline-updates", |
2611 | - /* TRANSLATORS: button: review the offline update changes */ |
2612 | - _("Review"), libnotify_action_cb, manager, NULL); |
2613 | -#endif |
2614 | - } else { |
2615 | - notify_notification_add_action (notification, "error-offline-updates", |
2616 | - /* TRANSLATORS: button: review the offline update changes */ |
2617 | - _("Show details"), libnotify_action_cb, manager, NULL); |
2618 | - } |
2619 | - notify_notification_add_action (notification, "clear-offline-updates", |
2620 | - /* TRANSLATORS: button: clear notification */ |
2621 | - _("OK"), libnotify_action_cb, manager, NULL); |
2622 | - g_signal_connect (notification, "closed", |
2623 | - G_CALLBACK (on_notification_closed), NULL); |
2624 | - ret = notify_notification_show (notification, &error); |
2625 | - if (!ret) { |
2626 | - g_warning ("error: %s", error->message); |
2627 | - g_error_free (error); |
2628 | - } |
2629 | -out: |
2630 | - g_free (packages); |
2631 | - g_free (error_code); |
2632 | - g_free (error_details); |
2633 | - if (key_file != NULL) |
2634 | - g_key_file_free (key_file); |
2635 | - manager->priv->offline_update_id = 0; |
2636 | - return FALSE; |
2637 | -} |
2638 | - |
2639 | -gboolean |
2640 | -gsd_updates_manager_start (GsdUpdatesManager *manager, |
2641 | - GError **error) |
2642 | -{ |
2643 | - gboolean ret = FALSE; |
2644 | - |
2645 | - g_debug ("Starting updates manager"); |
2646 | - |
2647 | - /* use PackageKit */ |
2648 | - manager->priv->cancellable = g_cancellable_new (); |
2649 | - manager->priv->control = pk_control_new (); |
2650 | - g_signal_connect (manager->priv->control, "notify::locked", |
2651 | - G_CALLBACK (notify_locked_cb), manager); |
2652 | - manager->priv->task = pk_task_new (); |
2653 | - g_object_set (manager->priv->task, |
2654 | - "background", TRUE, |
2655 | - "interactive", FALSE, |
2656 | -#if PK_CHECK_VERSION(0,8,1) |
2657 | - "only-download", TRUE, |
2658 | -#endif |
2659 | - NULL); |
2660 | - |
2661 | - /* watch UDev for missing firmware */ |
2662 | - manager->priv->firmware = gsd_updates_firmware_new (); |
2663 | - |
2664 | - /* get automatic callbacks about when we should check for |
2665 | - * updates, refresh-caches and upgrades */ |
2666 | - manager->priv->refresh = gsd_updates_refresh_new (); |
2667 | - g_signal_connect (manager->priv->refresh, "get-upgrades", |
2668 | - G_CALLBACK (due_get_upgrades_cb), manager); |
2669 | - g_signal_connect (manager->priv->refresh, "refresh-cache", |
2670 | - G_CALLBACK (due_refresh_cache_cb), manager); |
2671 | - g_signal_connect (manager->priv->refresh, "get-updates", |
2672 | - G_CALLBACK (due_get_updates_cb), manager); |
2673 | - |
2674 | - /* get proxy settings */ |
2675 | - manager->priv->settings_proxy = g_settings_new ("org.gnome.system.proxy"); |
2676 | - g_signal_connect (manager->priv->settings_proxy, "changed", |
2677 | - G_CALLBACK (settings_changed_cb), manager); |
2678 | - |
2679 | - /* get http settings */ |
2680 | - manager->priv->settings_http = g_settings_new ("org.gnome.system.proxy.http"); |
2681 | - g_signal_connect (manager->priv->settings_http, "changed", |
2682 | - G_CALLBACK (settings_changed_cb), manager); |
2683 | - |
2684 | - /* get ftp settings */ |
2685 | - manager->priv->settings_ftp = g_settings_new ("org.gnome.system.proxy.ftp"); |
2686 | - g_signal_connect (manager->priv->settings_ftp, "changed", |
2687 | - G_CALLBACK (settings_changed_cb), manager); |
2688 | - |
2689 | - /* get ftp settings */ |
2690 | - manager->priv->settings_gsd = g_settings_new ("org.gnome.settings-daemon.plugins.updates"); |
2691 | - g_signal_connect (manager->priv->settings_gsd, "changed", |
2692 | - G_CALLBACK (settings_gsd_changed_cb), manager); |
2693 | - |
2694 | - /* use gnome-session for the idle detection */ |
2695 | - manager->priv->proxy_session = |
2696 | - gnome_settings_bus_get_session_proxy (); |
2697 | - if (manager->priv->proxy_session == NULL) |
2698 | - goto out; |
2699 | - |
2700 | - /* if the update viewer is started, then hide the notification */ |
2701 | - manager->priv->update_viewer_watcher_id = |
2702 | - g_bus_watch_name (G_BUS_TYPE_SESSION, |
2703 | - "org.freedesktop.PackageKit.UpdateViewer", |
2704 | - G_BUS_NAME_WATCHER_FLAGS_NONE, |
2705 | - update_viewer_appeared_cb, |
2706 | - NULL, |
2707 | - manager, |
2708 | - NULL); |
2709 | - |
2710 | - /* get a volume monitor so we can watch media */ |
2711 | - manager->priv->volume_monitor = g_volume_monitor_get (); |
2712 | - g_signal_connect (manager->priv->volume_monitor, "mount-added", |
2713 | - G_CALLBACK (mount_added_cb), manager); |
2714 | - |
2715 | - /* coldplug */ |
2716 | - reload_proxy_settings (manager); |
2717 | - |
2718 | - /* check for offline update */ |
2719 | - manager->priv->offline_update_id = |
2720 | - g_timeout_add_seconds (GSD_UPDATES_CHECK_OFFLINE_TIMEOUT, |
2721 | - check_offline_update_cb, |
2722 | - manager); |
2723 | - |
2724 | - /* success */ |
2725 | - ret = TRUE; |
2726 | - g_debug ("Started updates manager"); |
2727 | -out: |
2728 | - return ret; |
2729 | -} |
2730 | - |
2731 | -void |
2732 | -gsd_updates_manager_stop (GsdUpdatesManager *manager) |
2733 | -{ |
2734 | - g_debug ("Stopping updates manager"); |
2735 | - |
2736 | - g_clear_object (&manager->priv->settings_proxy); |
2737 | - g_clear_object (&manager->priv->settings_http); |
2738 | - g_clear_object (&manager->priv->settings_ftp); |
2739 | - g_clear_object (&manager->priv->settings_gsd); |
2740 | - g_clear_object (&manager->priv->control); |
2741 | - g_clear_object (&manager->priv->task); |
2742 | - g_clear_object (&manager->priv->refresh); |
2743 | - g_clear_object (&manager->priv->firmware); |
2744 | - g_clear_object (&manager->priv->proxy_session); |
2745 | - g_clear_object (&manager->priv->volume_monitor); |
2746 | - if (manager->priv->cancellable) { |
2747 | - g_cancellable_cancel (manager->priv->cancellable); |
2748 | - g_clear_object (&manager->priv->cancellable); |
2749 | - } |
2750 | - if (manager->priv->update_viewer_watcher_id != 0) { |
2751 | - g_bus_unwatch_name (manager->priv->update_viewer_watcher_id); |
2752 | - manager->priv->update_viewer_watcher_id = 0; |
2753 | - } |
2754 | - if (manager->priv->offline_update_id) { |
2755 | - g_source_remove (manager->priv->offline_update_id); |
2756 | - manager->priv->offline_update_id = 0; |
2757 | - } |
2758 | - if (manager->priv->update_packages != NULL) { |
2759 | - g_ptr_array_unref (manager->priv->update_packages); |
2760 | - manager->priv->update_packages = NULL; |
2761 | - } |
2762 | - g_clear_object (&manager->priv->offline_update_error); |
2763 | -} |
2764 | - |
2765 | -static GObject * |
2766 | -gsd_updates_manager_constructor ( |
2767 | - GType type, |
2768 | - guint n_construct_properties, |
2769 | - GObjectConstructParam *construct_properties) |
2770 | -{ |
2771 | - GsdUpdatesManager *m; |
2772 | - |
2773 | - m = GSD_UPDATES_MANAGER (G_OBJECT_CLASS (gsd_updates_manager_parent_class)->constructor ( |
2774 | - type, |
2775 | - n_construct_properties, |
2776 | - construct_properties)); |
2777 | - |
2778 | - return G_OBJECT (m); |
2779 | -} |
2780 | - |
2781 | -static void |
2782 | -gsd_updates_manager_dispose (GObject *object) |
2783 | -{ |
2784 | - GsdUpdatesManager *manager; |
2785 | - |
2786 | - manager = GSD_UPDATES_MANAGER (object); |
2787 | - |
2788 | - gsd_updates_manager_stop (manager); |
2789 | - |
2790 | - G_OBJECT_CLASS (gsd_updates_manager_parent_class)->dispose (object); |
2791 | -} |
2792 | - |
2793 | -static void |
2794 | -gsd_updates_manager_class_init (GsdUpdatesManagerClass *klass) |
2795 | -{ |
2796 | - GObjectClass *object_class = G_OBJECT_CLASS (klass); |
2797 | - |
2798 | - object_class->constructor = gsd_updates_manager_constructor; |
2799 | - object_class->dispose = gsd_updates_manager_dispose; |
2800 | - |
2801 | - g_type_class_add_private (klass, sizeof (GsdUpdatesManagerPrivate)); |
2802 | -} |
2803 | - |
2804 | -static void |
2805 | -gsd_updates_manager_init (GsdUpdatesManager *manager) |
2806 | -{ |
2807 | - manager->priv = GSD_UPDATES_MANAGER_GET_PRIVATE (manager); |
2808 | -} |
2809 | - |
2810 | -GsdUpdatesManager * |
2811 | -gsd_updates_manager_new (void) |
2812 | -{ |
2813 | - if (manager_object) { |
2814 | - g_object_ref (manager_object); |
2815 | - } else { |
2816 | - manager_object = g_object_new (GSD_TYPE_UPDATES_MANAGER, NULL); |
2817 | - g_object_add_weak_pointer (manager_object, (gpointer *) &manager_object); |
2818 | - } |
2819 | - |
2820 | - return GSD_UPDATES_MANAGER (manager_object); |
2821 | -} |
2822 | |
2823 | === removed file 'plugins/updates/gsd-updates-manager.h' |
2824 | --- plugins/updates/gsd-updates-manager.h 2011-02-15 16:48:15 +0000 |
2825 | +++ plugins/updates/gsd-updates-manager.h 1970-01-01 00:00:00 +0000 |
2826 | @@ -1,57 +0,0 @@ |
2827 | -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- |
2828 | - * |
2829 | - * Copyright (C) 2011 Richard Hughes <richard@hughsie.com> |
2830 | - * |
2831 | - * This program is free software; you can redistribute it and/or modify |
2832 | - * it under the terms of the GNU General Public License as published by |
2833 | - * the Free Software Foundation; either version 2 of the License, or |
2834 | - * (at your option) any later version. |
2835 | - * |
2836 | - * This program is distributed in the hope that it will be useful, |
2837 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2838 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2839 | - * GNU General Public License for more details. |
2840 | - * |
2841 | - * You should have received a copy of the GNU General Public License |
2842 | - * along with this program; if not, write to the Free Software |
2843 | - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
2844 | - * |
2845 | - */ |
2846 | - |
2847 | -#ifndef __GSD_UPDATES_MANAGER_H |
2848 | -#define __GSD_UPDATES_MANAGER_H |
2849 | - |
2850 | -#include <glib.h> |
2851 | -#include <glib-object.h> |
2852 | - |
2853 | -G_BEGIN_DECLS |
2854 | - |
2855 | -#define GSD_TYPE_UPDATES_MANAGER (gsd_updates_manager_get_type ()) |
2856 | -#define GSD_UPDATES_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_UPDATES_MANAGER, GsdUpdatesManager)) |
2857 | -#define GSD_UPDATES_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GSD_TYPE_UPDATES_MANAGER, GsdUpdatesManagerClass)) |
2858 | -#define GSD_IS_UPDATES_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_UPDATES_MANAGER)) |
2859 | -#define GSD_IS_UPDATES_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_UPDATES_MANAGER)) |
2860 | -#define GSD_UPDATES_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_UPDATES_MANAGER, GsdUpdatesManagerClass)) |
2861 | - |
2862 | -typedef struct GsdUpdatesManagerPrivate GsdUpdatesManagerPrivate; |
2863 | - |
2864 | -typedef struct |
2865 | -{ |
2866 | - GObject parent; |
2867 | - GsdUpdatesManagerPrivate *priv; |
2868 | -} GsdUpdatesManager; |
2869 | - |
2870 | -typedef struct |
2871 | -{ |
2872 | - GObjectClass parent_class; |
2873 | -} GsdUpdatesManagerClass; |
2874 | - |
2875 | -GType gsd_updates_manager_get_type (void) G_GNUC_CONST; |
2876 | - |
2877 | -GsdUpdatesManager *gsd_updates_manager_new (void); |
2878 | -gboolean gsd_updates_manager_start (GsdUpdatesManager *manager, GError **error); |
2879 | -void gsd_updates_manager_stop (GsdUpdatesManager *manager); |
2880 | - |
2881 | -G_END_DECLS |
2882 | - |
2883 | -#endif /* __GSD_UPDATES_MANAGER_H */ |
2884 | |
2885 | === removed file 'plugins/updates/gsd-updates-plugin.c' |
2886 | --- plugins/updates/gsd-updates-plugin.c 2012-12-13 16:25:59 +0000 |
2887 | +++ plugins/updates/gsd-updates-plugin.c 1970-01-01 00:00:00 +0000 |
2888 | @@ -1,29 +0,0 @@ |
2889 | -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- |
2890 | - * |
2891 | - * Copyright (C) 2011 Richard Hughes <richard@hughsie.com> |
2892 | - * |
2893 | - * This program is free software; you can redistribute it and/or modify |
2894 | - * it under the terms of the GNU General Public License as published by |
2895 | - * the Free Software Foundation; either version 2, or (at your option) |
2896 | - * any later version. |
2897 | - * |
2898 | - * This program is distributed in the hope that it will be useful, |
2899 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2900 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2901 | - * GNU General Public License for more details. |
2902 | - * |
2903 | - * You should have received a copy of the GNU General Public License |
2904 | - * along with this program; if not, write to the Free Software |
2905 | - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
2906 | - * |
2907 | - */ |
2908 | - |
2909 | -#include "config.h" |
2910 | - |
2911 | -#include <glib/gi18n-lib.h> |
2912 | -#include <gmodule.h> |
2913 | - |
2914 | -#include "gnome-settings-plugin.h" |
2915 | -#include "gsd-updates-manager.h" |
2916 | - |
2917 | -GNOME_SETTINGS_PLUGIN_REGISTER (GsdUpdates, gsd_updates) |
2918 | |
2919 | === removed file 'plugins/updates/gsd-updates-refresh.c' |
2920 | --- plugins/updates/gsd-updates-refresh.c 2016-05-20 16:50:05 +0000 |
2921 | +++ plugins/updates/gsd-updates-refresh.c 1970-01-01 00:00:00 +0000 |
2922 | @@ -1,572 +0,0 @@ |
2923 | -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- |
2924 | - * |
2925 | - * Copyright (C) 2007-2011 Richard Hughes <richard@hughsie.com> |
2926 | - * |
2927 | - * Licensed under the GNU General Public License Version 2 |
2928 | - * |
2929 | - * This program is free software; you can redistribute it and/or modify |
2930 | - * it under the terms of the GNU General Public License as published by |
2931 | - * the Free Software Foundation; either version 2 of the License, or |
2932 | - * (at your option) any later version. |
2933 | - * |
2934 | - * This program is distributed in the hope that it will be useful, |
2935 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2936 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2937 | - * GNU General Public License for more details. |
2938 | - * |
2939 | - * You should have received a copy of the GNU General Public License |
2940 | - * along with this program; if not, write to the Free Software |
2941 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
2942 | - */ |
2943 | - |
2944 | -#include "config.h" |
2945 | - |
2946 | -#include <glib/gi18n.h> |
2947 | -#include <packagekit-glib2/packagekit.h> |
2948 | -#include <libupower-glib/upower.h> |
2949 | - |
2950 | -#include "gnome-settings-bus.h" |
2951 | - |
2952 | -#include "gsd-updates-common.h" |
2953 | -#include "gsd-updates-refresh.h" |
2954 | - |
2955 | -static void gsd_updates_refresh_finalize (GObject *object); |
2956 | - |
2957 | -#define GSD_UPDATES_REFRESH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_UPDATES_REFRESH, GsdUpdatesRefreshPrivate)) |
2958 | - |
2959 | -#define PERIODIC_CHECK_TIME 60*60 /* poke PackageKit every hour */ |
2960 | -#define LOGIN_TIMEOUT 3 /* seconds */ |
2961 | -#define SESSION_STARTUP_TIMEOUT 10 /* seconds */ |
2962 | - |
2963 | -enum { |
2964 | - PRESENCE_STATUS_AVAILABLE = 0, |
2965 | - PRESENCE_STATUS_INVISIBLE, |
2966 | - PRESENCE_STATUS_BUSY, |
2967 | - PRESENCE_STATUS_IDLE, |
2968 | - PRESENCE_STATUS_UNKNOWN |
2969 | -}; |
2970 | - |
2971 | -/* |
2972 | - * at startup, after a small delay, force a GetUpdates call |
2973 | - * every hour (or any event) check: |
2974 | - - if we are online, idle and on AC power, it's been more than a day |
2975 | - since we refreshed then RefreshCache |
2976 | - - if we are online and it's been longer than the timeout since |
2977 | - getting the updates period then GetUpdates |
2978 | -*/ |
2979 | - |
2980 | -struct GsdUpdatesRefreshPrivate |
2981 | -{ |
2982 | - gboolean session_idle; |
2983 | - gboolean on_battery; |
2984 | - gboolean network_active; |
2985 | - guint timeout_id; |
2986 | - guint periodic_id; |
2987 | - UpClient *client; |
2988 | - GSettings *settings; |
2989 | - GsdSessionManager *proxy_session; |
2990 | - PkControl *control; |
2991 | -}; |
2992 | - |
2993 | -enum { |
2994 | - REFRESH_CACHE, |
2995 | - GET_UPDATES, |
2996 | - GET_UPGRADES, |
2997 | - LAST_SIGNAL |
2998 | -}; |
2999 | - |
3000 | -static guint signals [LAST_SIGNAL] = { 0 }; |
3001 | - |
3002 | -G_DEFINE_TYPE (GsdUpdatesRefresh, gsd_updates_refresh, G_TYPE_OBJECT) |
3003 | - |
3004 | -static void |
3005 | -gsd_updates_refresh_class_init (GsdUpdatesRefreshClass *klass) |
3006 | -{ |
3007 | - GObjectClass *object_class = G_OBJECT_CLASS (klass); |
3008 | - object_class->finalize = gsd_updates_refresh_finalize; |
3009 | - g_type_class_add_private (klass, sizeof (GsdUpdatesRefreshPrivate)); |
3010 | - signals [REFRESH_CACHE] = |
3011 | - g_signal_new ("refresh-cache", |
3012 | - G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, |
3013 | - 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, |
3014 | - G_TYPE_NONE, 0); |
3015 | - signals [GET_UPDATES] = |
3016 | - g_signal_new ("get-updates", |
3017 | - G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, |
3018 | - 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, |
3019 | - G_TYPE_NONE, 0); |
3020 | - signals [GET_UPGRADES] = |
3021 | - g_signal_new ("get-upgrades", |
3022 | - G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, |
3023 | - 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, |
3024 | - G_TYPE_NONE, 0); |
3025 | -} |
3026 | - |
3027 | -static void |
3028 | -get_time_refresh_cache_cb (GObject *object, |
3029 | - GAsyncResult *res, |
3030 | - GsdUpdatesRefresh *refresh) |
3031 | -{ |
3032 | - PkControl *control = PK_CONTROL (object); |
3033 | - GError *error = NULL; |
3034 | - guint seconds; |
3035 | - guint thresh; |
3036 | - |
3037 | - /* get the result */ |
3038 | - seconds = pk_control_get_time_since_action_finish (control, res, &error); |
3039 | - if (seconds == 0) { |
3040 | - g_warning ("failed to get time: %s", error->message); |
3041 | - g_error_free (error); |
3042 | - return; |
3043 | - } |
3044 | - |
3045 | - /* have we passed the timout? */ |
3046 | - thresh = g_settings_get_int (refresh->priv->settings, |
3047 | - GSD_SETTINGS_FREQUENCY_GET_UPDATES); |
3048 | - if (seconds < thresh) { |
3049 | - g_debug ("not before timeout, thresh=%u, now=%u", thresh, seconds); |
3050 | - return; |
3051 | - } |
3052 | - |
3053 | - /* send signal */ |
3054 | - g_debug ("emitting refresh-cache"); |
3055 | - g_signal_emit (refresh, signals [REFRESH_CACHE], 0); |
3056 | -} |
3057 | - |
3058 | -static void |
3059 | -maybe_refresh_cache (GsdUpdatesRefresh *refresh) |
3060 | -{ |
3061 | - guint thresh; |
3062 | - |
3063 | - g_return_if_fail (GSD_IS_UPDATES_REFRESH (refresh)); |
3064 | - |
3065 | - /* if we don't want to auto check for updates, don't do this either */ |
3066 | - thresh = g_settings_get_int (refresh->priv->settings, |
3067 | - GSD_SETTINGS_FREQUENCY_GET_UPDATES); |
3068 | - if (thresh == 0) { |
3069 | - g_debug ("not when policy is set to never"); |
3070 | - return; |
3071 | - } |
3072 | - |
3073 | - /* only do the refresh cache when the user is idle */ |
3074 | - if (!refresh->priv->session_idle) { |
3075 | - g_debug ("not when session active"); |
3076 | - return; |
3077 | - } |
3078 | - |
3079 | - /* get this each time, as it may have changed behind out back */ |
3080 | - thresh = g_settings_get_int (refresh->priv->settings, |
3081 | - GSD_SETTINGS_FREQUENCY_REFRESH_CACHE); |
3082 | - if (thresh == 0) { |
3083 | - g_debug ("not when policy is set to never"); |
3084 | - return; |
3085 | - } |
3086 | - |
3087 | - /* get the time since the last refresh */ |
3088 | - pk_control_get_time_since_action_async (refresh->priv->control, |
3089 | - PK_ROLE_ENUM_REFRESH_CACHE, |
3090 | - NULL, |
3091 | - (GAsyncReadyCallback) get_time_refresh_cache_cb, |
3092 | - refresh); |
3093 | -} |
3094 | - |
3095 | -static void |
3096 | -get_time_get_updates_cb (GObject *object, GAsyncResult *res, GsdUpdatesRefresh *refresh) |
3097 | -{ |
3098 | - PkControl *control = PK_CONTROL (object); |
3099 | - GError *error = NULL; |
3100 | - guint seconds; |
3101 | - guint thresh; |
3102 | - |
3103 | - /* get the result */ |
3104 | - seconds = pk_control_get_time_since_action_finish (control, res, &error); |
3105 | - if (seconds == 0) { |
3106 | - g_warning ("failed to get time: %s", error->message); |
3107 | - g_error_free (error); |
3108 | - return; |
3109 | - } |
3110 | - |
3111 | - /* have we passed the timout? */ |
3112 | - thresh = g_settings_get_int (refresh->priv->settings, |
3113 | - GSD_SETTINGS_FREQUENCY_GET_UPDATES); |
3114 | - if (seconds < thresh) { |
3115 | - g_debug ("not before timeout, thresh=%u, now=%u", thresh, seconds); |
3116 | - return; |
3117 | - } |
3118 | - |
3119 | - /* send signal */ |
3120 | - g_debug ("emitting get-updates"); |
3121 | - g_signal_emit (refresh, signals [GET_UPDATES], 0); |
3122 | -} |
3123 | - |
3124 | -static void |
3125 | -maybe_get_updates (GsdUpdatesRefresh *refresh) |
3126 | -{ |
3127 | - guint thresh; |
3128 | - |
3129 | - g_return_if_fail (GSD_IS_UPDATES_REFRESH (refresh)); |
3130 | - |
3131 | - /* if we don't want to auto check for updates, don't do this either */ |
3132 | - thresh = g_settings_get_int (refresh->priv->settings, |
3133 | - GSD_SETTINGS_FREQUENCY_GET_UPDATES); |
3134 | - if (thresh == 0) { |
3135 | - g_debug ("not when policy is set to never"); |
3136 | - return; |
3137 | - } |
3138 | - |
3139 | - /* get the time since the last refresh */ |
3140 | - pk_control_get_time_since_action_async (refresh->priv->control, |
3141 | - PK_ROLE_ENUM_GET_UPDATES, |
3142 | - NULL, |
3143 | - (GAsyncReadyCallback) get_time_get_updates_cb, |
3144 | - refresh); |
3145 | -} |
3146 | - |
3147 | -static void |
3148 | -get_time_get_upgrades_cb (GObject *object, |
3149 | - GAsyncResult *res, |
3150 | - GsdUpdatesRefresh *refresh) |
3151 | -{ |
3152 | - PkControl *control = PK_CONTROL (object); |
3153 | - GError *error = NULL; |
3154 | - guint seconds; |
3155 | - guint thresh; |
3156 | - |
3157 | - /* get the result */ |
3158 | - seconds = pk_control_get_time_since_action_finish (control, res, &error); |
3159 | - if (seconds == 0) { |
3160 | - g_warning ("failed to get time: %s", error->message); |
3161 | - g_error_free (error); |
3162 | - return; |
3163 | - } |
3164 | - |
3165 | - /* have we passed the timout? */ |
3166 | - thresh = g_settings_get_int (refresh->priv->settings, |
3167 | - GSD_SETTINGS_FREQUENCY_GET_UPDATES); |
3168 | - if (seconds < thresh) { |
3169 | - g_debug ("not before timeout, thresh=%u, now=%u", |
3170 | - thresh, seconds); |
3171 | - return; |
3172 | - } |
3173 | - |
3174 | - /* send signal */ |
3175 | - g_debug ("emitting get-upgrades"); |
3176 | - g_signal_emit (refresh, signals [GET_UPGRADES], 0); |
3177 | -} |
3178 | - |
3179 | -static void |
3180 | -maybe_get_upgrades (GsdUpdatesRefresh *refresh) |
3181 | -{ |
3182 | - guint thresh; |
3183 | - |
3184 | - g_return_if_fail (GSD_IS_UPDATES_REFRESH (refresh)); |
3185 | - |
3186 | - /* get this each time, as it may have changed behind out back */ |
3187 | - thresh = g_settings_get_int (refresh->priv->settings, |
3188 | - GSD_SETTINGS_FREQUENCY_GET_UPGRADES); |
3189 | - if (thresh == 0) { |
3190 | - g_debug ("not when policy is set to never"); |
3191 | - return; |
3192 | - } |
3193 | - |
3194 | - /* get the time since the last refresh */ |
3195 | - pk_control_get_time_since_action_async (refresh->priv->control, |
3196 | - PK_ROLE_ENUM_GET_DISTRO_UPGRADES, |
3197 | - NULL, |
3198 | - (GAsyncReadyCallback) get_time_get_upgrades_cb, |
3199 | - refresh); |
3200 | -} |
3201 | - |
3202 | -static gboolean |
3203 | -change_state_cb (GsdUpdatesRefresh *refresh) |
3204 | -{ |
3205 | - /* check all actions */ |
3206 | - maybe_refresh_cache (refresh); |
3207 | - maybe_get_updates (refresh); |
3208 | - maybe_get_upgrades (refresh); |
3209 | - return FALSE; |
3210 | -} |
3211 | - |
3212 | -static gboolean |
3213 | -change_state (GsdUpdatesRefresh *refresh) |
3214 | -{ |
3215 | - gboolean ret; |
3216 | - |
3217 | - g_return_val_if_fail (GSD_IS_UPDATES_REFRESH (refresh), FALSE); |
3218 | - |
3219 | - /* no point continuing if we have no network */ |
3220 | - if (!refresh->priv->network_active) { |
3221 | - g_debug ("not when no network"); |
3222 | - return FALSE; |
3223 | - } |
3224 | - |
3225 | - /* not on battery unless overridden */ |
3226 | - ret = g_settings_get_boolean (refresh->priv->settings, |
3227 | - GSD_SETTINGS_UPDATE_BATTERY); |
3228 | - if (!ret && refresh->priv->on_battery) { |
3229 | - g_debug ("not when on battery"); |
3230 | - return FALSE; |
3231 | - } |
3232 | - |
3233 | - /* wait a little time for things to settle down */ |
3234 | - if (refresh->priv->timeout_id != 0) |
3235 | - g_source_remove (refresh->priv->timeout_id); |
3236 | - g_debug ("defering action for %i seconds", |
3237 | - SESSION_STARTUP_TIMEOUT); |
3238 | - refresh->priv->timeout_id = |
3239 | - g_timeout_add_seconds (SESSION_STARTUP_TIMEOUT, |
3240 | - (GSourceFunc) change_state_cb, |
3241 | - refresh); |
3242 | - g_source_set_name_by_id (refresh->priv->timeout_id, |
3243 | - "[GsdUpdatesRefresh] change-state"); |
3244 | - |
3245 | - return TRUE; |
3246 | -} |
3247 | - |
3248 | -static void |
3249 | -settings_key_changed_cb (GSettings *client, |
3250 | - const gchar *key, |
3251 | - GsdUpdatesRefresh *refresh) |
3252 | -{ |
3253 | - g_return_if_fail (GSD_IS_UPDATES_REFRESH (refresh)); |
3254 | - if (g_strcmp0 (key, GSD_SETTINGS_FREQUENCY_GET_UPDATES) == 0 || |
3255 | - g_strcmp0 (key, GSD_SETTINGS_FREQUENCY_GET_UPGRADES) == 0 || |
3256 | - g_strcmp0 (key, GSD_SETTINGS_FREQUENCY_REFRESH_CACHE) == 0 || |
3257 | - g_strcmp0 (key, GSD_SETTINGS_UPDATE_BATTERY) == 0) |
3258 | - change_state (refresh); |
3259 | -} |
3260 | - |
3261 | -static gboolean |
3262 | -convert_network_state (GsdUpdatesRefresh *refresh, PkNetworkEnum state) |
3263 | -{ |
3264 | - /* offline */ |
3265 | - if (state == PK_NETWORK_ENUM_OFFLINE) |
3266 | - return FALSE; |
3267 | - |
3268 | - /* online */ |
3269 | - if (state == PK_NETWORK_ENUM_ONLINE || |
3270 | - state == PK_NETWORK_ENUM_WIFI || |
3271 | - state == PK_NETWORK_ENUM_WIRED) |
3272 | - return TRUE; |
3273 | - |
3274 | - /* check policy */ |
3275 | - if (state == PK_NETWORK_ENUM_MOBILE) |
3276 | - return g_settings_get_boolean (refresh->priv->settings, |
3277 | - GSD_SETTINGS_CONNECTION_USE_MOBILE); |
3278 | - |
3279 | - /* not recognised */ |
3280 | - g_warning ("state unknown: %i", state); |
3281 | - return TRUE; |
3282 | -} |
3283 | - |
3284 | -static void |
3285 | -notify_network_state_cb (PkControl *control, |
3286 | - GParamSpec *pspec, |
3287 | - GsdUpdatesRefresh *refresh) |
3288 | -{ |
3289 | - PkNetworkEnum state; |
3290 | - |
3291 | - g_return_if_fail (GSD_IS_UPDATES_REFRESH (refresh)); |
3292 | - |
3293 | - g_object_get (control, "network-state", &state, NULL); |
3294 | - refresh->priv->network_active = convert_network_state (refresh, state); |
3295 | - g_debug ("setting online %i", refresh->priv->network_active); |
3296 | - if (refresh->priv->network_active) |
3297 | - change_state (refresh); |
3298 | -} |
3299 | - |
3300 | -static gboolean |
3301 | -periodic_timeout_cb (gpointer user_data) |
3302 | -{ |
3303 | - GsdUpdatesRefresh *refresh = GSD_UPDATES_REFRESH (user_data); |
3304 | - |
3305 | - g_return_val_if_fail (GSD_IS_UPDATES_REFRESH (refresh), FALSE); |
3306 | - |
3307 | - /* debug so we can catch polling */ |
3308 | - g_debug ("polling check"); |
3309 | - |
3310 | - /* triggered once an hour */ |
3311 | - change_state (refresh); |
3312 | - |
3313 | - /* always return */ |
3314 | - return TRUE; |
3315 | -} |
3316 | - |
3317 | -static void |
3318 | -gsd_updates_refresh_client_changed_cb (UpClient *client, |
3319 | - GsdUpdatesRefresh *refresh) |
3320 | -{ |
3321 | - gboolean on_battery; |
3322 | - |
3323 | - g_return_if_fail (GSD_IS_UPDATES_REFRESH (refresh)); |
3324 | - |
3325 | - /* get the on-battery state */ |
3326 | - on_battery = up_client_get_on_battery (refresh->priv->client); |
3327 | - if (on_battery == refresh->priv->on_battery) { |
3328 | - g_debug ("same state as before, ignoring"); |
3329 | - return; |
3330 | - } |
3331 | - |
3332 | - /* save in local cache */ |
3333 | - g_debug ("setting on_battery %i", on_battery); |
3334 | - refresh->priv->on_battery = on_battery; |
3335 | - if (!on_battery) |
3336 | - change_state (refresh); |
3337 | -} |
3338 | - |
3339 | -static void |
3340 | -get_properties_cb (GObject *object, |
3341 | - GAsyncResult *res, |
3342 | - GsdUpdatesRefresh *refresh) |
3343 | -{ |
3344 | - PkNetworkEnum state; |
3345 | - GError *error = NULL; |
3346 | - PkControl *control = PK_CONTROL(object); |
3347 | - gboolean ret; |
3348 | - |
3349 | - /* get the result */ |
3350 | - ret = pk_control_get_properties_finish (control, res, &error); |
3351 | - if (!ret) { |
3352 | - /* TRANSLATORS: backend is broken, and won't tell us what it supports */ |
3353 | - g_warning ("could not get properties"); |
3354 | - g_error_free (error); |
3355 | - goto out; |
3356 | - } |
3357 | - |
3358 | - /* get values */ |
3359 | - g_object_get (control, |
3360 | - "network-state", &state, |
3361 | - NULL); |
3362 | - refresh->priv->network_active = convert_network_state (refresh, state); |
3363 | -out: |
3364 | - return; |
3365 | -} |
3366 | - |
3367 | -static void |
3368 | -session_presence_signal_cb (GDBusProxy *proxy, |
3369 | - gchar *sender_name, |
3370 | - gchar *signal_name, |
3371 | - GVariant *parameters, |
3372 | - GsdUpdatesRefresh *refresh) |
3373 | -{ |
3374 | - guint status; |
3375 | - |
3376 | - g_return_if_fail (GSD_IS_UPDATES_REFRESH (refresh)); |
3377 | - |
3378 | - if (g_strcmp0 (signal_name, "StatusChanged") != 0) |
3379 | - return; |
3380 | - |
3381 | - /* map status code into boolean */ |
3382 | - g_variant_get (parameters, "(u)", &status); |
3383 | - refresh->priv->session_idle = (status == PRESENCE_STATUS_IDLE); |
3384 | - g_debug ("setting is_idle %i", |
3385 | - refresh->priv->session_idle); |
3386 | - if (refresh->priv->session_idle) |
3387 | - change_state (refresh); |
3388 | - |
3389 | -} |
3390 | - |
3391 | -static void |
3392 | -gsd_updates_refresh_init (GsdUpdatesRefresh *refresh) |
3393 | -{ |
3394 | - GVariant *status; |
3395 | - guint status_code; |
3396 | - |
3397 | - refresh->priv = GSD_UPDATES_REFRESH_GET_PRIVATE (refresh); |
3398 | - refresh->priv->on_battery = FALSE; |
3399 | - refresh->priv->network_active = FALSE; |
3400 | - refresh->priv->timeout_id = 0; |
3401 | - refresh->priv->periodic_id = 0; |
3402 | - |
3403 | - /* we need to know the updates frequency */ |
3404 | - refresh->priv->settings = g_settings_new (GSD_SETTINGS_SCHEMA); |
3405 | - g_signal_connect (refresh->priv->settings, "changed", |
3406 | - G_CALLBACK (settings_key_changed_cb), refresh); |
3407 | - |
3408 | - /* we need to query the last cache refresh time */ |
3409 | - refresh->priv->control = pk_control_new (); |
3410 | - g_signal_connect (refresh->priv->control, "notify::network-state", |
3411 | - G_CALLBACK (notify_network_state_cb), |
3412 | - refresh); |
3413 | - |
3414 | - /* get network state */ |
3415 | - pk_control_get_properties_async (refresh->priv->control, |
3416 | - NULL, |
3417 | - (GAsyncReadyCallback) get_properties_cb, |
3418 | - refresh); |
3419 | - |
3420 | - /* use a UpClient */ |
3421 | - refresh->priv->client = up_client_new (); |
3422 | - g_signal_connect (refresh->priv->client, "changed", |
3423 | - G_CALLBACK (gsd_updates_refresh_client_changed_cb), refresh); |
3424 | - |
3425 | - /* get the battery state */ |
3426 | - refresh->priv->on_battery = up_client_get_on_battery (refresh->priv->client); |
3427 | - g_debug ("setting on battery %i", refresh->priv->on_battery); |
3428 | - |
3429 | - /* use gnome-session for the idle detection */ |
3430 | - refresh->priv->proxy_session = |
3431 | - gnome_settings_bus_get_session_proxy (); |
3432 | - if (refresh->priv->proxy_session != NULL) { |
3433 | - g_signal_connect (G_DBUS_PROXY (refresh->priv->proxy_session), |
3434 | - "g-signal", |
3435 | - G_CALLBACK (session_presence_signal_cb), |
3436 | - refresh); |
3437 | - status = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (refresh->priv->proxy_session), |
3438 | - "status"); |
3439 | - if (status) { |
3440 | - g_variant_get (status, "u", &status_code); |
3441 | - refresh->priv->session_idle = (status_code == PRESENCE_STATUS_IDLE); |
3442 | - g_variant_unref (status); |
3443 | - } |
3444 | - else { |
3445 | - refresh->priv->session_idle = FALSE; |
3446 | - } |
3447 | - } |
3448 | - |
3449 | - /* we check this in case we miss one of the async signals */ |
3450 | - refresh->priv->periodic_id = |
3451 | - g_timeout_add_seconds (PERIODIC_CHECK_TIME, |
3452 | - periodic_timeout_cb, refresh); |
3453 | - g_source_set_name_by_id (refresh->priv->periodic_id, |
3454 | - "[GsdUpdatesRefresh] periodic check"); |
3455 | - |
3456 | - /* check system state */ |
3457 | - change_state (refresh); |
3458 | -} |
3459 | - |
3460 | -static void |
3461 | -gsd_updates_refresh_finalize (GObject *object) |
3462 | -{ |
3463 | - GsdUpdatesRefresh *refresh; |
3464 | - |
3465 | - g_return_if_fail (GSD_IS_UPDATES_REFRESH (object)); |
3466 | - |
3467 | - refresh = GSD_UPDATES_REFRESH (object); |
3468 | - g_return_if_fail (refresh->priv != NULL); |
3469 | - |
3470 | - if (refresh->priv->timeout_id != 0) |
3471 | - g_source_remove (refresh->priv->timeout_id); |
3472 | - if (refresh->priv->periodic_id != 0) |
3473 | - g_source_remove (refresh->priv->periodic_id); |
3474 | - |
3475 | - g_signal_handlers_disconnect_by_data (refresh->priv->client, refresh); |
3476 | - g_signal_handlers_disconnect_by_data (refresh->priv->proxy_session, refresh); |
3477 | - |
3478 | - g_object_unref (refresh->priv->control); |
3479 | - g_object_unref (refresh->priv->settings); |
3480 | - g_object_unref (refresh->priv->client); |
3481 | - if (refresh->priv->proxy_session != NULL) |
3482 | - g_object_unref (refresh->priv->proxy_session); |
3483 | - |
3484 | - G_OBJECT_CLASS (gsd_updates_refresh_parent_class)->finalize (object); |
3485 | -} |
3486 | - |
3487 | -GsdUpdatesRefresh * |
3488 | -gsd_updates_refresh_new (void) |
3489 | -{ |
3490 | - GsdUpdatesRefresh *refresh; |
3491 | - refresh = g_object_new (GSD_TYPE_UPDATES_REFRESH, NULL); |
3492 | - return GSD_UPDATES_REFRESH (refresh); |
3493 | -} |
3494 | - |
3495 | |
3496 | === removed file 'plugins/updates/gsd-updates-refresh.h' |
3497 | --- plugins/updates/gsd-updates-refresh.h 2012-06-29 11:56:58 +0000 |
3498 | +++ plugins/updates/gsd-updates-refresh.h 1970-01-01 00:00:00 +0000 |
3499 | @@ -1,52 +0,0 @@ |
3500 | -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- |
3501 | - * |
3502 | - * Copyright (C) 2007-2011 Richard Hughes <richard@hughsie.com> |
3503 | - * |
3504 | - * Licensed under the GNU General Public License Version 2 |
3505 | - * |
3506 | - * This program is free software; you can redistribute it and/or modify |
3507 | - * it under the terms of the GNU General Public License as published by |
3508 | - * the Free Software Foundation; either version 2 of the License, or |
3509 | - * (at your option) any later version. |
3510 | - * |
3511 | - * This program is distributed in the hope that it will be useful, |
3512 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3513 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3514 | - * GNU General Public License for more details. |
3515 | - * |
3516 | - * You should have received a copy of the GNU General Public License |
3517 | - * along with this program; if not, write to the Free Software |
3518 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
3519 | - */ |
3520 | - |
3521 | -#ifndef __GSD_UPDATES_REFRESH_H |
3522 | -#define __GSD_UPDATES_REFRESH_H |
3523 | - |
3524 | -#include <glib-object.h> |
3525 | - |
3526 | -G_BEGIN_DECLS |
3527 | - |
3528 | -#define GSD_TYPE_UPDATES_REFRESH (gsd_updates_refresh_get_type ()) |
3529 | -#define GSD_UPDATES_REFRESH(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_UPDATES_REFRESH, GsdUpdatesRefresh)) |
3530 | -#define GSD_UPDATES_REFRESH_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_UPDATES_REFRESH, GsdUpdatesRefreshClass)) |
3531 | -#define GSD_IS_UPDATES_REFRESH(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_UPDATES_REFRESH)) |
3532 | - |
3533 | -typedef struct GsdUpdatesRefreshPrivate GsdUpdatesRefreshPrivate; |
3534 | - |
3535 | -typedef struct |
3536 | -{ |
3537 | - GObject parent; |
3538 | - GsdUpdatesRefreshPrivate *priv; |
3539 | -} GsdUpdatesRefresh; |
3540 | - |
3541 | -typedef struct |
3542 | -{ |
3543 | - GObjectClass parent_class; |
3544 | -} GsdUpdatesRefreshClass; |
3545 | - |
3546 | -GType gsd_updates_refresh_get_type (void); |
3547 | -GsdUpdatesRefresh *gsd_updates_refresh_new (void); |
3548 | - |
3549 | -G_END_DECLS |
3550 | - |
3551 | -#endif /* __GSD_UPDATES_REFRESH_H */ |
3552 | |
3553 | === removed file 'plugins/updates/updates-design.svg' |
3554 | --- plugins/updates/updates-design.svg 2012-06-29 11:56:58 +0000 |
3555 | +++ plugins/updates/updates-design.svg 1970-01-01 00:00:00 +0000 |
3556 | @@ -1,765 +0,0 @@ |
3557 | -<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
3558 | -<!-- Created with Inkscape (http://www.inkscape.org/) --> |
3559 | - |
3560 | -<svg |
3561 | - xmlns:dc="http://purl.org/dc/elements/1.1/" |
3562 | - xmlns:cc="http://creativecommons.org/ns#" |
3563 | - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
3564 | - xmlns:svg="http://www.w3.org/2000/svg" |
3565 | - xmlns="http://www.w3.org/2000/svg" |
3566 | - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" |
3567 | - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" |
3568 | - width="744.09448819" |
3569 | - height="1052.3622047" |
3570 | - id="svg2" |
3571 | - version="1.1" |
3572 | - inkscape:version="0.48.2 r9819" |
3573 | - sodipodi:docname="plan.svg" |
3574 | - inkscape:export-filename="/home/hughsie/Code/gnome3/gnome-settings-daemon/plugins/updates/docs/plan.png" |
3575 | - inkscape:export-xdpi="90.094635" |
3576 | - inkscape:export-ydpi="90.094635"> |
3577 | - <defs |
3578 | - id="defs4"> |
3579 | - <marker |
3580 | - inkscape:stockid="Arrow2Lend" |
3581 | - orient="auto" |
3582 | - refY="0.0" |
3583 | - refX="0.0" |
3584 | - id="Arrow2Lend" |
3585 | - style="overflow:visible;"> |
3586 | - <path |
3587 | - id="path3789" |
3588 | - style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;" |
3589 | - d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " |
3590 | - transform="scale(1.1) rotate(180) translate(1,0)" /> |
3591 | - </marker> |
3592 | - <marker |
3593 | - inkscape:stockid="Arrow1Mend" |
3594 | - orient="auto" |
3595 | - refY="0.0" |
3596 | - refX="0.0" |
3597 | - id="Arrow1Mend" |
3598 | - style="overflow:visible;"> |
3599 | - <path |
3600 | - id="path3777" |
3601 | - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " |
3602 | - style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;" |
3603 | - transform="scale(0.4) rotate(180) translate(10,0)" /> |
3604 | - </marker> |
3605 | - <marker |
3606 | - inkscape:stockid="Arrow2Lend" |
3607 | - orient="auto" |
3608 | - refY="0" |
3609 | - refX="0" |
3610 | - id="Arrow2Lend-7" |
3611 | - style="overflow:visible"> |
3612 | - <path |
3613 | - inkscape:connector-curvature="0" |
3614 | - id="path3789-0" |
3615 | - style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" |
3616 | - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" |
3617 | - transform="matrix(-1.1,0,0,-1.1,-1.1,0)" /> |
3618 | - </marker> |
3619 | - <marker |
3620 | - inkscape:stockid="Arrow2Lend" |
3621 | - orient="auto" |
3622 | - refY="0" |
3623 | - refX="0" |
3624 | - id="Arrow2Lend-0" |
3625 | - style="overflow:visible"> |
3626 | - <path |
3627 | - inkscape:connector-curvature="0" |
3628 | - id="path3789-4" |
3629 | - style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" |
3630 | - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" |
3631 | - transform="matrix(-1.1,0,0,-1.1,-1.1,0)" /> |
3632 | - </marker> |
3633 | - <marker |
3634 | - inkscape:stockid="Arrow2Lend" |
3635 | - orient="auto" |
3636 | - refY="0" |
3637 | - refX="0" |
3638 | - id="Arrow2Lend-2" |
3639 | - style="overflow:visible"> |
3640 | - <path |
3641 | - inkscape:connector-curvature="0" |
3642 | - id="path3789-02" |
3643 | - style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" |
3644 | - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" |
3645 | - transform="matrix(-1.1,0,0,-1.1,-1.1,0)" /> |
3646 | - </marker> |
3647 | - <marker |
3648 | - inkscape:stockid="Arrow2Lend" |
3649 | - orient="auto" |
3650 | - refY="0" |
3651 | - refX="0" |
3652 | - id="Arrow2Lend-4" |
3653 | - style="overflow:visible"> |
3654 | - <path |
3655 | - inkscape:connector-curvature="0" |
3656 | - id="path3789-03" |
3657 | - style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" |
3658 | - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" |
3659 | - transform="matrix(-1.1,0,0,-1.1,-1.1,0)" /> |
3660 | - </marker> |
3661 | - <marker |
3662 | - inkscape:stockid="Arrow2Lend" |
3663 | - orient="auto" |
3664 | - refY="0" |
3665 | - refX="0" |
3666 | - id="Arrow2Lend-6" |
3667 | - style="overflow:visible"> |
3668 | - <path |
3669 | - inkscape:connector-curvature="0" |
3670 | - id="path3789-7" |
3671 | - style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" |
3672 | - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" |
3673 | - transform="matrix(-1.1,0,0,-1.1,-1.1,0)" /> |
3674 | - </marker> |
3675 | - <marker |
3676 | - inkscape:stockid="Arrow2Lend" |
3677 | - orient="auto" |
3678 | - refY="0" |
3679 | - refX="0" |
3680 | - id="Arrow2Lend-48" |
3681 | - style="overflow:visible"> |
3682 | - <path |
3683 | - inkscape:connector-curvature="0" |
3684 | - id="path3789-3" |
3685 | - style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" |
3686 | - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" |
3687 | - transform="matrix(-1.1,0,0,-1.1,-1.1,0)" /> |
3688 | - </marker> |
3689 | - <marker |
3690 | - inkscape:stockid="Arrow2Lend" |
3691 | - orient="auto" |
3692 | - refY="0" |
3693 | - refX="0" |
3694 | - id="Arrow2Lend-8" |
3695 | - style="overflow:visible"> |
3696 | - <path |
3697 | - inkscape:connector-curvature="0" |
3698 | - id="path3789-9" |
3699 | - style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" |
3700 | - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" |
3701 | - transform="matrix(-1.1,0,0,-1.1,-1.1,0)" /> |
3702 | - </marker> |
3703 | - <marker |
3704 | - inkscape:stockid="Arrow2Lend" |
3705 | - orient="auto" |
3706 | - refY="0" |
3707 | - refX="0" |
3708 | - id="Arrow2Lend-5" |
3709 | - style="overflow:visible"> |
3710 | - <path |
3711 | - inkscape:connector-curvature="0" |
3712 | - id="path3789-32" |
3713 | - style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" |
3714 | - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" |
3715 | - transform="matrix(-1.1,0,0,-1.1,-1.1,0)" /> |
3716 | - </marker> |
3717 | - <marker |
3718 | - inkscape:stockid="Arrow2Lend" |
3719 | - orient="auto" |
3720 | - refY="0" |
3721 | - refX="0" |
3722 | - id="Arrow2Lend-54" |
3723 | - style="overflow:visible"> |
3724 | - <path |
3725 | - inkscape:connector-curvature="0" |
3726 | - id="path3789-47" |
3727 | - style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" |
3728 | - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" |
3729 | - transform="matrix(-1.1,0,0,-1.1,-1.1,0)" /> |
3730 | - </marker> |
3731 | - <marker |
3732 | - inkscape:stockid="Arrow2Lend" |
3733 | - orient="auto" |
3734 | - refY="0" |
3735 | - refX="0" |
3736 | - id="Arrow2Lend-60" |
3737 | - style="overflow:visible"> |
3738 | - <path |
3739 | - inkscape:connector-curvature="0" |
3740 | - id="path3789-00" |
3741 | - style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" |
3742 | - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" |
3743 | - transform="matrix(-1.1,0,0,-1.1,-1.1,0)" /> |
3744 | - </marker> |
3745 | - <marker |
3746 | - inkscape:stockid="Arrow2Lend" |
3747 | - orient="auto" |
3748 | - refY="0" |
3749 | - refX="0" |
3750 | - id="Arrow2Lend-9" |
3751 | - style="overflow:visible"> |
3752 | - <path |
3753 | - inkscape:connector-curvature="0" |
3754 | - id="path3789-72" |
3755 | - style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" |
3756 | - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" |
3757 | - transform="matrix(-1.1,0,0,-1.1,-1.1,0)" /> |
3758 | - </marker> |
3759 | - <marker |
3760 | - inkscape:stockid="Arrow2Lend" |
3761 | - orient="auto" |
3762 | - refY="0" |
3763 | - refX="0" |
3764 | - id="Arrow2Lend-09" |
3765 | - style="overflow:visible"> |
3766 | - <path |
3767 | - inkscape:connector-curvature="0" |
3768 | - id="path3789-8" |
3769 | - style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" |
3770 | - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" |
3771 | - transform="matrix(-1.1,0,0,-1.1,-1.1,0)" /> |
3772 | - </marker> |
3773 | - <marker |
3774 | - inkscape:stockid="Arrow2Lend" |
3775 | - orient="auto" |
3776 | - refY="0" |
3777 | - refX="0" |
3778 | - id="Arrow2Lend-45" |
3779 | - style="overflow:visible"> |
3780 | - <path |
3781 | - inkscape:connector-curvature="0" |
3782 | - id="path3789-1" |
3783 | - style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" |
3784 | - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" |
3785 | - transform="matrix(-1.1,0,0,-1.1,-1.1,0)" /> |
3786 | - </marker> |
3787 | - <marker |
3788 | - inkscape:stockid="Arrow2Lend" |
3789 | - orient="auto" |
3790 | - refY="0" |
3791 | - refX="0" |
3792 | - id="Arrow2Lend-98" |
3793 | - style="overflow:visible"> |
3794 | - <path |
3795 | - inkscape:connector-curvature="0" |
3796 | - id="path3789-45" |
3797 | - style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" |
3798 | - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" |
3799 | - transform="matrix(-1.1,0,0,-1.1,-1.1,0)" /> |
3800 | - </marker> |
3801 | - <marker |
3802 | - inkscape:stockid="Arrow2Lend" |
3803 | - orient="auto" |
3804 | - refY="0" |
3805 | - refX="0" |
3806 | - id="Arrow2Lend-50" |
3807 | - style="overflow:visible"> |
3808 | - <path |
3809 | - inkscape:connector-curvature="0" |
3810 | - id="path3789-457" |
3811 | - style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" |
3812 | - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" |
3813 | - transform="matrix(-1.1,0,0,-1.1,-1.1,0)" /> |
3814 | - </marker> |
3815 | - <marker |
3816 | - inkscape:stockid="Arrow2Lend" |
3817 | - orient="auto" |
3818 | - refY="0" |
3819 | - refX="0" |
3820 | - id="Arrow2Lend-63" |
3821 | - style="overflow:visible"> |
3822 | - <path |
3823 | - inkscape:connector-curvature="0" |
3824 | - id="path3789-06" |
3825 | - style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" |
3826 | - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" |
3827 | - transform="matrix(-1.1,0,0,-1.1,-1.1,0)" /> |
3828 | - </marker> |
3829 | - </defs> |
3830 | - <sodipodi:namedview |
3831 | - id="base" |
3832 | - pagecolor="#ffffff" |
3833 | - bordercolor="#666666" |
3834 | - borderopacity="1.0" |
3835 | - inkscape:pageopacity="0.0" |
3836 | - inkscape:pageshadow="2" |
3837 | - inkscape:zoom="1.4" |
3838 | - inkscape:cx="370.94472" |
3839 | - inkscape:cy="350.46964" |
3840 | - inkscape:document-units="px" |
3841 | - inkscape:current-layer="layer1" |
3842 | - showgrid="true" |
3843 | - inkscape:window-width="1600" |
3844 | - inkscape:window-height="845" |
3845 | - inkscape:window-x="1920" |
3846 | - inkscape:window-y="542" |
3847 | - inkscape:window-maximized="1"> |
3848 | - <inkscape:grid |
3849 | - type="xygrid" |
3850 | - id="grid2985" |
3851 | - empspacing="5" |
3852 | - visible="true" |
3853 | - enabled="true" |
3854 | - snapvisiblegridlinesonly="true" /> |
3855 | - </sodipodi:namedview> |
3856 | - <metadata |
3857 | - id="metadata7"> |
3858 | - <rdf:RDF> |
3859 | - <cc:Work |
3860 | - rdf:about=""> |
3861 | - <dc:format>image/svg+xml</dc:format> |
3862 | - <dc:type |
3863 | - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> |
3864 | - <dc:title></dc:title> |
3865 | - </cc:Work> |
3866 | - </rdf:RDF> |
3867 | - </metadata> |
3868 | - <g |
3869 | - inkscape:label="Layer 1" |
3870 | - inkscape:groupmode="layer" |
3871 | - id="layer1"> |
3872 | - <rect |
3873 | - style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.09627009;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
3874 | - id="rect5533" |
3875 | - width="550.0965" |
3876 | - height="930" |
3877 | - x="39.950954" |
3878 | - y="42.362183" /> |
3879 | - <rect |
3880 | - style="color:#000000;fill:#e9e9f1;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.91287094;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
3881 | - id="rect2987" |
3882 | - width="180" |
3883 | - height="50" |
3884 | - x="110" |
3885 | - y="102.36217" /> |
3886 | - <text |
3887 | - xml:space="preserve" |
3888 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
3889 | - x="200" |
3890 | - y="122.36218" |
3891 | - id="text3757" |
3892 | - sodipodi:linespacing="125%"><tspan |
3893 | - sodipodi:role="line" |
3894 | - id="tspan3759" |
3895 | - x="200" |
3896 | - y="122.36218" |
3897 | - style="font-size:14px;text-align:center;text-anchor:middle">Wait for refresh due</tspan><tspan |
3898 | - sodipodi:role="line" |
3899 | - x="200" |
3900 | - y="139.86218" |
3901 | - id="tspan3761" |
3902 | - style="font-size:14px;text-align:center;text-anchor:middle">GetUpdates (typ. 1 day)</tspan></text> |
3903 | - <path |
3904 | - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow2Lend)" |
3905 | - d="m 200,152.36217 0,30" |
3906 | - id="path3763" |
3907 | - inkscape:connector-curvature="0" /> |
3908 | - <rect |
3909 | - style="color:#000000;fill:#e9e9f1;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.91287094;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
3910 | - id="rect2987-1" |
3911 | - width="180" |
3912 | - height="50" |
3913 | - x="110" |
3914 | - y="442.36218" /> |
3915 | - <text |
3916 | - xml:space="preserve" |
3917 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
3918 | - x="200" |
3919 | - y="470.36218" |
3920 | - id="text3757-1" |
3921 | - sodipodi:linespacing="125%"><tspan |
3922 | - sodipodi:role="line" |
3923 | - x="200" |
3924 | - y="470.36218" |
3925 | - id="tspan3761-5" |
3926 | - style="font-size:14px;text-align:center;text-anchor:middle">GetUpdates()</tspan></text> |
3927 | - <path |
3928 | - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow2Lend)" |
3929 | - d="m 200,492.36217 0,30" |
3930 | - id="path3763-7" |
3931 | - inkscape:connector-curvature="0" /> |
3932 | - <rect |
3933 | - style="color:#000000;fill:#e9e9f1;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.11863005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
3934 | - id="rect2987-4" |
3935 | - width="111.96233" |
3936 | - height="111.96233" |
3937 | - x="696.61267" |
3938 | - y="473.08511" |
3939 | - transform="matrix(0.89474433,0.44657876,-0.89474433,0.44657876,0,0)" /> |
3940 | - <text |
3941 | - xml:space="preserve" |
3942 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
3943 | - x="200" |
3944 | - y="568.36218" |
3945 | - id="text3757-12-7" |
3946 | - sodipodi:linespacing="125%"><tspan |
3947 | - sodipodi:role="line" |
3948 | - x="200" |
3949 | - y="568.36218" |
3950 | - id="tspan3761-8-2" |
3951 | - style="font-size:14px;text-align:center;text-anchor:middle">'Auto download'</tspan><tspan |
3952 | - sodipodi:role="line" |
3953 | - x="200" |
3954 | - y="585.86218" |
3955 | - style="font-size:14px;text-align:center;text-anchor:middle" |
3956 | - id="tspan4724">checkbox set?</tspan></text> |
3957 | - <text |
3958 | - xml:space="preserve" |
3959 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
3960 | - x="200" |
3961 | - y="612.36218" |
3962 | - id="text3757-12-0-5" |
3963 | - sodipodi:linespacing="125%"><tspan |
3964 | - sodipodi:role="line" |
3965 | - x="200" |
3966 | - y="612.36218" |
3967 | - id="tspan3761-8-25-7" |
3968 | - style="font-size:14px;text-align:center;text-anchor:middle">Y</tspan></text> |
3969 | - <text |
3970 | - xml:space="preserve" |
3971 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
3972 | - x="274" |
3973 | - y="576.36218" |
3974 | - id="text3757-12-0-8-7" |
3975 | - sodipodi:linespacing="125%"><tspan |
3976 | - sodipodi:role="line" |
3977 | - x="274" |
3978 | - y="576.36218" |
3979 | - id="tspan3761-8-25-8-3" |
3980 | - style="font-size:14px;text-align:center;text-anchor:middle">N</tspan></text> |
3981 | - <path |
3982 | - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow2Lend)" |
3983 | - d="m 200,622.36217 0,30" |
3984 | - id="path3763-2-7" |
3985 | - inkscape:connector-curvature="0" /> |
3986 | - <rect |
3987 | - style="color:#000000;fill:#e9e9f1;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.91287094;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
3988 | - id="rect2987-3" |
3989 | - width="180" |
3990 | - height="50" |
3991 | - x="110" |
3992 | - y="652.36218" /> |
3993 | - <text |
3994 | - xml:space="preserve" |
3995 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
3996 | - x="200" |
3997 | - y="672.36218" |
3998 | - id="text3757-2" |
3999 | - sodipodi:linespacing="125%"><tspan |
4000 | - sodipodi:role="line" |
4001 | - x="200" |
4002 | - y="672.36218" |
4003 | - id="tspan3761-7" |
4004 | - style="font-size:14px;text-align:center;text-anchor:middle">UpdatePackages</tspan><tspan |
4005 | - sodipodi:role="line" |
4006 | - x="200" |
4007 | - y="689.86218" |
4008 | - style="font-size:14px;text-align:center;text-anchor:middle" |
4009 | - id="tspan4862">(only-download)</tspan></text> |
4010 | - <path |
4011 | - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow2Lend)" |
4012 | - d="m 200,702.36217 0,30" |
4013 | - id="path3763-1" |
4014 | - inkscape:connector-curvature="0" /> |
4015 | - <rect |
4016 | - style="color:#000000;fill:#e9e9f1;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.11863005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
4017 | - id="rect2987-4-8" |
4018 | - width="111.96233" |
4019 | - height="111.96233" |
4020 | - x="931.73358" |
4021 | - y="708.20605" |
4022 | - transform="matrix(0.89474433,0.44657876,-0.89474433,0.44657876,0,0)" /> |
4023 | - <text |
4024 | - xml:space="preserve" |
4025 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
4026 | - x="200" |
4027 | - y="778.36218" |
4028 | - id="text3757-12-7-0" |
4029 | - sodipodi:linespacing="125%"><tspan |
4030 | - sodipodi:role="line" |
4031 | - x="200" |
4032 | - y="778.36218" |
4033 | - style="font-size:14px;text-align:center;text-anchor:middle" |
4034 | - id="tspan4724-3">Any security or</tspan><tspan |
4035 | - sodipodi:role="line" |
4036 | - x="200" |
4037 | - y="795.86218" |
4038 | - style="font-size:14px;text-align:center;text-anchor:middle" |
4039 | - id="tspan5002">critical updates?</tspan></text> |
4040 | - <text |
4041 | - xml:space="preserve" |
4042 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
4043 | - x="200" |
4044 | - y="822.36218" |
4045 | - id="text3757-12-0-5-9" |
4046 | - sodipodi:linespacing="125%"><tspan |
4047 | - sodipodi:role="line" |
4048 | - x="200" |
4049 | - y="822.36218" |
4050 | - id="tspan3761-8-25-7-2" |
4051 | - style="font-size:14px;text-align:center;text-anchor:middle">Y</tspan></text> |
4052 | - <text |
4053 | - xml:space="preserve" |
4054 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
4055 | - x="274" |
4056 | - y="786.36218" |
4057 | - id="text3757-12-0-8-7-2" |
4058 | - sodipodi:linespacing="125%"><tspan |
4059 | - sodipodi:role="line" |
4060 | - x="274" |
4061 | - y="786.36218" |
4062 | - id="tspan3761-8-25-8-3-2" |
4063 | - style="font-size:14px;text-align:center;text-anchor:middle">N</tspan></text> |
4064 | - <path |
4065 | - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow2Lend)" |
4066 | - d="m 200,832.36216 0,30" |
4067 | - id="path3763-2-7-9" |
4068 | - inkscape:connector-curvature="0" /> |
4069 | - <path |
4070 | - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow2Lend)" |
4071 | - d="m 300,572.36217 20,0 0,140 -120,0" |
4072 | - id="path3763-2-4" |
4073 | - inkscape:connector-curvature="0" |
4074 | - sodipodi:nodetypes="cccc" /> |
4075 | - <path |
4076 | - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow2Lend)" |
4077 | - d="m 430,832.36217 0,30" |
4078 | - id="path3763-2-5" |
4079 | - inkscape:connector-curvature="0" /> |
4080 | - <rect |
4081 | - style="color:#000000;fill:#e9e9f1;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.11863005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
4082 | - id="rect2987-4-9-5" |
4083 | - width="111.96233" |
4084 | - height="111.96233" |
4085 | - x="1060.2618" |
4086 | - y="579.67767" |
4087 | - transform="matrix(0.89474433,0.44657876,-0.89474433,0.44657876,0,0)" /> |
4088 | - <text |
4089 | - xml:space="preserve" |
4090 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
4091 | - x="430" |
4092 | - y="822.36218" |
4093 | - id="text3757-12-0-2" |
4094 | - sodipodi:linespacing="125%"><tspan |
4095 | - sodipodi:role="line" |
4096 | - x="430" |
4097 | - y="822.36218" |
4098 | - id="tspan3761-8-25-4" |
4099 | - style="font-size:14px;text-align:center;text-anchor:middle">Y</tspan></text> |
4100 | - <text |
4101 | - xml:space="preserve" |
4102 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
4103 | - x="504" |
4104 | - y="786.36218" |
4105 | - id="text3757-12-0-8-8" |
4106 | - sodipodi:linespacing="125%"><tspan |
4107 | - sodipodi:role="line" |
4108 | - x="504" |
4109 | - y="786.36218" |
4110 | - id="tspan3761-8-25-8-34" |
4111 | - style="font-size:14px;text-align:center;text-anchor:middle">N</tspan></text> |
4112 | - <path |
4113 | - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow2Lend)" |
4114 | - d="m 300,782.36217 30,0" |
4115 | - id="path3763-2-5-8" |
4116 | - inkscape:connector-curvature="0" |
4117 | - sodipodi:nodetypes="cc" /> |
4118 | - <text |
4119 | - xml:space="preserve" |
4120 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
4121 | - x="430" |
4122 | - y="778.36218" |
4123 | - id="text3757-12-7-0-7" |
4124 | - sodipodi:linespacing="125%"><tspan |
4125 | - sodipodi:role="line" |
4126 | - x="430" |
4127 | - y="778.36218" |
4128 | - style="font-size:14px;text-align:center;text-anchor:middle" |
4129 | - id="tspan5117">> notify threshold?</tspan><tspan |
4130 | - sodipodi:role="line" |
4131 | - x="430" |
4132 | - y="795.86218" |
4133 | - style="font-size:14px;text-align:center;text-anchor:middle" |
4134 | - id="tspan5512">typ. 1 week</tspan></text> |
4135 | - <path |
4136 | - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow2Lend)" |
4137 | - d="m 200,412.36218 0,30" |
4138 | - id="path3763-2-3" |
4139 | - inkscape:connector-curvature="0" /> |
4140 | - <rect |
4141 | - style="color:#000000;fill:#e9e9f1;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.11863005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
4142 | - id="rect2987-4-9-50" |
4143 | - width="111.96233" |
4144 | - height="111.96233" |
4145 | - x="461.49176" |
4146 | - y="237.9642" |
4147 | - transform="matrix(0.89474433,0.44657876,-0.89474433,0.44657876,0,0)" /> |
4148 | - <text |
4149 | - xml:space="preserve" |
4150 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
4151 | - x="200" |
4152 | - y="402.36218" |
4153 | - id="text3757-12-0-4" |
4154 | - sodipodi:linespacing="125%"><tspan |
4155 | - sodipodi:role="line" |
4156 | - x="200" |
4157 | - y="402.36218" |
4158 | - id="tspan3761-8-25-6" |
4159 | - style="font-size:14px;text-align:center;text-anchor:middle">Y</tspan></text> |
4160 | - <text |
4161 | - xml:space="preserve" |
4162 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
4163 | - x="274" |
4164 | - y="366.36218" |
4165 | - id="text3757-12-0-8-1" |
4166 | - sodipodi:linespacing="125%"><tspan |
4167 | - sodipodi:role="line" |
4168 | - x="274" |
4169 | - y="366.36218" |
4170 | - id="tspan3761-8-25-8-8" |
4171 | - style="font-size:14px;text-align:center;text-anchor:middle">N</tspan></text> |
4172 | - <text |
4173 | - xml:space="preserve" |
4174 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
4175 | - x="200" |
4176 | - y="358.36218" |
4177 | - id="text3757-12-7-9-0" |
4178 | - sodipodi:linespacing="125%"><tspan |
4179 | - sodipodi:role="line" |
4180 | - x="200" |
4181 | - y="358.36218" |
4182 | - style="font-size:14px;text-align:center;text-anchor:middle" |
4183 | - id="tspan5187-6">'Use Mobile'</tspan><tspan |
4184 | - sodipodi:role="line" |
4185 | - x="200" |
4186 | - y="375.86218" |
4187 | - style="font-size:14px;text-align:center;text-anchor:middle" |
4188 | - id="tspan5360">checkbox set?</tspan></text> |
4189 | - <path |
4190 | - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow2Lend)" |
4191 | - d="m 200,282.36217 0,29.99999" |
4192 | - id="path3763-2-70" |
4193 | - inkscape:connector-curvature="0" /> |
4194 | - <rect |
4195 | - style="color:#000000;fill:#e9e9f1;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.11863005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
4196 | - id="rect2987-4-9-2" |
4197 | - width="111.96233" |
4198 | - height="111.96233" |
4199 | - x="315.9407" |
4200 | - y="92.413185" |
4201 | - transform="matrix(0.89474433,0.44657876,-0.89474433,0.44657876,0,0)" /> |
4202 | - <text |
4203 | - xml:space="preserve" |
4204 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
4205 | - x="200" |
4206 | - y="272.36218" |
4207 | - id="text3757-12-0-7" |
4208 | - sodipodi:linespacing="125%"><tspan |
4209 | - sodipodi:role="line" |
4210 | - x="200" |
4211 | - y="272.36218" |
4212 | - id="tspan3761-8-25-3" |
4213 | - style="font-size:14px;text-align:center;text-anchor:middle">Y</tspan></text> |
4214 | - <text |
4215 | - xml:space="preserve" |
4216 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
4217 | - x="126" |
4218 | - y="236.36218" |
4219 | - id="text3757-12-0-8-0" |
4220 | - sodipodi:linespacing="125%"><tspan |
4221 | - sodipodi:role="line" |
4222 | - x="126" |
4223 | - y="236.36218" |
4224 | - id="tspan3761-8-25-8-7" |
4225 | - style="font-size:14px;text-align:center;text-anchor:middle">N</tspan></text> |
4226 | - <text |
4227 | - xml:space="preserve" |
4228 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
4229 | - x="200" |
4230 | - y="228.36217" |
4231 | - id="text3757-12-7-9-9" |
4232 | - sodipodi:linespacing="125%"><tspan |
4233 | - sodipodi:role="line" |
4234 | - x="200" |
4235 | - y="228.36217" |
4236 | - style="font-size:14px;text-align:center;text-anchor:middle" |
4237 | - id="tspan5187-0">On GPRS or</tspan><tspan |
4238 | - sodipodi:role="line" |
4239 | - x="200" |
4240 | - y="245.86217" |
4241 | - style="font-size:14px;text-align:center;text-anchor:middle" |
4242 | - id="tspan5356">CDMA?</tspan></text> |
4243 | - <path |
4244 | - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow2Lend)" |
4245 | - d="m 100,232.36218 -30,0 0,189.99999 130,0" |
4246 | - id="path3763-2-8" |
4247 | - inkscape:connector-curvature="0" |
4248 | - sodipodi:nodetypes="cccc" /> |
4249 | - <path |
4250 | - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow2Lend)" |
4251 | - d="m 200,912.36217 0,30 360,0 0,-869.999998 -360,0 0,29.999998" |
4252 | - id="path3763-2-54" |
4253 | - inkscape:connector-curvature="0" |
4254 | - sodipodi:nodetypes="cccccc" /> |
4255 | - <path |
4256 | - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow2Lend)" |
4257 | - d="m 300,362.36218 260,0" |
4258 | - id="path3763-2-70-1" |
4259 | - inkscape:connector-curvature="0" |
4260 | - sodipodi:nodetypes="cc" /> |
4261 | - <rect |
4262 | - style="color:#000000;fill:#e9e9f1;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.91287094;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
4263 | - id="rect2987-3-6" |
4264 | - width="180" |
4265 | - height="50" |
4266 | - x="110" |
4267 | - y="862.36218" /> |
4268 | - <text |
4269 | - xml:space="preserve" |
4270 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
4271 | - x="200" |
4272 | - y="882.36218" |
4273 | - id="text3757-2-6" |
4274 | - sodipodi:linespacing="125%"><tspan |
4275 | - sodipodi:role="line" |
4276 | - x="200" |
4277 | - y="882.36218" |
4278 | - style="font-size:14px;text-align:center;text-anchor:middle" |
4279 | - id="tspan4862-3">Notify the user about</tspan><tspan |
4280 | - sodipodi:role="line" |
4281 | - x="200" |
4282 | - y="899.86218" |
4283 | - style="font-size:14px;text-align:center;text-anchor:middle" |
4284 | - id="tspan5472">important updates</tspan></text> |
4285 | - <path |
4286 | - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow2Lend)" |
4287 | - d="m 530,782.36217 30,0" |
4288 | - id="path3763-1-6" |
4289 | - inkscape:connector-curvature="0" |
4290 | - sodipodi:nodetypes="cc" /> |
4291 | - <rect |
4292 | - style="color:#000000;fill:#e9e9f1;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.91287094;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
4293 | - id="rect2987-3-6-0" |
4294 | - width="180" |
4295 | - height="50" |
4296 | - x="340" |
4297 | - y="862.36218" /> |
4298 | - <text |
4299 | - xml:space="preserve" |
4300 | - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" |
4301 | - x="430" |
4302 | - y="882.36218" |
4303 | - id="text3757-2-6-5" |
4304 | - sodipodi:linespacing="125%"><tspan |
4305 | - sodipodi:role="line" |
4306 | - x="430" |
4307 | - y="882.36218" |
4308 | - style="font-size:14px;text-align:center;text-anchor:middle" |
4309 | - id="tspan4862-3-5">Notify the user about</tspan><tspan |
4310 | - sodipodi:role="line" |
4311 | - x="430" |
4312 | - y="899.86218" |
4313 | - style="font-size:14px;text-align:center;text-anchor:middle" |
4314 | - id="tspan5472-3">regular updates</tspan></text> |
4315 | - <path |
4316 | - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow2Lend)" |
4317 | - d="m 430,912.36217 0,30" |
4318 | - id="path3763-1-6-0" |
4319 | - inkscape:connector-curvature="0" /> |
4320 | - </g> |
4321 | -</svg> |
4322 | |
4323 | === removed file 'plugins/updates/updates.gnome-settings-plugin.in' |
4324 | --- plugins/updates/updates.gnome-settings-plugin.in 2013-02-20 23:32:45 +0000 |
4325 | +++ plugins/updates/updates.gnome-settings-plugin.in 1970-01-01 00:00:00 +0000 |
4326 | @@ -1,9 +0,0 @@ |
4327 | -[GNOME Settings Plugin] |
4328 | -Module=updates |
4329 | -IAge=0 |
4330 | -Priority=300 |
4331 | -_Name=Updates |
4332 | -_Description=Updates plugin |
4333 | -Authors=Richard Hughes |
4334 | -Copyright=Copyright © 2011 |
4335 | -Website= |
4336 | |
4337 | === modified file 'po/POTFILES.in' |
4338 | --- po/POTFILES.in 2016-05-15 01:00:17 +0000 |
4339 | +++ po/POTFILES.in 2017-03-22 16:14:50 +0000 |
4340 | @@ -39,9 +39,6 @@ |
4341 | plugins/smartcard/gsd-smartcard-manager.c |
4342 | [type: gettext/ini]plugins/smartcard/smartcard.gnome-settings-plugin.in |
4343 | [type: gettext/ini]plugins/sound/sound.gnome-settings-plugin.in |
4344 | -plugins/updates/gsd-updates-firmware.c |
4345 | -plugins/updates/gsd-updates-manager.c |
4346 | -[type: gettext/ini]plugins/updates/updates.gnome-settings-plugin.in |
4347 | plugins/wacom/gsd-wacom-device.c |
4348 | plugins/wacom/gsd-wacom-osd-window.c |
4349 | plugins/wacom/com.ubuntu.unity-settings-daemon.plugins.wacom.policy.in.in |
You should update debian/rules to remove the --disable- packagekit now the code is gone.