diff options
-rw-r--r-- | configure.ac | 8 | ||||
-rw-r--r-- | src/apt-watcher.h | 4 | ||||
-rw-r--r-- | src/device-menu-mgr.c | 1 | ||||
-rw-r--r-- | src/indicator-session.c | 8 | ||||
-rw-r--r-- | src/session-service.c | 4 | ||||
-rw-r--r-- | src/udev-mgr.h | 4 | ||||
-rw-r--r-- | src/user-menu-mgr.c | 35 | ||||
-rw-r--r-- | src/user-menu-mgr.h | 2 | ||||
-rw-r--r-- | src/user-widget.c | 4 | ||||
-rw-r--r-- | src/user-widget.h | 4 |
10 files changed, 15 insertions, 59 deletions
diff --git a/configure.ac b/configure.ac index d47d754..a34450c 100644 --- a/configure.ac +++ b/configure.ac @@ -30,7 +30,7 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) GTK_REQUIRED_VERSION=2.12 GTK3_REQUIRED_VERSION=3.0 INDICATOR_REQUIRED_VERSION=0.3.19 -DBUSMENUGTK_REQUIRED_VERSION=0.4.92 +DBUSMENUGTK_REQUIRED_VERSION=0.5.90 POLKIT_REQUIRED_VERSION=0.92 AC_ARG_WITH([gtk], @@ -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) @@ -77,6 +78,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.h b/src/apt-watcher.h index 7b98a44..6b7d5e1 100644 --- a/src/apt-watcher.h +++ b/src/apt-watcher.h @@ -25,11 +25,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <libdbusmenu-glib/client.h> #include <gtk/gtk.h> -#if GTK_CHECK_VERSION(3, 0, 0) -#include <libdbusmenu-gtk3/menuitem.h> -#else #include <libdbusmenu-gtk/menuitem.h> -#endif #include "session-dbus.h" diff --git a/src/device-menu-mgr.c b/src/device-menu-mgr.c index d3734a2..f8f0696 100644 --- a/src/device-menu-mgr.c +++ b/src/device-menu-mgr.c @@ -19,7 +19,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <config.h> #include <libdbusmenu-glib/client.h> -#include <libdbusmenu-gtk3/menuitem.h> #include "device-menu-mgr.h" #include "settings-helper.h" diff --git a/src/indicator-session.c b/src/indicator-session.c index ec49f0e..e748825 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -31,11 +31,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <gtk/gtk.h> #include <gio/gio.h> -#if GTK_CHECK_VERSION(3, 0, 0) -#include <libdbusmenu-gtk3/menu.h> -#else #include <libdbusmenu-gtk/menu.h> -#endif #include <libindicator/indicator.h> #include <libindicator/indicator-object.h> @@ -280,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/session-service.c b/src/session-service.c index 753e304..6ee18e9 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -39,11 +39,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <libdbusmenu-glib/client.h> #include <gtk/gtk.h> -#if GTK_CHECK_VERSION(3, 0, 0) -#include <libdbusmenu-gtk3/menuitem.h> -#else #include <libdbusmenu-gtk/menuitem.h> -#endif #include <libindicator/indicator-service.h> diff --git a/src/udev-mgr.h b/src/udev-mgr.h index 5119803..2e57cff 100644 --- a/src/udev-mgr.h +++ b/src/udev-mgr.h @@ -24,11 +24,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <libdbusmenu-glib/client.h> #include <gtk/gtk.h> -#if GTK_CHECK_VERSION(3, 0, 0) -#include <libdbusmenu-gtk3/menuitem.h> -#else #include <libdbusmenu-gtk/menuitem.h> -#endif G_BEGIN_DECLS 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, diff --git a/src/user-menu-mgr.h b/src/user-menu-mgr.h index 01823e7..40f7b18 100644 --- a/src/user-menu-mgr.h +++ b/src/user-menu-mgr.h @@ -23,7 +23,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <glib-object.h> -#include <libdbusmenu-gtk3/menuitem.h> +#include <libdbusmenu-gtk/menuitem.h> #include "session-dbus.h" diff --git a/src/user-widget.c b/src/user-widget.c index 937a9eb..88ac11c 100644 --- a/src/user-widget.c +++ b/src/user-widget.c @@ -136,7 +136,11 @@ user_widget_init (UserWidget *self) gtk_misc_set_padding (GTK_MISC(priv->user_image),0, 4.0); priv->user_name = gtk_label_new (""); +#if HAVE_GTK3 + priv->container = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); +#else priv->container = gtk_hbox_new (FALSE, 0); +#endif priv->tick_icon = gtk_image_new_from_icon_name ("account-logged-in", GTK_ICON_SIZE_MENU); gtk_misc_set_alignment(GTK_MISC(priv->tick_icon), 1.0, 0.5); diff --git a/src/user-widget.h b/src/user-widget.h index e1f6d1a..52a5e34 100644 --- a/src/user-widget.h +++ b/src/user-widget.h @@ -20,11 +20,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #define __USER_WIDGET_H__ #include <gtk/gtk.h> -#if GTK_CHECK_VERSION(3, 0, 0) -#include <libdbusmenu-gtk3/menuitem.h> -#else #include <libdbusmenu-gtk/menuitem.h> -#endif G_BEGIN_DECLS |