From 62d5071180e89c16c32d7b1bfee4410d37bee5f5 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 23 Aug 2011 16:54:52 +0100 Subject: removed bluetooth item and labels on webcams and scanners are now manufacturer specific --- src/device-menu-mgr.c | 28 +++++++--------------- src/udev-mgr.c | 65 +++++++++++++++++++++++++++++++++++++++++++++------ src/user-menu-mgr.c | 4 ++++ 3 files changed, 70 insertions(+), 27 deletions(-) diff --git a/src/device-menu-mgr.c b/src/device-menu-mgr.c index c298682..e111450 100644 --- a/src/device-menu-mgr.c +++ b/src/device-menu-mgr.c @@ -49,7 +49,6 @@ static GSettings *keybinding_settings = NULL; static DbusmenuMenuitem *lock_menuitem = NULL; static DbusmenuMenuitem *system_settings_menuitem = NULL; static DbusmenuMenuitem *display_settings_menuitem = NULL; -static DbusmenuMenuitem *bluetooth_settings_menuitem = NULL; static DbusmenuMenuitem *login_settings_menuitem = NULL; static DbusmenuMenuitem *software_updates_menuitem = NULL; static DbusmenuMenuitem *printers_menuitem = NULL; @@ -535,17 +534,6 @@ device_menu_mgr_build_settings_items (DeviceMenuMgr* self) dbusmenu_menuitem_child_add_position(self->root_item, display_settings_menuitem, 1); - bluetooth_settings_menuitem = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set (bluetooth_settings_menuitem, - DBUSMENU_MENUITEM_PROP_LABEL, - _("Bluetooth…")); - g_signal_connect (G_OBJECT(bluetooth_settings_menuitem), - DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, - G_CALLBACK(show_system_settings_with_context), "bluetooth"); - dbusmenu_menuitem_child_add_position(self->root_item, - bluetooth_settings_menuitem, - 2); - login_settings_menuitem = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set (login_settings_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, @@ -556,20 +544,20 @@ device_menu_mgr_build_settings_items (DeviceMenuMgr* self) "login"); dbusmenu_menuitem_child_add_position(self->root_item, login_settings_menuitem, - 3); + 2); software_updates_menuitem = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set (software_updates_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Software Up to Date")); dbusmenu_menuitem_child_add_position(self->root_item, software_updates_menuitem, - 4); + 3); DbusmenuMenuitem * separator1 = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set (separator1, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR); - dbusmenu_menuitem_child_add_position (self->root_item, separator1, 5); + dbusmenu_menuitem_child_add_position (self->root_item, separator1, 4); } static void @@ -584,7 +572,7 @@ device_menu_mgr_build_devices_items (DeviceMenuMgr* self) FALSE); dbusmenu_menuitem_child_add_position (self->root_item, device_heading, - 6); + 5); printers_menuitem = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set (printers_menuitem, @@ -596,7 +584,7 @@ device_menu_mgr_build_devices_items (DeviceMenuMgr* self) "printers"); dbusmenu_menuitem_child_add_position(self->root_item, printers_menuitem, - 7); + 6); scanners_menuitem = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set (scanners_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, @@ -607,7 +595,7 @@ device_menu_mgr_build_devices_items (DeviceMenuMgr* self) NULL); dbusmenu_menuitem_child_add_position (self->root_item, scanners_menuitem, - 8); + 7); dbusmenu_menuitem_property_set_bool (scanners_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); @@ -622,7 +610,7 @@ device_menu_mgr_build_devices_items (DeviceMenuMgr* self) NULL); dbusmenu_menuitem_child_add_position (self->root_item, webcam_menuitem, - 10); + 8); dbusmenu_menuitem_property_set_bool (webcam_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); @@ -631,7 +619,7 @@ device_menu_mgr_build_devices_items (DeviceMenuMgr* self) dbusmenu_menuitem_property_set (separator3, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR); - dbusmenu_menuitem_child_add_position (self->root_item, separator3, 11); + dbusmenu_menuitem_child_add_position (self->root_item, separator3, 9); } static void diff --git a/src/udev-mgr.c b/src/udev-mgr.c index f66d862..179e56f 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -22,8 +22,7 @@ with this program. If not, see . // TEMP #include #include -#include -#include +#include #include "udev-mgr.h" #include "sane-rules.h" @@ -235,13 +234,29 @@ udev_mgr_handle_webcam (UdevMgr* self, } g_hash_table_remove (self->webcams_present, product); - + dbusmenu_menuitem_property_set (self->webcam_item, + DBUSMENU_MENUITEM_PROP_LABEL, + _("Webcams")); } else { if (g_hash_table_lookup (self->webcams_present, product) != NULL){ g_warning ("Got an ADD event on a webcam device but we already have that device in our webcam cache"); return; } + + const gchar* manufacturer = NULL; + manufacturer = g_udev_device_get_property (device, "ID_VENDOR"); + + if (manufacturer != NULL){ + gchar* lowered = g_ascii_strdown (manufacturer, -1); + lowered[0] = g_ascii_toupper (lowered[0]); + gchar* label = g_strdup_printf("%s Webcam", lowered); + g_free (lowered); + dbusmenu_menuitem_property_set (self->webcam_item, + DBUSMENU_MENUITEM_PROP_LABEL, + _(label)); + } + g_hash_table_insert (self->webcams_present, g_strdup (product), g_strdup (vendor)); @@ -254,23 +269,26 @@ debug_device (UdevMgr* self, GUdevDevice* device, UdevMgrDeviceAction action) { - /*const gchar* vendor; + const gchar* vendor; const gchar* product; const gchar* number; const gchar* name; + const gchar* manufacturer; vendor = g_udev_device_get_property (device, "ID_VENDOR_ID"); + manufacturer = g_udev_device_get_property (device, "ID_VENDOR"); product = g_udev_device_get_property (device, "ID_MODEL_ID"); number = g_udev_device_get_number (device); name = g_udev_device_get_name (device); - g_debug ("device vendor id %s , product id of %s , number of %s and name of %s", + g_debug ("%s device vendor id %s , product id of %s , number of %s and name of %s", + g_strdup(manufacturer), g_strdup(vendor), g_strdup(product), g_strdup(number), g_strdup(name)); - const gchar *const *list; + /*const gchar *const *list; const gchar *const *iter; char propstr[500]; guint32 namelen = 0, i; @@ -290,7 +308,7 @@ debug_device (UdevMgr* self, strcat(propstr, " "); strcat(propstr, g_udev_device_get_property(device, *iter)); g_debug("%s", propstr); - }*/ + }*/ } static void udev_mgr_handle_scsi_device (UdevMgr* self, @@ -344,6 +362,10 @@ static void udev_mgr_handle_scsi_device (UdevMgr* self, } else{ g_hash_table_remove (self->scanners_present, vendor); + dbusmenu_menuitem_property_set (self->scanner_item, + DBUSMENU_MENUITEM_PROP_LABEL, + _("Scanners")); + } } else{ @@ -351,6 +373,18 @@ static void udev_mgr_handle_scsi_device (UdevMgr* self, g_warning ("Got an ADD event on a scanner device but we already have that device in our scanners cache"); } else{ + const gchar* manufacturer = NULL; + manufacturer = g_udev_device_get_property (device, "ID_VENDOR"); + + if (manufacturer != NULL){ + gchar* lowered = g_ascii_strdown (manufacturer, -1); + lowered[0] = g_ascii_toupper (lowered[0]); + gchar* label = g_strdup_printf("%s Scanner", lowered); + g_free (lowered); + dbusmenu_menuitem_property_set (self->scanner_item, + DBUSMENU_MENUITEM_PROP_LABEL, + _(label)); + } g_hash_table_insert (self->scanners_present, g_strdup(vendor), g_strdup(model_id)); @@ -397,6 +431,9 @@ udev_mgr_check_if_usb_device_is_supported (UdevMgr* self, } else{ g_hash_table_remove (self->scanners_present, vendor); + dbusmenu_menuitem_property_set (self->scanner_item, + DBUSMENU_MENUITEM_PROP_LABEL, + _("Scanners")); } } else{ @@ -404,6 +441,20 @@ udev_mgr_check_if_usb_device_is_supported (UdevMgr* self, g_warning ("Got an ADD event on a scanner device but we already have that device in our scanners cache"); } else{ + const gchar* manufacturer = NULL; + + manufacturer = g_udev_device_get_property (device, "ID_VENDOR"); + if (manufacturer != NULL){ + + gchar* lowered = g_ascii_strdown (manufacturer, -1); + lowered[0] = g_ascii_toupper (lowered[0]); + gchar* label = g_strdup_printf("%s Scanner", lowered); + g_free (lowered); + dbusmenu_menuitem_property_set (self->scanner_item, + DBUSMENU_MENUITEM_PROP_LABEL, + _(label)); + } + g_hash_table_insert (self->scanners_present, g_strdup(vendor), g_strdup(model_id)); diff --git a/src/user-menu-mgr.c b/src/user-menu-mgr.c index 588d3d0..9d76b8b 100644 --- a/src/user-menu-mgr.c +++ b/src/user-menu-mgr.c @@ -49,6 +49,10 @@ static gint compare_users_by_username (const gchar *a, static void activate_online_accounts (DbusmenuMenuitem *mi, guint timestamp, gpointer user_data); +static void activate_user_accounts (DbusmenuMenuitem *mi, + guint timestamp, + gpointer user_data); + static void user_menu_mgr_rebuild_items (UserMenuMgr *self, gboolean greeter_mode); static gboolean check_new_session (); -- cgit v1.2.3 From c8335dabc0de12258ff397924e264cc02ae86554 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 23 Aug 2011 17:14:35 +0100 Subject: user menu now shown if guest session is possible also guest name has been set on the panel --- src/device-menu-mgr.c | 2 -- src/user-menu-mgr.c | 14 ++++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/device-menu-mgr.c b/src/device-menu-mgr.c index e111450..523ea8d 100644 --- a/src/device-menu-mgr.c +++ b/src/device-menu-mgr.c @@ -740,7 +740,6 @@ device_menu_mgr_build_static_items (DeviceMenuMgr* self, gboolean greeter_mode) self->udev_mgr = udev_mgr_new (scanners_menuitem, webcam_menuitem); } - static void device_menu_mgr_rebuild_items (DeviceMenuMgr* self) { @@ -821,7 +820,6 @@ device_menu_mgr_ensure_settings_client (DeviceMenuMgr* self) keybinding_settings = g_settings_new (KEYBINDING_SCHEMA); g_signal_connect(lockdown_settings, "changed::" KEY_LOCK_SCREEN, G_CALLBACK(keybinding_changed), self); } - return; } diff --git a/src/user-menu-mgr.c b/src/user-menu-mgr.c index 9d76b8b..424706e 100644 --- a/src/user-menu-mgr.c +++ b/src/user-menu-mgr.c @@ -173,7 +173,7 @@ user_menu_mgr_rebuild_items (UserMenuMgr *self, gboolean greeter_mode) gboolean user_menu_is_visible = FALSE; if (!greeter_mode){ - user_menu_is_visible = self->user_count > 1; + user_menu_is_visible = self->user_count > 1 || check_guest_session(); } session_dbus_set_user_menu_visibility (self->session_dbus_interface, @@ -240,9 +240,15 @@ user_menu_mgr_rebuild_items (UserMenuMgr *self, gboolean greeter_mode) USER_ITEM_PROP_IS_CURRENT_USER, logged_in); if (logged_in == TRUE){ - g_debug ("about to set the users real name to %s for user %s", - user->real_name, user->user_name); - session_dbus_set_users_real_name (self->session_dbus_interface, user->real_name); + if (check_guest_session() == TRUE){ + g_debug ("about to set the users real name to %s for user %s", + user->real_name, user->user_name); + session_dbus_set_users_real_name (self->session_dbus_interface, user->real_name); + } + else{ + session_dbus_set_users_real_name (self->session_dbus_interface, + _("Guest")); + } } dbusmenu_menuitem_child_append (self->root_item, mi); -- cgit v1.2.3 From 430f5bce4eef7194f260496a31a18c24e16969b4 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 23 Aug 2011 18:17:54 +0100 Subject: set the alert state on the apt item when reboot is required --- src/apt-watcher.c | 3 +++ src/user-menu-mgr.c | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/apt-watcher.c b/src/apt-watcher.c index 7d706a0..a4298a8 100644 --- a/src/apt-watcher.c +++ b/src/apt-watcher.c @@ -279,6 +279,9 @@ apt_watcher_transaction_state_update_cb (AptTransaction* trans, dbusmenu_menuitem_property_set (self->apt_item, DBUSMENU_MENUITEM_PROP_LABEL, _("Reboot Required")); + dbusmenu_menuitem_property_set (self->apt_item, + DBUSMENU_MENUITEM_PROP_DISPOSITION, + DBUSMENU_MENUITEM_DISPOSITION_ALERT); session_dbus_restart_required (self->session_dbus_interface); } g_debug ("Finished with a reboot value of %i", reboot); diff --git a/src/user-menu-mgr.c b/src/user-menu-mgr.c index 424706e..aa02b01 100644 --- a/src/user-menu-mgr.c +++ b/src/user-menu-mgr.c @@ -236,16 +236,22 @@ user_menu_mgr_rebuild_items (UserMenuMgr *self, gboolean greeter_mode) } gboolean logged_in = g_strcmp0 (user->user_name, g_get_user_name()) == 0; + + g_debug ("user name = %s and g user name = %s", + user->user_name, + g_get_user_name()); + dbusmenu_menuitem_property_set_bool (mi, USER_ITEM_PROP_IS_CURRENT_USER, logged_in); if (logged_in == TRUE){ - if (check_guest_session() == TRUE){ + if (check_guest_session()){ g_debug ("about to set the users real name to %s for user %s", user->real_name, user->user_name); session_dbus_set_users_real_name (self->session_dbus_interface, user->real_name); } else{ + g_debug ("about to set the users real name to GUEST"); session_dbus_set_users_real_name (self->session_dbus_interface, _("Guest")); } @@ -429,7 +435,7 @@ static gboolean check_guest_session (void) { if (geteuid() < 500) { - /* System users shouldn't have guest account shown. Mosly + /* System users shouldn't have guest account shown. Mostly this would be the case of the guest user itself. */ return FALSE; } -- cgit v1.2.3 From 41f7c6c709a74f90cd12ee2b09bbc1648fc8607f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 23 Aug 2011 14:29:06 -0500 Subject: Fixing the TryExecs and the versions --- data/indicator-session-logout.desktop.in.in | 3 ++- data/indicator-session-restart.desktop.in.in | 3 ++- data/indicator-session-shutdown.desktop.in.in | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/data/indicator-session-logout.desktop.in.in b/data/indicator-session-logout.desktop.in.in index 78548d1..46ba087 100644 --- a/data/indicator-session-logout.desktop.in.in +++ b/data/indicator-session-logout.desktop.in.in @@ -1,8 +1,9 @@ [Desktop Entry] _Name=Log Out -Try-Exec=@libexecdir@/gtk-logout-helper +TryExec=@libexecdir@/gtk-logout-helper Exec=@libexecdir@/gtk-logout-helper --logout Icon=system-log-out Terminal=false Type=Application OnlyShowIn=Unity; +Version=1.0 diff --git a/data/indicator-session-restart.desktop.in.in b/data/indicator-session-restart.desktop.in.in index 68a2f7f..67aa390 100644 --- a/data/indicator-session-restart.desktop.in.in +++ b/data/indicator-session-restart.desktop.in.in @@ -1,8 +1,9 @@ [Desktop Entry] _Name=Restart -Try-Exec=@libexecdir@/gtk-logout-helper +TryExec=@libexecdir@/gtk-logout-helper Exec=@libexecdir@/gtk-logout-helper --restart Icon=system-restart Terminal=false Type=Application OnlyShowIn=Unity; +Version=1.0 diff --git a/data/indicator-session-shutdown.desktop.in.in b/data/indicator-session-shutdown.desktop.in.in index 419a952..4bd51fe 100644 --- a/data/indicator-session-shutdown.desktop.in.in +++ b/data/indicator-session-shutdown.desktop.in.in @@ -1,8 +1,9 @@ [Desktop Entry] _Name=Shut Down -Try-Exec=@libexecdir@/gtk-logout-helper +TryExec=@libexecdir@/gtk-logout-helper Exec=@libexecdir@/gtk-logout-helper --shutdown Icon=system-shutdown Terminal=false Type=Application OnlyShowIn=Unity; +Version=1.0 -- cgit v1.2.3 From 4151eaaab0a2f4d5ee8f7cdadb3fa5bf7187ff83 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 23 Aug 2011 15:07:33 -0500 Subject: Adding a lock screen desktop file as well --- .bzrignore | 2 ++ data/Makefile.am | 1 + data/indicator-session-lock-screen.desktop.in.in | 9 +++++++++ po/POTFILES.in | 1 + 4 files changed, 13 insertions(+) create mode 100644 data/indicator-session-lock-screen.desktop.in.in diff --git a/.bzrignore b/.bzrignore index 1b8a265..1883f5c 100644 --- a/.bzrignore +++ b/.bzrignore @@ -209,3 +209,5 @@ indicator-session-logout.desktop.in indicator-session-logout.desktop indicator-session-restart.desktop.in indicator-session-restart.desktop +data/indicator-session-lock-screen.desktop.in +data/indicator-session-lock-screen.desktop diff --git a/data/Makefile.am b/data/Makefile.am index 347f91f..8b4a99c 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -24,6 +24,7 @@ dist_convert_DATA = indicator-session.convert sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ logout_helper_desktop_in_in_files = \ + indicator-session-lock-screen.desktop.in.in \ indicator-session-logout.desktop.in.in \ indicator-session-restart.desktop.in.in \ indicator-session-shutdown.desktop.in.in diff --git a/data/indicator-session-lock-screen.desktop.in.in b/data/indicator-session-lock-screen.desktop.in.in new file mode 100644 index 0000000..e44cd9f --- /dev/null +++ b/data/indicator-session-lock-screen.desktop.in.in @@ -0,0 +1,9 @@ +[Desktop Entry] +_Name=Lock Screen +TryExec=@bindir@/xdg-screensaver +Exec=@bindir@/xdg-screensaver lock +Icon=system-lock-screen +Terminal=false +Type=Application +OnlyShowIn=Unity; +Version=1.0 diff --git a/po/POTFILES.in b/po/POTFILES.in index 7253dd6..44a2269 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,6 +1,7 @@ [encoding: UTF-8] data/com.canonical.indicator.session.gschema.xml.in data/extra-sessions/classic-desktop.desktop.in.in +data/indicator-session-lock-screen.desktop.in.in data/indicator-session-shutdown.desktop.in.in data/indicator-session-logout.desktop.in.in data/indicator-session-restart.desktop.in.in -- cgit v1.2.3 From 6e6ca9a62c6325c3b130e6e26eac225a25b5a2b9 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 23 Aug 2011 15:16:40 -0500 Subject: Making the desktop files actually install --- data/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/data/Makefile.am b/data/Makefile.am index 8b4a99c..a545ec0 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -32,6 +32,7 @@ logout_helper_desktop_in_in_files = \ logout_helperdir = $(datadir)/applications logout_helper_desktop_files = \ $(logout_helper_desktop_in_in_files:.desktop.in.in=.desktop) +logout_helper_DATA = $(logout_helper_desktop_files) EXTRA_DIST = \ $(service_in_files) \ -- cgit v1.2.3 From 39806a70caf6b4a7dc9f6772d915ddacebc928a3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 23 Aug 2011 15:28:24 -0500 Subject: Adding the bin directory as well --- data/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data/Makefile.am b/data/Makefile.am index a545ec0..7e851a7 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -21,7 +21,10 @@ dist_convert_DATA = indicator-session.convert @INTLTOOL_DESKTOP_RULE@ %.desktop.in: %.desktop.in.in - sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ + sed \ + -e "s|\@libexecdir\@|$(libexecdir)|" \ + -e "s|\@bindir\@|$(bindir)|" \ + $< > $@ logout_helper_desktop_in_in_files = \ indicator-session-lock-screen.desktop.in.in \ -- cgit v1.2.3 From f4e09aff23b8436d5f9ce86a4c6662a0f66f4671 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 23 Aug 2011 16:09:45 -0500 Subject: Add a test to test the space before an ellipsis at the end of a string --- Makefile.am | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 5850769..c9e4a44 100644 --- a/Makefile.am +++ b/Makefile.am @@ -35,8 +35,12 @@ dist-hook: fi TESTS = \ - test-ellipsis + test-ellipsis \ + test-space-ellipsis +##### +# Tests for there being proper ellipsis instead of three periods in a row +##### test-ellipsis: po @echo "#!/bin/bash" > $@ @echo "(cd po && make $(GETTEXT_PACKAGE).pot)" >> $@ @@ -44,4 +48,14 @@ test-ellipsis: po @echo "exit 0" >> $@ @chmod +x $@ +##### +# Tests for there being a space before an ellipsis +##### +test-space-ellipsis: po + @echo "#!/bin/bash" > $@ + @echo "(cd po && make $(GETTEXT_PACKAGE).pot)" >> $@ + @echo "grep -c -e \"^msgid.* …\\\"\" po/$(GETTEXT_PACKAGE).pot > /dev/null && echo \"Ellipsis found in user visible strings\" >&2 && exit 1" >> $@ + @echo "exit 0" >> $@ + @chmod +x $@ + CLEANFILES = $(TESTS) -- cgit v1.2.3 From 78a38ad242c381e7bf37e1a91897dbc61f5e5b65 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 23 Aug 2011 16:13:25 -0500 Subject: Fix the message --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index c9e4a44..7211fab 100644 --- a/Makefile.am +++ b/Makefile.am @@ -54,7 +54,7 @@ test-ellipsis: po test-space-ellipsis: po @echo "#!/bin/bash" > $@ @echo "(cd po && make $(GETTEXT_PACKAGE).pot)" >> $@ - @echo "grep -c -e \"^msgid.* …\\\"\" po/$(GETTEXT_PACKAGE).pot > /dev/null && echo \"Ellipsis found in user visible strings\" >&2 && exit 1" >> $@ + @echo "grep -c -e \"^msgid.* …\\\"\" po/$(GETTEXT_PACKAGE).pot > /dev/null && echo \"Space before ellipsis found in user visible strings\" >&2 && exit 1" >> $@ @echo "exit 0" >> $@ @chmod +x $@ -- cgit v1.2.3 From abc80c0b8b86e4bae570c834ff99c30356399897 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 23 Aug 2011 16:30:22 -0500 Subject: Adding a test to look for various ASCII quotes --- Makefile.am | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 7211fab..d63dac8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,7 +36,8 @@ dist-hook: TESTS = \ test-ellipsis \ - test-space-ellipsis + test-space-ellipsis \ + test-ascii-quotes ##### # Tests for there being proper ellipsis instead of three periods in a row @@ -58,4 +59,16 @@ test-space-ellipsis: po @echo "exit 0" >> $@ @chmod +x $@ +##### +# Tests for ASCII quote types +##### +test-ascii-quotes: po + @echo "#!/bin/bash" > $@ + @echo "(cd po && make $(GETTEXT_PACKAGE).pot)" >> $@ + @echo "grep -c -e \"^msgid \\\".*'.*\\\"\" po/$(GETTEXT_PACKAGE).pot > /dev/null && echo \"ASCII apostrophy found in user visible strings\" >&2 && exit 1" >> $@ + @echo "grep -c -e \"^msgid \\\".*\\\".*\\\"\" po/$(GETTEXT_PACKAGE).pot > /dev/null && echo \"ASCII quote found in user visible strings\" >&2 && exit 1" >> $@ + @echo "grep -c -e \"^msgid \\\".*\\\`.*\\\"\" po/$(GETTEXT_PACKAGE).pot > /dev/null && echo \"ASCII backtick found in user visible strings\" >&2 && exit 1" >> $@ + @echo "exit 0" >> $@ + @chmod +x $@ + CLEANFILES = $(TESTS) -- cgit v1.2.3 From 11ee8ffc85036820c4f8f8dbaf79f1dbfff82e94 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 23 Aug 2011 16:30:32 -0500 Subject: Fixing those ASCII quotes --- data/com.canonical.indicator.session.gschema.xml.in | 6 +++--- src/dialog.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/com.canonical.indicator.session.gschema.xml.in b/data/com.canonical.indicator.session.gschema.xml.in index 0cb6815..d1d7d4c 100644 --- a/data/com.canonical.indicator.session.gschema.xml.in +++ b/data/com.canonical.indicator.session.gschema.xml.in @@ -8,17 +8,17 @@ false <_summary>Remove the Log Out item from the session menu - <_description>Makes it so that the logout button doesn't show in the session menu. + <_description>Makes it so that the logout button doesn’t show in the session menu. false <_summary>Remove the Restart item from the session menu - <_description>Makes it so that the restart button doesn't show in the session menu. + <_description>Makes it so that the restart button doesn’t show in the session menu. false <_summary>Remove the shutdown item from the session menu - <_description>Makes it so that the shutdown button doesn't show in the session menu. + <_description>Makes it so that the shutdown button doesn’t show in the session menu. diff --git a/src/dialog.c b/src/dialog.c index 45cfdcb..4b139ca 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -62,7 +62,7 @@ static const gchar * button_auth_strings[LOGOUT_DIALOG_TYPE_CNT] = { in place of a log out. */ static const gchar * restart_updates = N_("Restart Instead"); static const gchar * restart_auth = N_("Restart Instead…"); -static const gchar * body_logout_update = N_("Some software updates won't apply until the computer next restarts."); +static const gchar * body_logout_update = N_("Some software updates won’t apply until the computer next restarts."); static const gchar * icon_strings[LOGOUT_DIALOG_TYPE_CNT] = { /* LOGOUT_DIALOG_LOGOUT, */ "system-log-out", -- cgit v1.2.3 From a73f98649bb15fb23d88adf1f178bcad63198057 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 23 Aug 2011 16:30:52 -0500 Subject: Ignoring the test scripts --- .bzrignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.bzrignore b/.bzrignore index 3a062ec..dad5a25 100644 --- a/.bzrignore +++ b/.bzrignore @@ -203,3 +203,5 @@ src/libsession_la-user-widget.lo consolekit-seat-client.h data/com.canonical.indicator.session.gschema.valid data/com.canonical.indicator.session.gschema.xml +test-ascii-quotes +test-space-ellipsis -- cgit v1.2.3 From a11951d98dad7f9b65be6c5866c3dd46b3f077e6 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 24 Aug 2011 10:22:02 +0100 Subject: gtk2 user widget drawing fixed --- src/user-widget.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/user-widget.c b/src/user-widget.c index a3ad1e4..1530967 100644 --- a/src/user-widget.c +++ b/src/user-widget.c @@ -90,6 +90,10 @@ static gboolean user_widget_draw_usericon_gtk_3 (GtkWidget *widget, static gboolean user_widget_primitive_draw_cb (GtkWidget *image, GdkEventExpose *event, gpointer user_data); +static gboolean user_widget_draw_usericon_gtk_2 (GtkWidget *widget, + GdkEventExpose *event, + gpointer user_data); + #endif G_DEFINE_TYPE (UserWidget, user_widget, GTK_TYPE_MENU_ITEM); @@ -174,6 +178,9 @@ user_widget_init (UserWidget *self) g_signal_connect_after (GTK_WIDGET(self), "expose-event", G_CALLBACK(user_widget_primitive_draw_cb), GTK_WIDGET(self)); + g_signal_connect_after (GTK_WIDGET(priv->user_image), "expose-event", + G_CALLBACK(user_widget_draw_usericon_gtk_2), + GTK_WIDGET(self)); #endif } @@ -252,6 +259,23 @@ user_widget_draw_usericon_gtk_3 (GtkWidget *widget, */ // GTK 2 Expose handler #else + +static gboolean +user_widget_draw_usericon_gtk_2 (GtkWidget *widget, + GdkEventExpose *event, + gpointer user_data) +{ + g_return_val_if_fail(IS_USER_WIDGET(user_data), FALSE); + UserWidget* meta = USER_WIDGET(user_data); + UserWidgetPrivate * priv = USER_WIDGET_GET_PRIVATE(meta); + + if (priv->using_personal_icon == FALSE) + return FALSE; + + draw_album_border (widget, FALSE); + return FALSE; +} + static gboolean user_widget_primitive_draw_cb (GtkWidget *widget, GdkEventExpose *event, @@ -273,6 +297,8 @@ user_widget_primitive_draw_cb (GtkWidget *widget, gdouble x, y; style = gtk_widget_get_style (widget); + + GtkAllocation allocation; gtk_widget_get_allocation (widget, &allocation); x = allocation.x + 13; -- cgit v1.2.3 From a7004c65b73ddf79a69b504a5e70227c32c75eeb Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 24 Aug 2011 10:36:58 +0100 Subject: fix that broken trunk --- src/user-menu-mgr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/user-menu-mgr.c b/src/user-menu-mgr.c index 588d3d0..e59dda8 100644 --- a/src/user-menu-mgr.c +++ b/src/user-menu-mgr.c @@ -49,6 +49,9 @@ static gint compare_users_by_username (const gchar *a, static void activate_online_accounts (DbusmenuMenuitem *mi, guint timestamp, gpointer user_data); +static void activate_user_accounts (DbusmenuMenuitem *mi, + guint timestamp, + gpointer user_data); static void user_menu_mgr_rebuild_items (UserMenuMgr *self, gboolean greeter_mode); static gboolean check_new_session (); -- cgit v1.2.3 From 5654480a85100da972d03729f7012c4402eb7e13 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 24 Aug 2011 12:45:58 +0100 Subject: fix the dot alignment in the gtk2s user widget --- src/user-widget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/user-widget.c b/src/user-widget.c index 1530967..937a9eb 100644 --- a/src/user-widget.c +++ b/src/user-widget.c @@ -302,7 +302,7 @@ user_widget_primitive_draw_cb (GtkWidget *widget, gtk_widget_get_allocation (widget, &allocation); x = allocation.x + 13; - y = allocation.height / 2; + y = allocation.y + allocation.height/2; cairo_arc (cr, x, y, 3.0, 0.0, 2 * G_PI);; -- cgit v1.2.3 From cbae3e05ba000358ad819566cfb46a847e424400 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 25 Aug 2011 10:57:03 +0100 Subject: fixed the translations --- src/udev-mgr.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/udev-mgr.c b/src/udev-mgr.c index 179e56f..7e51383 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -19,9 +19,6 @@ with this program. If not, see . #include -// TEMP -#include -#include #include #include "udev-mgr.h" @@ -250,11 +247,11 @@ udev_mgr_handle_webcam (UdevMgr* self, if (manufacturer != NULL){ gchar* lowered = g_ascii_strdown (manufacturer, -1); lowered[0] = g_ascii_toupper (lowered[0]); - gchar* label = g_strdup_printf("%s Webcam", lowered); + gchar* label = g_strdup_printf(_("%s Webcam"), lowered); g_free (lowered); dbusmenu_menuitem_property_set (self->webcam_item, DBUSMENU_MENUITEM_PROP_LABEL, - _(label)); + label); } g_hash_table_insert (self->webcams_present, @@ -379,11 +376,11 @@ static void udev_mgr_handle_scsi_device (UdevMgr* self, if (manufacturer != NULL){ gchar* lowered = g_ascii_strdown (manufacturer, -1); lowered[0] = g_ascii_toupper (lowered[0]); - gchar* label = g_strdup_printf("%s Scanner", lowered); + gchar* label = g_strdup_printf(_("%s Scanner"), lowered); g_free (lowered); dbusmenu_menuitem_property_set (self->scanner_item, DBUSMENU_MENUITEM_PROP_LABEL, - _(label)); + label); } g_hash_table_insert (self->scanners_present, g_strdup(vendor), @@ -448,11 +445,11 @@ udev_mgr_check_if_usb_device_is_supported (UdevMgr* self, gchar* lowered = g_ascii_strdown (manufacturer, -1); lowered[0] = g_ascii_toupper (lowered[0]); - gchar* label = g_strdup_printf("%s Scanner", lowered); + gchar* label = g_strdup_printf(_("%s Scanner"), lowered); g_free (lowered); dbusmenu_menuitem_property_set (self->scanner_item, DBUSMENU_MENUITEM_PROP_LABEL, - _(label)); + label); } g_hash_table_insert (self->scanners_present, -- cgit v1.2.3 From 29d61ee432bcb4351b0d9cf1084e6b9fec7f1707 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 25 Aug 2011 11:11:50 +0100 Subject: updated po files and bumped for beta release --- configure.ac | 2 +- po/POTFILES.in | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0240b9c..7d01e8a 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.2) +AM_INIT_AUTOMAKE(indicator-session, 0.3.3) AM_MAINTAINER_MODE diff --git a/po/POTFILES.in b/po/POTFILES.in index 44a2269..18b5d9b 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -14,3 +14,4 @@ src/session-service.c src/apt-watcher.c src/device-menu-mgr.c src/user-menu-mgr.c +src/udev-mgr.c -- cgit v1.2.3 From a8fbf33eb06441519330210519e37be6f8e0aed2 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 25 Aug 2011 14:46:09 +0100 Subject: bumped the dbusmenu version depends --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7d01e8a..d593997 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.3.91 +DBUSMENUGTK_REQUIRED_VERSION=0.4.92 POLKIT_REQUIRED_VERSION=0.92 AC_ARG_WITH([gtk], -- cgit v1.2.3 From 2f544054d628164039170de83d5cf1506d5b0103 Mon Sep 17 00:00:00 2001 From: Ken VanDine Date: Thu, 25 Aug 2011 09:54:54 -0400 Subject: releasing version 0.3.3-0ubuntu1 --- debian/changelog | 4 +++- debian/control | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index da83a06..35cdf8b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -indicator-session (0.3.3-0ubuntu1) UNRELEASED; urgency=low +indicator-session (0.3.3-0ubuntu1) oneiric; urgency=low * New upstream release. - User menu should still show even if there is only 1 user (LP: #831758) @@ -8,6 +8,8 @@ indicator-session (0.3.3-0ubuntu1) UNRELEASED; urgency=low - Users list in shutdown menu is not updated on user deletion (LP: #557608) - should use gsettings rather than gconf (LP: #656323) + * debian/control + - Bump dbusmenu build dep to >= 0.4.92 -- Ken VanDine Thu, 25 Aug 2011 08:58:56 -0400 diff --git a/debian/control b/debian/control index af1db07..b7b19de 100644 --- a/debian/control +++ b/debian/control @@ -12,9 +12,9 @@ Build-Depends: debhelper (>= 5.0), gnome-doc-utils, libindicator-dev (>= 0.3.90), libindicator3-dev (>= 0.3.90), - libdbusmenu-glib-dev (>= 0.3.90), - libdbusmenu-gtk-dev (>= 0.3.94), - libdbusmenu-gtk3-dev (>= 0.3.94), + libdbusmenu-glib-dev (>= 0.4.92), + libdbusmenu-gtk-dev (>= 0.4.92), + libdbusmenu-gtk3-dev (>= 0.4.92), libpolkit-gobject-1-dev, intltool Standards-Version: 3.9.2 -- cgit v1.2.3 From 5441c68c465cb69821e6307df24aecddbb571176 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 25 Aug 2011 17:05:41 +0100 Subject: protection against dodgy vendor ids provided by udev --- src/udev-mgr.c | 78 +++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 55 insertions(+), 23 deletions(-) diff --git a/src/udev-mgr.c b/src/udev-mgr.c index 7e51383..cf148e2 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -49,7 +49,9 @@ static void debug_device (UdevMgr* self, GUdevDevice* device, UdevMgrDeviceAction action); - +static gchar* format_device_name (UdevMgr* self, + gchar* brand, + gchar* type); struct _UdevMgr { GObject parent_instance; @@ -233,7 +235,7 @@ udev_mgr_handle_webcam (UdevMgr* self, product); dbusmenu_menuitem_property_set (self->webcam_item, DBUSMENU_MENUITEM_PROP_LABEL, - _("Webcams")); + _("Webcam")); } else { if (g_hash_table_lookup (self->webcams_present, product) != NULL){ @@ -245,13 +247,11 @@ udev_mgr_handle_webcam (UdevMgr* self, manufacturer = g_udev_device_get_property (device, "ID_VENDOR"); if (manufacturer != NULL){ - gchar* lowered = g_ascii_strdown (manufacturer, -1); - lowered[0] = g_ascii_toupper (lowered[0]); - gchar* label = g_strdup_printf(_("%s Webcam"), lowered); - g_free (lowered); dbusmenu_menuitem_property_set (self->webcam_item, DBUSMENU_MENUITEM_PROP_LABEL, - label); + format_device_name (self, + g_strdup(manufacturer), + "Webcam")); } g_hash_table_insert (self->webcams_present, @@ -307,7 +307,8 @@ debug_device (UdevMgr* self, g_debug("%s", propstr); }*/ } - +// TODO SCSI is not dynamic right ? +// i.e. just need to handle startup scan. static void udev_mgr_handle_scsi_device (UdevMgr* self, GUdevDevice* device, UdevMgrDeviceAction action) @@ -315,7 +316,19 @@ static void udev_mgr_handle_scsi_device (UdevMgr* self, const gchar* type = NULL; type = g_udev_device_get_property (device, "TYPE"); // apparently anything thats type 3 and SCSI is a Scanner - if (g_strcmp0 (type, "6") == 0){ + if (g_strcmp0 (type, "6") == 0 && action == ADD){ + + const gchar* manufacturer = NULL; + manufacturer = g_udev_device_get_property (device, "ID_VENDOR"); + + if (manufacturer != NULL){ + dbusmenu_menuitem_property_set (self->scanner_item, + DBUSMENU_MENUITEM_PROP_LABEL, + format_device_name (self, + g_strdup(manufacturer), + "Scanner")); + } + gchar* random_scanner_name = g_strdup_printf("%p--scanner", self); g_hash_table_insert (self->scanners_present, random_scanner_name, @@ -361,7 +374,7 @@ static void udev_mgr_handle_scsi_device (UdevMgr* self, g_hash_table_remove (self->scanners_present, vendor); dbusmenu_menuitem_property_set (self->scanner_item, DBUSMENU_MENUITEM_PROP_LABEL, - _("Scanners")); + _("Scanner")); } } @@ -374,13 +387,11 @@ static void udev_mgr_handle_scsi_device (UdevMgr* self, manufacturer = g_udev_device_get_property (device, "ID_VENDOR"); if (manufacturer != NULL){ - gchar* lowered = g_ascii_strdown (manufacturer, -1); - lowered[0] = g_ascii_toupper (lowered[0]); - gchar* label = g_strdup_printf(_("%s Scanner"), lowered); - g_free (lowered); dbusmenu_menuitem_property_set (self->scanner_item, DBUSMENU_MENUITEM_PROP_LABEL, - label); + format_device_name (self, + g_strdup(manufacturer), + "Scanner")); } g_hash_table_insert (self->scanners_present, g_strdup(vendor), @@ -397,7 +408,7 @@ udev_mgr_check_if_usb_device_is_supported (UdevMgr* self, UdevMgrDeviceAction action) { const gchar* vendor = NULL; - debug_device (self, device, action); + //debug_device (self, device, action); vendor = g_udev_device_get_property (device, "ID_VENDOR_ID"); @@ -430,7 +441,7 @@ udev_mgr_check_if_usb_device_is_supported (UdevMgr* self, g_hash_table_remove (self->scanners_present, vendor); dbusmenu_menuitem_property_set (self->scanner_item, DBUSMENU_MENUITEM_PROP_LABEL, - _("Scanners")); + _("Scanner")); } } else{ @@ -442,14 +453,12 @@ udev_mgr_check_if_usb_device_is_supported (UdevMgr* self, manufacturer = g_udev_device_get_property (device, "ID_VENDOR"); if (manufacturer != NULL){ - - gchar* lowered = g_ascii_strdown (manufacturer, -1); - lowered[0] = g_ascii_toupper (lowered[0]); - gchar* label = g_strdup_printf(_("%s Scanner"), lowered); - g_free (lowered); + dbusmenu_menuitem_property_set (self->scanner_item, DBUSMENU_MENUITEM_PROP_LABEL, - label); + format_device_name (self, + g_strdup(manufacturer), + "Scanner")); } g_hash_table_insert (self->scanners_present, @@ -502,3 +511,26 @@ UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner, } return mgr; } + +static gchar* format_device_name (UdevMgr* self, + gchar* brand, + gchar* type) +{ + // We don't want to accommodate long names + if (strlen(brand) > 7) + return type; + + gint i = 0; + + // If it contains something other than an alphabetic entry ignore it. + for(i = 0; i < sizeof(brand); i++){ + if ( !g_ascii_isalpha (brand[i]) ) + return type; + } + + gchar* lowered = g_ascii_strdown (brand, -1); + lowered[0] = g_ascii_toupper (lowered[0]); + gchar* label = g_strdup_printf(_("%s %s"), lowered, type); + g_free (lowered); + return label; +} -- cgit v1.2.3 From 9631736c86733243e55b82b6e3f0ce2bc8489d8c Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 25 Aug 2011 18:52:42 +0100 Subject: fix the min users bug plus guest label utf8 issue --- src/session-service.c | 2 +- src/user-menu-mgr.c | 48 +++++++++++++++++++++++------------------------- src/users-service-dbus.h | 2 +- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/session-service.c b/src/session-service.c index 753e304..e16832c 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -97,7 +97,7 @@ main (int argc, char ** argv) /* Setting up i18n and gettext. Apparently, we need all of these. */ - setlocale (LC_ALL, ""); + setlocale (LC_ALL, "C"); bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); textdomain (GETTEXT_PACKAGE); diff --git a/src/user-menu-mgr.c b/src/user-menu-mgr.c index 64b29c5..1b404d3 100644 --- a/src/user-menu-mgr.c +++ b/src/user-menu-mgr.c @@ -188,17 +188,29 @@ user_menu_mgr_rebuild_items (UserMenuMgr *self, gboolean greeter_mode) for (u = users; u != NULL; u = g_list_next (u)) { user = u->data; - g_debug ("%p: %s", user, user->real_name); + //g_debug ("%p: %s", user, user->real_name); user->service = self->users_dbus_interface; - + gboolean current_user = g_strcmp0 (user->user_name, g_get_user_name()) == 0; + if (current_user == TRUE){ + if (check_guest_session()){ + g_debug ("about to set the users real name to %s for user %s", + user->real_name, user->user_name); + session_dbus_set_users_real_name (self->session_dbus_interface, user->real_name); + } + else{ + g_debug ("about to set the users real name to GUEST"); + session_dbus_set_users_real_name (self->session_dbus_interface, + _("Guest")); + } + } + + if (g_strcmp0(user->user_name, "guest") == 0) { /* Check to see if the guest has sessions and so therefore should get a check mark. */ - if (user->sessions != NULL) { - dbusmenu_menuitem_property_set_bool (guest_mi, - USER_ITEM_PROP_LOGGED_IN, - TRUE); - } + dbusmenu_menuitem_property_set_bool (guest_mi, + USER_ITEM_PROP_LOGGED_IN, + user->sessions != NULL); /* If we're showing user accounts, keep going through the list */ if (self->user_count > MINIMUM_USERS && self->user_count < MAXIMUM_USERS) { continue; @@ -217,7 +229,7 @@ user_menu_mgr_rebuild_items (UserMenuMgr *self, gboolean greeter_mode) dbusmenu_menuitem_property_set (mi, USER_ITEM_PROP_NAME, conflictedname); g_free(conflictedname); } else { - g_debug ("%p: %s", user, user->real_name); + //g_debug ("%p: %s", user, user->real_name); dbusmenu_menuitem_property_set (mi, USER_ITEM_PROP_NAME, user->real_name); @@ -238,28 +250,14 @@ user_menu_mgr_rebuild_items (UserMenuMgr *self, gboolean greeter_mode) USER_ITEM_ICON_DEFAULT); } - gboolean logged_in = g_strcmp0 (user->user_name, g_get_user_name()) == 0; - g_debug ("user name = %s and g user name = %s", + /*g_debug ("user name = %s and g user name = %s", user->user_name, - g_get_user_name()); + g_get_user_name());*/ dbusmenu_menuitem_property_set_bool (mi, USER_ITEM_PROP_IS_CURRENT_USER, - logged_in); - if (logged_in == TRUE){ - if (check_guest_session()){ - g_debug ("about to set the users real name to %s for user %s", - user->real_name, user->user_name); - session_dbus_set_users_real_name (self->session_dbus_interface, user->real_name); - } - else{ - g_debug ("about to set the users real name to GUEST"); - session_dbus_set_users_real_name (self->session_dbus_interface, - _("Guest")); - } - } - + current_user); dbusmenu_menuitem_child_append (self->root_item, mi); g_signal_connect (G_OBJECT (mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, diff --git a/src/users-service-dbus.h b/src/users-service-dbus.h index c3f0171..4dbf2a4 100644 --- a/src/users-service-dbus.h +++ b/src/users-service-dbus.h @@ -57,7 +57,7 @@ struct _UserData /* XXX - MAXIMUM_USERS should be set to 7 once we've * got some gdm issues worked out. */ -#define MINIMUM_USERS 1 +#define MINIMUM_USERS 0 #define MAXIMUM_USERS 7 struct _UsersServiceDbus { -- cgit v1.2.3 From a32abfef82b1a109cfdd0859554d9e9b254711c4 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 25 Aug 2011 19:00:01 +0100 Subject: bump for next release --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d593997..8584c96 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.3) +AM_INIT_AUTOMAKE(indicator-session, 0.3.3.1) AM_MAINTAINER_MODE -- cgit v1.2.3 From 24faed74de6b156999ba0c444e60c52d84d84030 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 25 Aug 2011 13:42:14 -0500 Subject: Change the function to assume nothing about the parameters and always allocate a string --- src/udev-mgr.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/udev-mgr.c b/src/udev-mgr.c index cf148e2..edc2262 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -50,8 +50,9 @@ static void debug_device (UdevMgr* self, UdevMgrDeviceAction action); static gchar* format_device_name (UdevMgr* self, - gchar* brand, - gchar* type); + const gchar* brand, + const gchar* generic, + const gchar* branded) G_GNUC_WARN_UNUSED_RESULT; struct _UdevMgr { GObject parent_instance; @@ -247,11 +248,11 @@ udev_mgr_handle_webcam (UdevMgr* self, manufacturer = g_udev_device_get_property (device, "ID_VENDOR"); if (manufacturer != NULL){ + gchar * label = format_device_name(self, manufacturer, _("Webcam"), _("%s Webcam")); dbusmenu_menuitem_property_set (self->webcam_item, DBUSMENU_MENUITEM_PROP_LABEL, - format_device_name (self, - g_strdup(manufacturer), - "Webcam")); + label); + g_free(label); } g_hash_table_insert (self->webcams_present, @@ -322,11 +323,11 @@ static void udev_mgr_handle_scsi_device (UdevMgr* self, manufacturer = g_udev_device_get_property (device, "ID_VENDOR"); if (manufacturer != NULL){ + gchar * label = format_device_name(self, manufacturer, _("Scanner"), _("%s Scanner")); dbusmenu_menuitem_property_set (self->scanner_item, DBUSMENU_MENUITEM_PROP_LABEL, - format_device_name (self, - g_strdup(manufacturer), - "Scanner")); + label); + g_free(label); } gchar* random_scanner_name = g_strdup_printf("%p--scanner", self); @@ -387,11 +388,11 @@ static void udev_mgr_handle_scsi_device (UdevMgr* self, manufacturer = g_udev_device_get_property (device, "ID_VENDOR"); if (manufacturer != NULL){ + gchar * label = format_device_name(self, manufacturer, _("Scanner"), _("%s Scanner")); dbusmenu_menuitem_property_set (self->scanner_item, DBUSMENU_MENUITEM_PROP_LABEL, - format_device_name (self, - g_strdup(manufacturer), - "Scanner")); + label); + g_free(label); } g_hash_table_insert (self->scanners_present, g_strdup(vendor), @@ -453,12 +454,11 @@ udev_mgr_check_if_usb_device_is_supported (UdevMgr* self, manufacturer = g_udev_device_get_property (device, "ID_VENDOR"); if (manufacturer != NULL){ - + gchar * label = format_device_name(self, manufacturer, _("Scanner"), _("%s Scanner")); dbusmenu_menuitem_property_set (self->scanner_item, DBUSMENU_MENUITEM_PROP_LABEL, - format_device_name (self, - g_strdup(manufacturer), - "Scanner")); + label); + g_free(label); } g_hash_table_insert (self->scanners_present, @@ -513,24 +513,25 @@ UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner, } static gchar* format_device_name (UdevMgr* self, - gchar* brand, - gchar* type) + const gchar* brand, + const gchar* generic, + const gchar* branded) { // We don't want to accommodate long names if (strlen(brand) > 7) - return type; + return g_strdup(generic); gint i = 0; // If it contains something other than an alphabetic entry ignore it. for(i = 0; i < sizeof(brand); i++){ if ( !g_ascii_isalpha (brand[i]) ) - return type; + return g_strdup(generic); } gchar* lowered = g_ascii_strdown (brand, -1); lowered[0] = g_ascii_toupper (lowered[0]); - gchar* label = g_strdup_printf(_("%s %s"), lowered, type); + gchar* label = g_strdup_printf(branded, lowered); g_free (lowered); return label; } -- cgit v1.2.3 From f659aae78da79fe7f34b1943c51ac84de787f725 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 26 Aug 2011 11:17:26 +0100 Subject: fixed the translation bug --- configure.ac | 2 +- src/session-service.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 8584c96..8e5ed8b 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.3.1) +AM_INIT_AUTOMAKE(indicator-session, 0.3.3.2) AM_MAINTAINER_MODE diff --git a/src/session-service.c b/src/session-service.c index e16832c..753e304 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -97,7 +97,7 @@ main (int argc, char ** argv) /* Setting up i18n and gettext. Apparently, we need all of these. */ - setlocale (LC_ALL, "C"); + setlocale (LC_ALL, ""); bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); textdomain (GETTEXT_PACKAGE); -- cgit v1.2.3