aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2012-02-08 15:12:47 -0500
committerKen VanDine <ken.vandine@canonical.com>2012-02-08 15:12:47 -0500
commit4eacd253f0fd5cb22a6c12dbf58126eb14c95bde (patch)
tree27c93878367ff2c04a9b9482b718b71ef8652857 /src
parent6c05bbbd892c117777b11662b7e86c0d201398ec (diff)
parentfb82208c7c5a593eb89f1a53174978b562fcdae7 (diff)
downloadayatana-indicator-session-4eacd253f0fd5cb22a6c12dbf58126eb14c95bde.tar.gz
ayatana-indicator-session-4eacd253f0fd5cb22a6c12dbf58126eb14c95bde.tar.bz2
ayatana-indicator-session-4eacd253f0fd5cb22a6c12dbf58126eb14c95bde.zip
* New upstream release.
* Screensaver code cleanup * Fix ordering of items on request * Removing GOA support * Fix GTK3 Box Deprecation * Updating to dbusmenu 0.5.90 * Making the gtk logout helper and apt optional build time choices * Add name hints to the indicators * bump version for release * Drop debian/patches/01-remove-dead-gss-handling.patch: Upstream * debian/control: Updating dbusmenu dep to 0.5.90
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am21
-rw-r--r--src/Makefile.in142
-rw-r--r--src/apt-watcher.h4
-rw-r--r--src/device-menu-mgr.c54
-rw-r--r--src/indicator-session.c15
-rw-r--r--src/lock-helper.c86
-rw-r--r--src/lock-helper.h3
-rw-r--r--src/session-service.c4
-rw-r--r--src/udev-mgr.h4
-rw-r--r--src/user-menu-mgr.c35
-rw-r--r--src/user-menu-mgr.h2
-rw-r--r--src/user-widget.c4
-rw-r--r--src/user-widget.h4
13 files changed, 129 insertions, 249 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index dba0a9e..afee66c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,11 @@
libexec_PROGRAMS = \
- indicator-session-service \
+ indicator-session-service
+
+if BUILD_GTKLOGOUTHELPER
+libexec_PROGRAMS += \
gtk-logout-helper
+endif
###################
# Indicator Stuff
@@ -103,13 +107,18 @@ indicator_session_service_SOURCES = \
user-menu-mgr.c \
device-menu-mgr.h \
device-menu-mgr.c \
- apt-watcher.h \
- apt-watcher.c \
- apt-transaction.h \
- apt-transaction.c \
udev-mgr.h \
udev-mgr.c \
sane-rules.h
+
+if BUILD_APT
+indicator_session_service_SOURCES += \
+ apt-watcher.h \
+ apt-watcher.c \
+ apt-transaction.h \
+ apt-transaction.c
+endif
+
indicator_session_service_CFLAGS = \
$(SESSIONSERVICE_CFLAGS) \
$(GCONF_CFLAGS) \
@@ -124,6 +133,7 @@ indicator_session_service_LDADD = \
# GTK Logout Stuff
#################
+if BUILD_GTKLOGOUTHELPER
gtk_logout_helper_SOURCES = \
gtk-logout-helper.c \
settings-helper.c \
@@ -142,6 +152,7 @@ gtk_logout_helper_LDADD = \
$(SESSIONSERVICE_LIBS) \
$(GTKLOGOUTHELPER_LIBS) \
$(GCONF_LIBS)
+endif
###############
diff --git a/src/Makefile.in b/src/Makefile.in
index 693b442..5e973fb 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -35,8 +35,16 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-libexec_PROGRAMS = indicator-session-service$(EXEEXT) \
- gtk-logout-helper$(EXEEXT)
+libexec_PROGRAMS = indicator-session-service$(EXEEXT) $(am__EXEEXT_1)
+@BUILD_GTKLOGOUTHELPER_TRUE@am__append_1 = \
+@BUILD_GTKLOGOUTHELPER_TRUE@ gtk-logout-helper
+
+@BUILD_APT_TRUE@am__append_2 = \
+@BUILD_APT_TRUE@ apt-watcher.h \
+@BUILD_APT_TRUE@ apt-watcher.c \
+@BUILD_APT_TRUE@ apt-transaction.h \
+@BUILD_APT_TRUE@ apt-transaction.c
+
subdir = src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -82,18 +90,30 @@ am__v_lt_0 = --silent
libsession_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libsession_la_CFLAGS) \
$(CFLAGS) $(libsession_la_LDFLAGS) $(LDFLAGS) -o $@
+@BUILD_GTKLOGOUTHELPER_TRUE@am__EXEEXT_1 = gtk-logout-helper$(EXEEXT)
PROGRAMS = $(libexec_PROGRAMS)
-am_gtk_logout_helper_OBJECTS = \
- gtk_logout_helper-gtk-logout-helper.$(OBJEXT) \
- gtk_logout_helper-settings-helper.$(OBJEXT) \
- gtk_logout_helper-dialog.$(OBJEXT)
+am__gtk_logout_helper_SOURCES_DIST = gtk-logout-helper.c \
+ settings-helper.c settings-helper.h dialog.c dialog.h
+@BUILD_GTKLOGOUTHELPER_TRUE@am_gtk_logout_helper_OBJECTS = gtk_logout_helper-gtk-logout-helper.$(OBJEXT) \
+@BUILD_GTKLOGOUTHELPER_TRUE@ gtk_logout_helper-settings-helper.$(OBJEXT) \
+@BUILD_GTKLOGOUTHELPER_TRUE@ gtk_logout_helper-dialog.$(OBJEXT)
gtk_logout_helper_OBJECTS = $(am_gtk_logout_helper_OBJECTS)
-gtk_logout_helper_DEPENDENCIES = $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
+@BUILD_GTKLOGOUTHELPER_TRUE@gtk_logout_helper_DEPENDENCIES = \
+@BUILD_GTKLOGOUTHELPER_TRUE@ $(am__DEPENDENCIES_1) \
+@BUILD_GTKLOGOUTHELPER_TRUE@ $(am__DEPENDENCIES_1)
gtk_logout_helper_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(gtk_logout_helper_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@
+am__indicator_session_service_SOURCES_DIST = lock-helper.c \
+ lock-helper.h session-service.c session-dbus.c session-dbus.h \
+ gen-session-dbus.xml.c dbusmenu-shared.h settings-helper.c \
+ users-service-dbus.h users-service-dbus.c user-menu-mgr.h \
+ user-menu-mgr.c device-menu-mgr.h device-menu-mgr.c udev-mgr.h \
+ udev-mgr.c sane-rules.h apt-watcher.h apt-watcher.c \
+ apt-transaction.h apt-transaction.c
+@BUILD_APT_TRUE@am__objects_1 = indicator_session_service-apt-watcher.$(OBJEXT) \
+@BUILD_APT_TRUE@ indicator_session_service-apt-transaction.$(OBJEXT)
am_indicator_session_service_OBJECTS = \
indicator_session_service-lock-helper.$(OBJEXT) \
indicator_session_service-session-service.$(OBJEXT) \
@@ -103,9 +123,7 @@ am_indicator_session_service_OBJECTS = \
indicator_session_service-users-service-dbus.$(OBJEXT) \
indicator_session_service-user-menu-mgr.$(OBJEXT) \
indicator_session_service-device-menu-mgr.$(OBJEXT) \
- indicator_session_service-apt-watcher.$(OBJEXT) \
- indicator_session_service-apt-transaction.$(OBJEXT) \
- indicator_session_service-udev-mgr.$(OBJEXT)
+ indicator_session_service-udev-mgr.$(OBJEXT) $(am__objects_1)
indicator_session_service_OBJECTS = \
$(am_indicator_session_service_OBJECTS)
indicator_session_service_DEPENDENCIES = $(am__DEPENDENCIES_1)
@@ -141,8 +159,9 @@ am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
am__v_GEN_0 = @echo " GEN " $@;
SOURCES = $(libsession_la_SOURCES) $(gtk_logout_helper_SOURCES) \
$(indicator_session_service_SOURCES)
-DIST_SOURCES = $(libsession_la_SOURCES) $(gtk_logout_helper_SOURCES) \
- $(indicator_session_service_SOURCES)
+DIST_SOURCES = $(libsession_la_SOURCES) \
+ $(am__gtk_logout_helper_SOURCES_DIST) \
+ $(am__indicator_session_service_SOURCES_DIST)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -329,29 +348,12 @@ libsession_la_LDFLAGS = -module -avoid-version
#################
# Session Stuff
#################
-indicator_session_service_SOURCES = \
- lock-helper.c \
- lock-helper.h \
- session-service.c \
- session-dbus.c \
- session-dbus.h \
- gen-session-dbus.xml.c \
- dbusmenu-shared.h \
- settings-helper.c \
- users-service-dbus.h \
- users-service-dbus.c \
- user-menu-mgr.h \
- user-menu-mgr.c \
- device-menu-mgr.h \
- device-menu-mgr.c \
- apt-watcher.h \
- apt-watcher.c \
- apt-transaction.h \
- apt-transaction.c \
- udev-mgr.h \
- udev-mgr.c \
- sane-rules.h
-
+indicator_session_service_SOURCES = lock-helper.c lock-helper.h \
+ session-service.c session-dbus.c session-dbus.h \
+ gen-session-dbus.xml.c dbusmenu-shared.h settings-helper.c \
+ users-service-dbus.h users-service-dbus.c user-menu-mgr.h \
+ user-menu-mgr.c device-menu-mgr.h device-menu-mgr.c udev-mgr.h \
+ udev-mgr.c sane-rules.h $(am__append_2)
indicator_session_service_CFLAGS = \
$(SESSIONSERVICE_CFLAGS) \
$(GCONF_CFLAGS) \
@@ -367,24 +369,24 @@ indicator_session_service_LDADD = \
#################
# GTK Logout Stuff
#################
-gtk_logout_helper_SOURCES = \
- gtk-logout-helper.c \
- settings-helper.c \
- settings-helper.h \
- dialog.c \
- dialog.h
-
-gtk_logout_helper_CFLAGS = \
- $(SESSIONSERVICE_CFLAGS) \
- $(GTKLOGOUTHELPER_CFLAGS) \
- $(GCONF_CFLAGS) \
- -Wall -Werror \
- -DINDICATOR_ICONS_DIR="\"$(INDICATORICONSDIR)\""
-
-gtk_logout_helper_LDADD = \
- $(SESSIONSERVICE_LIBS) \
- $(GTKLOGOUTHELPER_LIBS) \
- $(GCONF_LIBS)
+@BUILD_GTKLOGOUTHELPER_TRUE@gtk_logout_helper_SOURCES = \
+@BUILD_GTKLOGOUTHELPER_TRUE@ gtk-logout-helper.c \
+@BUILD_GTKLOGOUTHELPER_TRUE@ settings-helper.c \
+@BUILD_GTKLOGOUTHELPER_TRUE@ settings-helper.h \
+@BUILD_GTKLOGOUTHELPER_TRUE@ dialog.c \
+@BUILD_GTKLOGOUTHELPER_TRUE@ dialog.h
+
+@BUILD_GTKLOGOUTHELPER_TRUE@gtk_logout_helper_CFLAGS = \
+@BUILD_GTKLOGOUTHELPER_TRUE@ $(SESSIONSERVICE_CFLAGS) \
+@BUILD_GTKLOGOUTHELPER_TRUE@ $(GTKLOGOUTHELPER_CFLAGS) \
+@BUILD_GTKLOGOUTHELPER_TRUE@ $(GCONF_CFLAGS) \
+@BUILD_GTKLOGOUTHELPER_TRUE@ -Wall -Werror \
+@BUILD_GTKLOGOUTHELPER_TRUE@ -DINDICATOR_ICONS_DIR="\"$(INDICATORICONSDIR)\""
+
+@BUILD_GTKLOGOUTHELPER_TRUE@gtk_logout_helper_LDADD = \
+@BUILD_GTKLOGOUTHELPER_TRUE@ $(SESSIONSERVICE_LIBS) \
+@BUILD_GTKLOGOUTHELPER_TRUE@ $(GTKLOGOUTHELPER_LIBS) \
+@BUILD_GTKLOGOUTHELPER_TRUE@ $(GCONF_LIBS)
###############
@@ -771,6 +773,22 @@ indicator_session_service-device-menu-mgr.obj: device-menu-mgr.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_session_service_CFLAGS) $(CFLAGS) -c -o indicator_session_service-device-menu-mgr.obj `if test -f 'device-menu-mgr.c'; then $(CYGPATH_W) 'device-menu-mgr.c'; else $(CYGPATH_W) '$(srcdir)/device-menu-mgr.c'; fi`
+indicator_session_service-udev-mgr.o: udev-mgr.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_session_service_CFLAGS) $(CFLAGS) -MT indicator_session_service-udev-mgr.o -MD -MP -MF $(DEPDIR)/indicator_session_service-udev-mgr.Tpo -c -o indicator_session_service-udev-mgr.o `test -f 'udev-mgr.c' || echo '$(srcdir)/'`udev-mgr.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_session_service-udev-mgr.Tpo $(DEPDIR)/indicator_session_service-udev-mgr.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='udev-mgr.c' object='indicator_session_service-udev-mgr.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_session_service_CFLAGS) $(CFLAGS) -c -o indicator_session_service-udev-mgr.o `test -f 'udev-mgr.c' || echo '$(srcdir)/'`udev-mgr.c
+
+indicator_session_service-udev-mgr.obj: udev-mgr.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_session_service_CFLAGS) $(CFLAGS) -MT indicator_session_service-udev-mgr.obj -MD -MP -MF $(DEPDIR)/indicator_session_service-udev-mgr.Tpo -c -o indicator_session_service-udev-mgr.obj `if test -f 'udev-mgr.c'; then $(CYGPATH_W) 'udev-mgr.c'; else $(CYGPATH_W) '$(srcdir)/udev-mgr.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_session_service-udev-mgr.Tpo $(DEPDIR)/indicator_session_service-udev-mgr.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='udev-mgr.c' object='indicator_session_service-udev-mgr.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_session_service_CFLAGS) $(CFLAGS) -c -o indicator_session_service-udev-mgr.obj `if test -f 'udev-mgr.c'; then $(CYGPATH_W) 'udev-mgr.c'; else $(CYGPATH_W) '$(srcdir)/udev-mgr.c'; fi`
+
indicator_session_service-apt-watcher.o: apt-watcher.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_session_service_CFLAGS) $(CFLAGS) -MT indicator_session_service-apt-watcher.o -MD -MP -MF $(DEPDIR)/indicator_session_service-apt-watcher.Tpo -c -o indicator_session_service-apt-watcher.o `test -f 'apt-watcher.c' || echo '$(srcdir)/'`apt-watcher.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_session_service-apt-watcher.Tpo $(DEPDIR)/indicator_session_service-apt-watcher.Po
@@ -803,22 +821,6 @@ indicator_session_service-apt-transaction.obj: apt-transaction.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_session_service_CFLAGS) $(CFLAGS) -c -o indicator_session_service-apt-transaction.obj `if test -f 'apt-transaction.c'; then $(CYGPATH_W) 'apt-transaction.c'; else $(CYGPATH_W) '$(srcdir)/apt-transaction.c'; fi`
-indicator_session_service-udev-mgr.o: udev-mgr.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_session_service_CFLAGS) $(CFLAGS) -MT indicator_session_service-udev-mgr.o -MD -MP -MF $(DEPDIR)/indicator_session_service-udev-mgr.Tpo -c -o indicator_session_service-udev-mgr.o `test -f 'udev-mgr.c' || echo '$(srcdir)/'`udev-mgr.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_session_service-udev-mgr.Tpo $(DEPDIR)/indicator_session_service-udev-mgr.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='udev-mgr.c' object='indicator_session_service-udev-mgr.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_session_service_CFLAGS) $(CFLAGS) -c -o indicator_session_service-udev-mgr.o `test -f 'udev-mgr.c' || echo '$(srcdir)/'`udev-mgr.c
-
-indicator_session_service-udev-mgr.obj: udev-mgr.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_session_service_CFLAGS) $(CFLAGS) -MT indicator_session_service-udev-mgr.obj -MD -MP -MF $(DEPDIR)/indicator_session_service-udev-mgr.Tpo -c -o indicator_session_service-udev-mgr.obj `if test -f 'udev-mgr.c'; then $(CYGPATH_W) 'udev-mgr.c'; else $(CYGPATH_W) '$(srcdir)/udev-mgr.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_session_service-udev-mgr.Tpo $(DEPDIR)/indicator_session_service-udev-mgr.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='udev-mgr.c' object='indicator_session_service-udev-mgr.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_session_service_CFLAGS) $(CFLAGS) -c -o indicator_session_service-udev-mgr.obj `if test -f 'udev-mgr.c'; then $(CYGPATH_W) 'udev-mgr.c'; else $(CYGPATH_W) '$(srcdir)/udev-mgr.c'; fi`
-
mostlyclean-libtool:
-rm -f *.lo
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 5a63be3..f8f0696 100644
--- a/src/device-menu-mgr.c
+++ b/src/device-menu-mgr.c
@@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along
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"
@@ -26,7 +26,11 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include "dbusmenu-shared.h"
#include "lock-helper.h"
#include "upower-client.h"
+
+#ifdef HAVE_APT
#include "apt-watcher.h"
+#endif /* HAVE_APT */
+
#include "udev-mgr.h"
#define UP_ADDRESS "org.freedesktop.UPower"
@@ -40,7 +44,9 @@ struct _DeviceMenuMgr
GObject parent_instance;
DbusmenuMenuitem* root_item;
SessionDbus* session_dbus_interface;
+#ifdef HAVE_APT
AptWatcher* apt_watcher;
+#endif /* HAVE_APT */
UdevMgr* udev_mgr;
};
@@ -50,7 +56,9 @@ static DbusmenuMenuitem *lock_menuitem = NULL;
static DbusmenuMenuitem *system_settings_menuitem = NULL;
static DbusmenuMenuitem *display_settings_menuitem = NULL;
static DbusmenuMenuitem *login_settings_menuitem = NULL;
+#ifdef HAVE_APT
static DbusmenuMenuitem *software_updates_menuitem = NULL;
+#endif /* HAVE_APT */
static DbusmenuMenuitem *printers_menuitem = NULL;
static DbusmenuMenuitem *scanners_menuitem = NULL;
static DbusmenuMenuitem *webcam_menuitem = NULL;
@@ -74,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,
@@ -102,7 +109,9 @@ G_DEFINE_TYPE (DeviceMenuMgr, device_menu_mgr, G_TYPE_OBJECT);
static void
device_menu_mgr_init (DeviceMenuMgr *self)
{
+#ifdef HAVE_APT
self->apt_watcher = NULL;
+#endif /* HAVE_APT */
self->root_item = dbusmenu_menuitem_new ();
setup_up(self);
g_idle_add(lock_screen_setup, NULL);
@@ -162,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,
@@ -210,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);
@@ -410,7 +396,11 @@ static void
show_dialog (DbusmenuMenuitem * mi, guint timestamp, gchar * type)
{
+#ifdef HAVE_GTKLOGOUTHELPER
gchar * helper = g_build_filename(LIBEXECDIR, "gtk-logout-helper", NULL);
+#else
+ gchar * helper = g_build_filename("gnome-session-quit", NULL);
+#endif /* HAVE_GTKLOGOUTHELPER */
gchar * dialog_line = g_strdup_printf("%s --%s", helper, type);
g_free(helper);
@@ -480,12 +470,14 @@ static void device_menu_mgr_show_simple_scan (DbusmenuMenuitem * mi,
{
g_warning("Unable to launch simple-scan: %s", error->message);
g_error_free(error);
+#ifdef HAVE_APT
if (!g_spawn_command_line_async("software-center simple-scan", &error))
{
g_warning ("Unable to launch software-centre simple-scan: %s",
error->message);
g_error_free(error);
}
+#endif /* HAVE_APT */
}
}
@@ -498,12 +490,14 @@ static void device_menu_mgr_show_cheese (DbusmenuMenuitem * mi,
{
g_warning("Unable to launch cheese: %s", error->message);
g_error_free(error);
+#ifdef HAVE_APT
if (!g_spawn_command_line_async("software-center cheese", &error))
{
g_warning ("Unable to launch software-centre cheese: %s",
error->message);
g_error_free(error);
}
+#endif /* HAVE_APT */
}
}
@@ -542,6 +536,7 @@ device_menu_mgr_build_settings_items (DeviceMenuMgr* self)
dbusmenu_menuitem_child_add_position(self->root_item,
login_settings_menuitem,
2);
+#ifdef HAVE_APT
software_updates_menuitem = dbusmenu_menuitem_new();
dbusmenu_menuitem_property_set (software_updates_menuitem,
DBUSMENU_MENUITEM_PROP_LABEL,
@@ -549,6 +544,7 @@ device_menu_mgr_build_settings_items (DeviceMenuMgr* self)
dbusmenu_menuitem_child_add_position(self->root_item,
software_updates_menuitem,
3);
+#endif /* HAVE_APT */
DbusmenuMenuitem * separator1 = dbusmenu_menuitem_new();
dbusmenu_menuitem_property_set (separator1,
@@ -726,7 +722,11 @@ device_menu_mgr_build_static_items (DeviceMenuMgr* self, gboolean greeter_mode)
dbusmenu_menuitem_child_append (self->root_item, shutdown_mi);
g_signal_connect (G_OBJECT(shutdown_mi),
DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
+#ifdef HAVE_GTKLOGOUTHELPER
G_CALLBACK(show_dialog), "shutdown");
+#else
+ G_CALLBACK(show_dialog), "power-off");
+#endif /* HAVE_GTKLOGOUTHELPER */
RestartShutdownLogoutMenuItems * restart_shutdown_logout_mi = g_new0 (RestartShutdownLogoutMenuItems, 1);
restart_shutdown_logout_mi->logout_mi = logout_mi;
@@ -778,9 +778,11 @@ DeviceMenuMgr* device_menu_mgr_new (SessionDbus* session_dbus, gboolean greeter_
DeviceMenuMgr* device_mgr = g_object_new (DEVICE_TYPE_MENU_MGR, NULL);
device_mgr->session_dbus_interface = session_dbus;
device_menu_mgr_build_static_items (device_mgr, greeter_mode);
+#ifdef HAVE_APT
if (software_updates_menuitem != NULL) {
device_mgr->apt_watcher = apt_watcher_new (session_dbus,
software_updates_menuitem);
}
+#endif /* HAVE_APT */
return device_mgr;
}
diff --git a/src/indicator-session.c b/src/indicator-session.c
index 9510807..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>
@@ -118,8 +114,8 @@ indicator_session_class_init (IndicatorSessionClass *klass)
object_class->finalize = indicator_session_finalize;
IndicatorObjectClass * io_class = INDICATOR_OBJECT_CLASS(klass);
- io_class->get_entries = indicator_session_get_entries;
- io_class->get_location = indicator_session_get_location;
+ io_class->get_entries = indicator_session_get_entries;
+ io_class->get_location = indicator_session_get_location;
return;
}
@@ -140,6 +136,7 @@ indicator_session_init (IndicatorSession *self)
GtkWidget* avatar_icon = NULL;
// users
+ self->users.name_hint = PACKAGE"-users";
self->users.menu = GTK_MENU (dbusmenu_gtkmenu_new (INDICATOR_USERS_DBUS_NAME,
INDICATOR_USERS_DBUS_OBJECT));
// Set the image to the default avator image
@@ -169,7 +166,9 @@ indicator_session_init (IndicatorSession *self)
const gchar *greeter_var;
greeter_var = g_getenv("INDICATOR_GREETER_MODE");
greeter_mode = g_strcmp0(greeter_var, "1") == 0;
+
// devices
+ self->devices.name_hint = PACKAGE"-devices";
self->devices.menu = GTK_MENU (dbusmenu_gtkmenu_new(INDICATOR_SESSION_DBUS_NAME,
INDICATOR_SESSION_DBUS_OBJECT));
if (greeter_mode){
@@ -277,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/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