diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 26 | ||||
-rw-r--r-- | src/Makefile.in | 84 | ||||
-rw-r--r-- | src/device-menu-mgr.c | 6 | ||||
-rw-r--r-- | src/indicator-session.c | 4 | ||||
-rw-r--r-- | src/user-menu-mgr.c | 28 |
5 files changed, 81 insertions, 67 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 67a1cb6..a1e443e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,6 @@ +EXTRA_DIST = + libexec_PROGRAMS = \ indicator-session-service @@ -107,14 +109,26 @@ indicator_session_service_SOURCES = \ user-menu-mgr.c \ device-menu-mgr.h \ device-menu-mgr.c \ - udev-mgr.h \ - udev-mgr.c \ sane-rules.h if BUILD_APT indicator_session_service_SOURCES += \ apt-watcher.h \ apt-watcher.c +else +EXTRA_DIST += \ + apt-watcher.h \ + apt-watcher.c +endif + +if HAS_GUDEV +indicator_session_service_SOURCES += \ + udev-mgr.h \ + udev-mgr.c +else +EXTRA_DIST += \ + udev-mgr.h \ + udev-mgr.c endif indicator_session_service_CFLAGS = \ @@ -122,10 +136,12 @@ indicator_session_service_CFLAGS = \ $(GCONF_CFLAGS) \ -DLIBEXECDIR=\"$(libexecdir)\" \ -Wall -Werror \ - -DG_LOG_DOMAIN=\"Indicator-Session\" + -DG_LOG_DOMAIN=\"Indicator-Session\" \ + $(GUDEV_CFLAGS) indicator_session_service_LDADD = \ $(SESSIONSERVICE_LIBS) \ - $(GCONF_LIBS) + $(GCONF_LIBS) \ + $(GUDEV_LIBS) ################# # GTK Logout Stuff @@ -168,7 +184,7 @@ BUILT_SOURCES = \ accounts-service-client.h \ accounts-service-user-client.h -EXTRA_DIST = \ +EXTRA_DIST += \ org.freedesktop.ConsoleKit.Manager.xml \ org.freedesktop.ConsoleKit.Seat.xml \ org.freedesktop.ConsoleKit.Session.xml \ diff --git a/src/Makefile.in b/src/Makefile.in index 6efb4de..ab579b3 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -43,13 +43,22 @@ libexec_PROGRAMS = indicator-session-service$(EXEEXT) $(am__EXEEXT_1) @BUILD_APT_TRUE@ apt-watcher.h \ @BUILD_APT_TRUE@ apt-watcher.c +@BUILD_APT_FALSE@am__append_3 = \ +@BUILD_APT_FALSE@ apt-watcher.h \ +@BUILD_APT_FALSE@ apt-watcher.c + +@HAS_GUDEV_TRUE@am__append_4 = \ +@HAS_GUDEV_TRUE@ udev-mgr.h \ +@HAS_GUDEV_TRUE@ udev-mgr.c + +@HAS_GUDEV_FALSE@am__append_5 = \ +@HAS_GUDEV_FALSE@ udev-mgr.h \ +@HAS_GUDEV_FALSE@ udev-mgr.c + subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/intltool.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -116,9 +125,11 @@ 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 + user-menu-mgr.c device-menu-mgr.h device-menu-mgr.c \ + sane-rules.h apt-watcher.h apt-watcher.c udev-mgr.h udev-mgr.c @BUILD_APT_TRUE@am__objects_1 = indicator_session_service-apt-watcher.$(OBJEXT) +@HAS_GUDEV_TRUE@am__objects_2 = \ +@HAS_GUDEV_TRUE@ indicator_session_service-udev-mgr.$(OBJEXT) am_indicator_session_service_OBJECTS = \ indicator_session_service-lock-helper.$(OBJEXT) \ indicator_session_service-session-service.$(OBJEXT) \ @@ -128,10 +139,11 @@ 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-udev-mgr.$(OBJEXT) $(am__objects_1) + $(am__objects_1) $(am__objects_2) indicator_session_service_OBJECTS = \ $(am_indicator_session_service_OBJECTS) -indicator_session_service_DEPENDENCIES = $(am__DEPENDENCIES_1) +indicator_session_service_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) indicator_session_service_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(indicator_session_service_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ @@ -211,6 +223,8 @@ GREP = @GREP@ GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTKLOGOUTHELPER_CFLAGS = @GTKLOGOUTHELPER_CFLAGS@ GTKLOGOUTHELPER_LIBS = @GTKLOGOUTHELPER_LIBS@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ INDICATORDIR = @INDICATORDIR@ INDICATORICONSDIR = @INDICATORICONSDIR@ INSTALL = @INSTALL@ @@ -332,6 +346,12 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +EXTRA_DIST = $(am__append_3) $(am__append_5) \ + org.freedesktop.ConsoleKit.Manager.xml \ + org.freedesktop.ConsoleKit.Seat.xml \ + org.freedesktop.ConsoleKit.Session.xml display-manager.xml \ + session-dbus.xml upower.xml accounts-service.xml \ + accounts-service-user.xml ################### # Indicator Stuff @@ -363,18 +383,20 @@ 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) + user-menu-mgr.c device-menu-mgr.h device-menu-mgr.c \ + sane-rules.h $(am__append_2) $(am__append_4) indicator_session_service_CFLAGS = \ $(SESSIONSERVICE_CFLAGS) \ $(GCONF_CFLAGS) \ -DLIBEXECDIR=\"$(libexecdir)\" \ -Wall -Werror \ - -DG_LOG_DOMAIN=\"Indicator-Session\" + -DG_LOG_DOMAIN=\"Indicator-Session\" \ + $(GUDEV_CFLAGS) indicator_session_service_LDADD = \ $(SESSIONSERVICE_LIBS) \ - $(GCONF_LIBS) + $(GCONF_LIBS) \ + $(GUDEV_LIBS) ################# @@ -414,16 +436,6 @@ BUILT_SOURCES = \ accounts-service-client.h \ accounts-service-user-client.h -EXTRA_DIST = \ - org.freedesktop.ConsoleKit.Manager.xml \ - org.freedesktop.ConsoleKit.Seat.xml \ - org.freedesktop.ConsoleKit.Session.xml \ - display-manager.xml \ - session-dbus.xml \ - upower.xml \ - accounts-service.xml \ - accounts-service-user.xml - CLEANFILES = \ $(BUILT_SOURCES) @@ -756,20 +768,6 @@ indicator_session_service-device-menu-mgr.obj: device-menu-mgr.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(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 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)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@ $(AM_V_CC@am__nodep@)$(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 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)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@ $(AM_V_CC@am__nodep@)$(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 @@ -784,6 +782,20 @@ indicator_session_service-apt-watcher.obj: apt-watcher.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_session_service_CFLAGS) $(CFLAGS) -c -o indicator_session_service-apt-watcher.obj `if test -f 'apt-watcher.c'; then $(CYGPATH_W) 'apt-watcher.c'; else $(CYGPATH_W) '$(srcdir)/apt-watcher.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 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)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@ $(AM_V_CC@am__nodep@)$(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 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)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@ $(AM_V_CC@am__nodep@)$(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/device-menu-mgr.c b/src/device-menu-mgr.c index f8f0696..cfdb55d 100644 --- a/src/device-menu-mgr.c +++ b/src/device-menu-mgr.c @@ -31,7 +31,9 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include "apt-watcher.h" #endif /* HAVE_APT */ +#ifdef HAS_GUDEV #include "udev-mgr.h" +#endif /* HAS_GUDEV */ #define UP_ADDRESS "org.freedesktop.UPower" #define UP_OBJECT "/org/freedesktop/UPower" @@ -47,7 +49,9 @@ struct _DeviceMenuMgr #ifdef HAVE_APT AptWatcher* apt_watcher; #endif /* HAVE_APT */ +#ifdef HAS_GUDEV UdevMgr* udev_mgr; +#endif /* HAS_GUDEV */ }; static GSettings *lockdown_settings = NULL; @@ -733,8 +737,10 @@ device_menu_mgr_build_static_items (DeviceMenuMgr* self, gboolean greeter_mode) restart_shutdown_logout_mi->shutdown_mi = shutdown_mi; update_menu_entries(restart_shutdown_logout_mi); +#ifdef HAS_GUDEV // Time to create the udev mgr and hand it the static relevant items. self->udev_mgr = udev_mgr_new (scanners_menuitem, webcam_menuitem); +#endif } static void diff --git a/src/indicator-session.c b/src/indicator-session.c index e748825..5d894e8 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -162,6 +162,7 @@ indicator_session_init (IndicatorSession *self) } self->users.label = GTK_LABEL (gtk_label_new (NULL)); + self->users.accessible_desc = _("User Menu"); const gchar *greeter_var; greeter_var = g_getenv("INDICATOR_GREETER_MODE"); @@ -169,6 +170,7 @@ indicator_session_init (IndicatorSession *self) // devices self->devices.name_hint = PACKAGE"-devices"; + self->devices.accessible_desc = _("Device Menu"); self->devices.menu = GTK_MENU (dbusmenu_gtkmenu_new(INDICATOR_SESSION_DBUS_NAME, INDICATOR_SESSION_DBUS_OBJECT)); if (greeter_mode){ @@ -514,6 +516,8 @@ receive_signal (GDBusProxy * proxy, g_debug ("reboot required"); indicator_image_helper_update(self->devices.image, ICON_RESTART); } + self->devices.accessible_desc = _("Device Menu (reboot required)"); + g_signal_emit(G_OBJECT(self), INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID, 0, &(self->devices)); } } diff --git a/src/user-menu-mgr.c b/src/user-menu-mgr.c index 3f4bdc4..7aad2af 100644 --- a/src/user-menu-mgr.c +++ b/src/user-menu-mgr.c @@ -285,29 +285,11 @@ check_new_session () return TRUE; } -/* Check to see if the lockdown key is protecting from - locking the screen. If not, lock it. */ -static void -lock_if_possible (void) { - ensure_settings_client (); - - if (!g_settings_get_boolean (settings, LOCKDOWN_KEY_SCREENSAVER)) { - lock_screen(NULL, 0, NULL); - } - - return; -} - - /* Starts a new generic session */ static void activate_new_session (DbusmenuMenuitem * mi, guint timestamp, gpointer user_data) { - lock_if_possible(); - - users_service_dbus_show_greeter (USERS_SERVICE_DBUS(user_data)); - - return; + users_service_dbus_show_greeter (USERS_SERVICE_DBUS(user_data)); } /* Activates a session for a particular user. */ @@ -317,8 +299,6 @@ activate_user_session (DbusmenuMenuitem *mi, guint timestamp, gpointer user_data UserData *user = (UserData *)user_data; UsersServiceDbus *service = user->service; - lock_if_possible(); - users_service_dbus_activate_user_session (service, user); } @@ -406,11 +386,7 @@ activate_guest_session (DbusmenuMenuitem * mi, guint timestamp, gpointer user_da UserMenuMgr* user_mgr = USER_MENU_MGR(user_data); UsersServiceDbus *service = user_mgr->users_dbus_interface; - lock_if_possible(); - - if (users_service_dbus_activate_guest_session(service)) { - return; - } + users_service_dbus_activate_guest_session(service); } |