aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/device-menu-mgr.c25
-rw-r--r--src/user-menu-mgr.c20
2 files changed, 36 insertions, 9 deletions
diff --git a/src/device-menu-mgr.c b/src/device-menu-mgr.c
index 1be113c..9706598 100644
--- a/src/device-menu-mgr.c
+++ b/src/device-menu-mgr.c
@@ -81,8 +81,11 @@ static void machine_sleep_with_context (DeviceMenuMgr* self,
gchar* type);
static void show_system_settings_with_context (DbusmenuMenuitem * mi,
guint timestamp,
- gchar * type);
-
+ gchar * type);
+
+static void show_simple_scan (DbusmenuMenuitem * mi,
+ guint timestamp,
+ gchar * type);
static void
machine_sleep_from_hibernate (DbusmenuMenuitem * mi,
guint timestamp,
@@ -460,6 +463,18 @@ show_system_settings_with_context (DbusmenuMenuitem * mi,
g_free(control_centre_command);
}
+static void show_simple_scan (DbusmenuMenuitem * mi,
+ guint timestamp,
+ gchar * type)
+{
+ GError * error = NULL;
+ if (!g_spawn_command_line_async("simple-scan", &error))
+ {
+ g_warning("Unable to launch simple-scan: %s", error->message);
+ g_error_free(error);
+ }
+}
+
static void
device_menu_mgr_build_static_items (DeviceMenuMgr* self)
{
@@ -550,14 +565,14 @@ device_menu_mgr_build_static_items (DeviceMenuMgr* self)
_("Scanners"));
g_signal_connect (G_OBJECT(scanners_menuitem),
DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
- G_CALLBACK(show_system_settings_with_context),
- "scanners");
+ G_CALLBACK(show_simple_scan),
+ NULL);
dbusmenu_menuitem_child_add_position (self->root_item,
scanners_menuitem,
8);
dbusmenu_menuitem_property_set_bool (scanners_menuitem,
DBUSMENU_MENUITEM_PROP_VISIBLE,
- FALSE);
+ TRUE);
webcam_menuitem = dbusmenu_menuitem_new();
dbusmenu_menuitem_property_set (webcam_menuitem,
diff --git a/src/user-menu-mgr.c b/src/user-menu-mgr.c
index 611bcc7..bf3b77f 100644
--- a/src/user-menu-mgr.c
+++ b/src/user-menu-mgr.c
@@ -149,10 +149,9 @@ user_menu_mgr_rebuild_items (UserMenuMgr *self)
for (u = users; u != NULL; u = g_list_next (u)) {
user = u->data;
+ g_debug ("%p: %s", user, user->real_name);
user->service = self->users_dbus_interface;
- g_debug ("%i %s", (gint)user->uid, user->user_name);
-
if (g_strcmp0(user->user_name, "guest") == 0) {
/* Check to see if the guest has sessions and so therefore should
get a check mark. */
@@ -171,13 +170,26 @@ user_menu_mgr_rebuild_items (UserMenuMgr *self)
if (self->user_count > MINIMUM_USERS && self->user_count < MAXIMUM_USERS) {
mi = dbusmenu_menuitem_new ();
- dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_TYPE, USER_ITEM_TYPE);
+ dbusmenu_menuitem_property_set (mi,
+ DBUSMENU_MENUITEM_PROP_TYPE,
+ USER_ITEM_TYPE);
if (user->real_name_conflict) {
gchar * conflictedname = g_strdup_printf("%s (%s)", user->real_name, user->user_name);
dbusmenu_menuitem_property_set (mi, USER_ITEM_PROP_NAME, conflictedname);
g_free(conflictedname);
} else {
- dbusmenu_menuitem_property_set (mi, USER_ITEM_PROP_NAME, user->real_name);
+ //g_debug ("%i %s", (gint)user->uid, user->real_name);
+ //g_debug ("users uid = %i", (gint)user->uid);
+ //g_debug ("users real name = %s", user->real_name);
+ if (user == NULL){
+ g_debug ("USER pointer is NULL");
+ return;
+ }
+ g_debug ("%p: %s", user, user->real_name);
+
+ dbusmenu_menuitem_property_set (mi,
+ USER_ITEM_PROP_NAME,
+ user->real_name);
}
dbusmenu_menuitem_property_set_bool (mi,
USER_ITEM_PROP_LOGGED_IN,