aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2012-02-08 17:30:50 +0000
committerConor Curran <conor.curran@canonical.com>2012-02-08 17:30:50 +0000
commit3b8d13f352d76bae85dcff763af583927fdaaad7 (patch)
tree42e684a9682fbe900684e22e059b713c3406ba30
parent4145c29279197d5985d348fbe2ef219a4c015a11 (diff)
parent6975e8a7aab320c77f3cb3de345415b9f26ba5cd (diff)
downloadayatana-indicator-session-3b8d13f352d76bae85dcff763af583927fdaaad7.tar.gz
ayatana-indicator-session-3b8d13f352d76bae85dcff763af583927fdaaad7.tar.bz2
ayatana-indicator-session-3b8d13f352d76bae85dcff763af583927fdaaad7.zip
properly fix conflict and make sure to not check for updates 1 minute after starting the service or Pitti will kill me :)
-rw-r--r--configure.ac8
-rw-r--r--src/apt-watcher.c2
-rw-r--r--src/device-menu-mgr.c26
-rw-r--r--src/indicator-session.c4
-rw-r--r--src/lock-helper.c86
-rw-r--r--src/lock-helper.h3
-rw-r--r--src/user-menu-mgr.c35
7 files changed, 12 insertions, 152 deletions
diff --git a/configure.ac b/configure.ac
index 52a54b9..7fa6b48 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@ AC_INIT(src/indicator-session.c)
AC_PREREQ(2.53)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(indicator-session, 0.3.7.1)
+AM_INIT_AUTOMAKE(indicator-session, 0.3.90)
AM_MAINTAINER_MODE
@@ -51,6 +51,7 @@ AS_IF([test "x$with_gtk" = x3],
],
[AC_MSG_FAILURE([Value for --with-indicator-gtk was neither 2 nor 3])]
)
+
AC_SUBST(APPLET_CFLAGS)
AC_SUBST(APPLET_LIBS)
@@ -79,6 +80,11 @@ AS_IF([test "x$with_gtk" = x3],
AC_SUBST(SESSIONERVICE_CFLAGS)
AC_SUBST(SESSIONERVICE_LIBS)
+AM_CONDITIONAL([USE_GTK3], [test "x$with_gtk" = "x3"])
+AS_IF([test "x$with_gtk" = x3], [
+ AC_DEFINE(HAVE_GTK3, 1, [whether gtk3 is available])
+ ])
+
###########################
# GTK Logout Helper
###########################
diff --git a/src/apt-watcher.c b/src/apt-watcher.c
index cab2d8b..4e69ee6 100644
--- a/src/apt-watcher.c
+++ b/src/apt-watcher.c
@@ -250,7 +250,7 @@ static void
apt_watcher_init (AptWatcher *self)
{
self->current_state = UP_TO_DATE;
- g_timeout_add_seconds (1,
+ g_timeout_add_seconds (60,
apt_watcher_start_apt_interaction,
self);
}
diff --git a/src/device-menu-mgr.c b/src/device-menu-mgr.c
index 6ce5962..f8f0696 100644
--- a/src/device-menu-mgr.c
+++ b/src/device-menu-mgr.c
@@ -82,7 +82,6 @@ static DBusGProxy * up_prop_proxy = NULL;
static void device_menu_mgr_ensure_settings_client (DeviceMenuMgr* self);
static void setup_up (DeviceMenuMgr* self);
static void device_menu_mgr_rebuild_items (DeviceMenuMgr *self);
-static void lock_if_possible (DeviceMenuMgr* self);
static void machine_sleep_with_context (DeviceMenuMgr* self,
gchar* type);
static void show_system_settings_with_context (DbusmenuMenuitem * mi,
@@ -172,27 +171,6 @@ keybinding_changed (GSettings *settings,
return;
}
-/* Check to see if the lockdown key is protecting from
- locking the screen. If not, lock it. */
-static void
-lock_if_possible (DeviceMenuMgr* self) {
- device_menu_mgr_ensure_settings_client (self);
-
- if (!g_settings_get_boolean (lockdown_settings, LOCKDOWN_KEY_SCREENSAVER)) {
- lock_screen (NULL, 0, NULL);
- }
- return;
-}
-
-/* A return from the command to sleep the system. Make sure
- that we unthrottle the screensaver. */
-static void
-sleep_response (DBusGProxy * proxy, DBusGProxyCall * call, gpointer data)
-{
- screensaver_unthrottle();
- return;
-}
-
static void
machine_sleep_from_suspend (DbusmenuMenuitem * mi,
guint timestamp,
@@ -220,11 +198,9 @@ machine_sleep_with_context (DeviceMenuMgr* self, gchar* type)
g_warning("Can not %s as no upower proxy", type);
}
- screensaver_throttle(type);
- lock_if_possible (self);
dbus_g_proxy_begin_call(up_main_proxy,
type,
- sleep_response,
+ NULL,
NULL,
NULL,
G_TYPE_INVALID);
diff --git a/src/indicator-session.c b/src/indicator-session.c
index bd7bcd3..e748825 100644
--- a/src/indicator-session.c
+++ b/src/indicator-session.c
@@ -276,10 +276,10 @@ indicator_session_get_location (IndicatorObject * io,
{
IndicatorSession * self = INDICATOR_SESSION (io);
if (entry == &self->users){
- return 1;
+ return 0;
}
else if (entry == &self->devices){
- return 0;
+ return 1;
}
g_warning ("IOEntry handed to us to position but we don't own it!");
return 0;
diff --git a/src/lock-helper.c b/src/lock-helper.c
index 4c91aa5..8eae674 100644
--- a/src/lock-helper.c
+++ b/src/lock-helper.c
@@ -29,8 +29,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
static DBusGProxy * gss_proxy = NULL;
static GMainLoop * gss_mainloop = NULL;
-static guint cookie = 0;
-static DBusGProxyCall * cookie_call = NULL;
static gboolean is_guest = FALSE;
@@ -38,90 +36,6 @@ static GSettings * settings = NULL;
void build_gss_proxy (void);
-/* Checks to see if there is an error and reports
- it. Not much else we can do. */
-static void
-unthrottle_return (DBusGProxy * proxy, DBusGProxyCall * call, gpointer data)
-{
- GError * error = NULL;
- dbus_g_proxy_end_call(proxy, call, &error,
- G_TYPE_INVALID);
-
- if (error != NULL) {
- g_warning("Unable to unthrottle: %s", error->message);
- }
- return;
-}
-
-/* Sends an unthrottle if we're throttled. */
-void
-screensaver_unthrottle (void)
-{
- g_return_if_fail(cookie != 0);
-
- build_gss_proxy();
- g_return_if_fail(gss_proxy != NULL);
-
- dbus_g_proxy_begin_call(gss_proxy, "UnThrottle",
- unthrottle_return, NULL,
- NULL,
- G_TYPE_UINT, cookie,
- G_TYPE_INVALID);
-
- cookie = 0;
- return;
-}
-
-/* Gets there return cookie from the throttle command
- and sets things valid */
-static void
-throttle_return (DBusGProxy * proxy, DBusGProxyCall * call, gpointer data)
-{
- GError * error = NULL;
- cookie_call = NULL;
-
- dbus_g_proxy_end_call(proxy, call, &error,
- G_TYPE_UINT, &cookie,
- G_TYPE_INVALID);
-
- if (error != NULL) {
- g_warning("Unable to throttle the screensaver: %s", error->message);
- return;
- }
-
-
- if (cookie == 0) {
- g_warning("We didn't get a throttle cookie!");
- }
-
- return;
-}
-
-/* Throttling the screensaver by using the screen saver
- command. */
-void
-screensaver_throttle (gchar * reason)
-{
- g_return_if_fail(cookie_call == NULL);
- g_return_if_fail(will_lock_screen());
-
- if (cookie != 0) {
- screensaver_unthrottle();
- }
-
- build_gss_proxy();
- g_return_if_fail(gss_proxy != NULL);
-
- cookie_call = dbus_g_proxy_begin_call(gss_proxy, "Throttle",
- throttle_return, NULL,
- NULL,
- G_TYPE_STRING, "Session Menu",
- G_TYPE_STRING, reason,
- G_TYPE_INVALID);
-
- return;
-}
-
/* This is our logic on whether the screen should be locked
or not. It effects everything else. */
gboolean
diff --git a/src/lock-helper.h b/src/lock-helper.h
index 37f1448..e2d5106 100644
--- a/src/lock-helper.h
+++ b/src/lock-helper.h
@@ -24,9 +24,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <libdbusmenu-glib/menuitem.h>
-void screensaver_throttle (gchar * reason);
-void screensaver_unthrottle (void);
-
gboolean will_lock_screen (void);
void lock_screen (DbusmenuMenuitem * mi, guint timestamp, gpointer data);
gboolean lock_screen_setup (gpointer data);
diff --git a/src/user-menu-mgr.c b/src/user-menu-mgr.c
index 54e718f..3f4bdc4 100644
--- a/src/user-menu-mgr.c
+++ b/src/user-menu-mgr.c
@@ -48,9 +48,6 @@ static void activate_user_accounts (DbusmenuMenuitem *mi,
gpointer user_data);
static gint compare_users_by_username (const gchar *a,
const gchar *b);
-static void activate_online_accounts (DbusmenuMenuitem *mi,
- guint timestamp,
- gpointer user_data);
static void activate_user_accounts (DbusmenuMenuitem *mi,
guint timestamp,
gpointer user_data);
@@ -255,26 +252,12 @@ user_menu_mgr_rebuild_items (UserMenuMgr *self, gboolean greeter_mode)
}
g_list_free(users);
}
- // Add the online accounts and separator
+ // Add the user accounts and separator
DbusmenuMenuitem * separator1 = dbusmenu_menuitem_new();
dbusmenu_menuitem_property_set (separator1,
DBUSMENU_MENUITEM_PROP_TYPE,
DBUSMENU_CLIENT_TYPES_SEPARATOR);
dbusmenu_menuitem_child_append (self->root_item, separator1);
- DbusmenuMenuitem * online_accounts_item = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set (online_accounts_item,
- DBUSMENU_MENUITEM_PROP_TYPE,
- DBUSMENU_CLIENT_TYPES_DEFAULT);
- dbusmenu_menuitem_property_set (online_accounts_item,
- DBUSMENU_MENUITEM_PROP_LABEL,
- _("Online Accounts…"));
-
- g_signal_connect (G_OBJECT (online_accounts_item),
- DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
- G_CALLBACK (activate_online_accounts),
- NULL);
-
- dbusmenu_menuitem_child_append (self->root_item, online_accounts_item);
DbusmenuMenuitem * user_accounts_item = dbusmenu_menuitem_new();
dbusmenu_menuitem_property_set (user_accounts_item,
@@ -359,22 +342,6 @@ compare_users_by_username (const gchar *a,
return retval;
}
-// TODO
-// Wait until dialog is complete to find out name to pass
-// to the control centre.
-static void
-activate_online_accounts (DbusmenuMenuitem *mi,
- guint timestamp,
- gpointer user_data)
-{
- GError * error = NULL;
- if (!g_spawn_command_line_async("gnome-control-center online-accounts", &error))
- {
- g_warning("Unable to show control centre: %s", error->message);
- g_error_free(error);
- }
-}
-
static void
activate_user_accounts (DbusmenuMenuitem *mi,
guint timestamp,