aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-09-27 14:51:51 -0500
committerTed Gould <ted@gould.cx>2011-09-27 14:51:51 -0500
commit22c09b74f5fdc3958d38c9fcf2c91d67c14fa6c2 (patch)
treedfe81f50de34e5e89e8459e094be61a558a021db /src
parent28b8bddfe57af6ee09d5be32fc413fb5c3e7121b (diff)
parent99d0f953bfd72de8ad83c5e9a898897dcd17f268 (diff)
downloadayatana-indicator-session-22c09b74f5fdc3958d38c9fcf2c91d67c14fa6c2.tar.gz
ayatana-indicator-session-22c09b74f5fdc3958d38c9fcf2c91d67c14fa6c2.tar.bz2
ayatana-indicator-session-22c09b74f5fdc3958d38c9fcf2c91d67c14fa6c2.zip
Updating to trunk
Diffstat (limited to 'src')
-rw-r--r--src/apt-watcher.c17
-rw-r--r--src/gtk-logout-helper.c4
-rw-r--r--src/indicator-session.c4
-rw-r--r--src/users-service-dbus.c36
4 files changed, 19 insertions, 42 deletions
diff --git a/src/apt-watcher.c b/src/apt-watcher.c
index 2c5ed0b..d8bb7e2 100644
--- a/src/apt-watcher.c
+++ b/src/apt-watcher.c
@@ -177,8 +177,6 @@ apt_watcher_on_name_appeared (GDBusConnection *connection,
"the system bus",
name_owner);
- apt_watcher_query_reboot_status (user_data);
-
g_dbus_proxy_call (watcher->proxy,
"UpgradeSystem",
g_variant_new("(b)", TRUE),
@@ -299,6 +297,15 @@ apt_watcher_transaction_state_real_update_cb (AptTransaction* trans,
if (self->current_state != UPGRADE_IN_PROGRESS){
query_again = TRUE;
}
+ else{
+ if (self->reboot_query != 0){
+ g_source_remove (self->reboot_query);
+ self->reboot_query = 0;
+ }
+ self->reboot_query = g_timeout_add_seconds (1,
+ apt_watcher_query_reboot_status,
+ self);
+ }
self->current_state = state;
g_object_unref (G_OBJECT(self->current_transaction));
@@ -383,7 +390,7 @@ apt_watcher_query_reboot_status (gpointer data)
GVariant* reboot_result = g_dbus_proxy_get_cached_property (self->proxy,
"RebootRequired");
- gboolean reboot;
+ gboolean reboot = FALSE;
g_variant_get (reboot_result, "b", &reboot);
g_debug ("apt_watcher_query_reboot_status: reboot prop = %i", reboot);
if (reboot == FALSE){
@@ -398,7 +405,7 @@ apt_watcher_query_reboot_status (gpointer data)
else{
dbusmenu_menuitem_property_set (self->apt_item,
DBUSMENU_MENUITEM_PROP_LABEL,
- _("Restart to complete updates…"));
+ _("Restart to Complete Updates…"));
dbusmenu_menuitem_property_set (self->apt_item,
DBUSMENU_MENUITEM_PROP_DISPOSITION,
DBUSMENU_MENUITEM_DISPOSITION_ALERT);
@@ -461,7 +468,7 @@ static void apt_watcher_signal_cb ( GDBusProxy* proxy,
if (reboot_required){
dbusmenu_menuitem_property_set (self->apt_item,
DBUSMENU_MENUITEM_PROP_LABEL,
- _("Restart to complete updates…"));
+ _("Restart to Complete Updates…"));
dbusmenu_menuitem_property_set (self->apt_item,
DBUSMENU_MENUITEM_PROP_DISPOSITION,
DBUSMENU_MENUITEM_DISPOSITION_ALERT);
diff --git a/src/gtk-logout-helper.c b/src/gtk-logout-helper.c
index 9c1e6dd..1975121 100644
--- a/src/gtk-logout-helper.c
+++ b/src/gtk-logout-helper.c
@@ -55,6 +55,7 @@ consolekit_fallback (LogoutDialogType action)
dbus_g_proxy_call(proxy,
"Stop",
&error,
+ G_TYPE_INVALID,
G_TYPE_INVALID);
break;
case LOGOUT_DIALOG_TYPE_RESTART:
@@ -62,6 +63,7 @@ consolekit_fallback (LogoutDialogType action)
dbus_g_proxy_call(proxy,
"Restart",
&error,
+ G_TYPE_INVALID,
G_TYPE_INVALID);
break;
default:
@@ -72,7 +74,7 @@ consolekit_fallback (LogoutDialogType action)
g_object_unref(proxy);
if (error != NULL) {
- g_error("Unable to signal ConsoleKit");
+ g_warning("Unable to signal ConsoleKit");
g_error_free(error);
}
diff --git a/src/indicator-session.c b/src/indicator-session.c
index 833d19b..9510807 100644
--- a/src/indicator-session.c
+++ b/src/indicator-session.c
@@ -509,11 +509,11 @@ receive_signal (GDBusProxy * proxy,
}
else if (g_strcmp0(signal_name, "RestartRequired") == 0) {
if (greeter_mode == TRUE){
- self->devices.image = indicator_image_helper (GREETER_ICON_RESTART);
+ indicator_image_helper_update(self->devices.image, GREETER_ICON_RESTART);
}
else{
g_debug ("reboot required");
- self->devices.image = indicator_image_helper (ICON_RESTART);
+ indicator_image_helper_update(self->devices.image, ICON_RESTART);
}
}
}
diff --git a/src/users-service-dbus.c b/src/users-service-dbus.c
index 0bab8c8..971b854 100644
--- a/src/users-service-dbus.c
+++ b/src/users-service-dbus.c
@@ -203,40 +203,10 @@ static void
create_display_manager_proxy (UsersServiceDbus *self)
{
UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);
- DBusGProxy *dm_proxy = NULL;
GError *error = NULL;
- const gchar *cookie = NULL;
- gchar *seat = NULL;
+ const gchar *seat = NULL;
- cookie = g_getenv ("XDG_SESSION_COOKIE");
- if (cookie == NULL || cookie[0] == 0)
- {
- g_warning ("Failed to get DisplayManager proxy: XDG_SESSION_COOKIE undefined.");
- return;
- }
-
- dm_proxy = dbus_g_proxy_new_for_name (priv->system_bus,
- "org.freedesktop.DisplayManager",
- "/org/freedesktop/DisplayManager",
- "org.freedesktop.DisplayManager");
-
- if (!dm_proxy)
- {
- g_warning ("Failed to get DisplayManager proxy.");
- return;
- }
-
- /* Now request the proper seat */
- if (!dbus_g_proxy_call (dm_proxy, "GetSeatForCookie", &error,
- G_TYPE_STRING, cookie, G_TYPE_INVALID,
- DBUS_TYPE_G_OBJECT_PATH, &seat, G_TYPE_INVALID))
- {
- g_warning ("Failed to get DisplayManager seat proxy: %s", error->message);
- g_object_unref (dm_proxy);
- g_error_free (error);
- return;
- }
- g_object_unref (dm_proxy);
+ seat = g_getenv ("XDG_SEAT_PATH");
g_debug ("CREATING DM PROXIES WITH %s", seat);
priv->display_manager_proxy = dbus_g_proxy_new_for_name (priv->system_bus,
"org.freedesktop.DisplayManager",
@@ -249,8 +219,6 @@ create_display_manager_proxy (UsersServiceDbus *self)
"org.freedesktop.DBus.Properties");
- g_free (seat);
-
if (!priv->display_manager_proxy)
{
g_warning ("Failed to get DisplayManager seat proxy.");