209
217
if (stat (REBOOT_FILE, &statbuf)) {
210
218
NotifyNotification *n;
212
gtk_status_icon_set_visible (ta->tray_icon, FALSE);
220
tray_applet_ui_set_visible (ta, FALSE);
213
221
/* Hide any notification popup */
214
n = g_object_get_data (G_OBJECT(ta->tray_icon), "notification");
222
n = tray_applet_ui_get_data (ta, "notification");
216
224
notify_notification_close (n, NULL);
217
g_object_set_data (G_OBJECT(ta->tray_icon), "notification", NULL);
225
tray_applet_ui_set_data (ta, "notification", NULL);
222
230
/* Skip the rest if the icon is already visible */
223
if (gtk_status_icon_get_visible (ta->tray_icon))
231
if (tray_applet_ui_get_visible (ta))
225
gtk_status_icon_set_tooltip_text (ta->tray_icon,
226
_("System restart required"));
227
gtk_status_icon_set_visible (ta->tray_icon, TRUE);
233
tray_applet_ui_set_visible (ta, TRUE);
229
236
/* Check whether the user doesn't like notifications */
230
237
if (g_settings_get_boolean ((GSettings*) ta->user_data,
268
266
g_warning ("Couldn't load builder file: %s", error->message);
269
267
g_error_free (error);
269
ta->user_data = g_settings_new(SETTINGS_SCHEMA);
272
271
widget = GTK_WIDGET (gtk_builder_get_object (builder, "image"));
273
GtkIconTheme* icon_theme = gtk_icon_theme_get_default();
274
GdkPixbuf *pixbuf = gtk_icon_theme_load_icon (icon_theme, "un-reboot",
276
gtk_status_icon_set_from_pixbuf (ta->tray_icon, pixbuf);
277
ta->user_data = g_settings_new(SETTINGS_SCHEMA);
279
g_signal_connect (G_OBJECT(ta->tray_icon),
281
G_CALLBACK (button_release_cb),
284
gtk_image_set_from_pixbuf(GTK_IMAGE(widget), pixbuf);
272
gtk_image_set_from_icon_name(GTK_IMAGE(widget), "un-reboot", GTK_ICON_SIZE_DIALOG);
274
tray_applet_ui_set_icon(ta, "un-reboot");
275
tray_applet_ui_set_single_action(ta,
276
_("System restart required"),
277
G_CALLBACK (button_release_cb),
286
280
/* Check for updates for the first time */
287
281
reboot_check (ta);