aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzrignore10
-rw-r--r--Makefile.am29
-rw-r--r--data/Makefile.am24
-rw-r--r--data/com.canonical.indicator.session.gschema.xml.in6
-rw-r--r--data/indicator-session-lock-screen.desktop.in.in9
-rw-r--r--data/indicator-session-logout.desktop.in.in9
-rw-r--r--data/indicator-session-restart.desktop.in.in9
-rw-r--r--data/indicator-session-shutdown.desktop.in.in9
-rw-r--r--po/POTFILES.in4
-rw-r--r--src/dialog.c2
-rw-r--r--src/user-menu-mgr.c3
-rw-r--r--src/user-widget.c28
12 files changed, 134 insertions, 8 deletions
diff --git a/.bzrignore b/.bzrignore
index 3a062ec..f5b88f9 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -203,3 +203,13 @@ src/libsession_la-user-widget.lo
consolekit-seat-client.h
data/com.canonical.indicator.session.gschema.valid
data/com.canonical.indicator.session.gschema.xml
+indicator-session-shutdown.desktop
+indicator-session-shutdown.desktop.in
+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
+test-ascii-quotes
+test-space-ellipsis
diff --git a/Makefile.am b/Makefile.am
index 5850769..d63dac8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -35,8 +35,13 @@ dist-hook:
fi
TESTS = \
- test-ellipsis
+ test-ellipsis \
+ test-space-ellipsis \
+ test-ascii-quotes
+#####
+# 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 +49,26 @@ 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 \"Space before ellipsis found in user visible strings\" >&2 && exit 1" >> $@
+ @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)
diff --git a/data/Makefile.am b/data/Makefile.am
index 27328fb..7e851a7 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -18,13 +18,33 @@ gsettings_SCHEMAS = com.canonical.indicator.session.gschema.xml
convertdir = $(datadir)/GConf/gsettings
dist_convert_DATA = indicator-session.convert
+@INTLTOOL_DESKTOP_RULE@
+
+%.desktop.in: %.desktop.in.in
+ sed \
+ -e "s|\@libexecdir\@|$(libexecdir)|" \
+ -e "s|\@bindir\@|$(bindir)|" \
+ $< > $@
+
+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
+
+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) \
- $(gsettings_SCHEMAS:.xml=.xml.in)
+ $(gsettings_SCHEMAS:.xml=.xml.in) \
+ $(logout_helper_desktop_in_in_files)
CLEANFILES = \
$(dbus_services_DATA) \
- $(gsettings_SCHEMAS)
+ $(gsettings_SCHEMAS) \
+ $(logout_helper_desktop_files)
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 @@
<key name="suppress-logout-menuitem" type="b">
<default>false</default>
<_summary>Remove the Log Out item from the session menu</_summary>
- <_description>Makes it so that the logout button doesn't show in the session menu.</_description>
+ <_description>Makes it so that the logout button doesn’t show in the session menu.</_description>
</key>
<key name="suppress-restart-menuitem" type="b">
<default>false</default>
<_summary>Remove the Restart item from the session menu</_summary>
- <_description>Makes it so that the restart button doesn't show in the session menu.</_description>
+ <_description>Makes it so that the restart button doesn’t show in the session menu.</_description>
</key>
<key name="suppress-shutdown-menuitem" type="b">
<default>false</default>
<_summary>Remove the shutdown item from the session menu</_summary>
- <_description>Makes it so that the shutdown button doesn't show in the session menu.</_description>
+ <_description>Makes it so that the shutdown button doesn’t show in the session menu.</_description>
</key>
</schema>
</schemalist>
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/data/indicator-session-logout.desktop.in.in b/data/indicator-session-logout.desktop.in.in
new file mode 100644
index 0000000..46ba087
--- /dev/null
+++ b/data/indicator-session-logout.desktop.in.in
@@ -0,0 +1,9 @@
+[Desktop Entry]
+_Name=Log Out
+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
new file mode 100644
index 0000000..67aa390
--- /dev/null
+++ b/data/indicator-session-restart.desktop.in.in
@@ -0,0 +1,9 @@
+[Desktop Entry]
+_Name=Restart
+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
new file mode 100644
index 0000000..4bd51fe
--- /dev/null
+++ b/data/indicator-session-shutdown.desktop.in.in
@@ -0,0 +1,9 @@
+[Desktop Entry]
+_Name=Shut Down
+TryExec=@libexecdir@/gtk-logout-helper
+Exec=@libexecdir@/gtk-logout-helper --shutdown
+Icon=system-shutdown
+Terminal=false
+Type=Application
+OnlyShowIn=Unity;
+Version=1.0
diff --git a/po/POTFILES.in b/po/POTFILES.in
index df89ec9..44a2269 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,10 @@
[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
src/settings-helper.c
src/lock-helper.c
src/gtk-logout-helper.c
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",
diff --git a/src/user-menu-mgr.c b/src/user-menu-mgr.c
index aa02b01..64b29c5 100644
--- a/src/user-menu-mgr.c
+++ b/src/user-menu-mgr.c
@@ -44,6 +44,9 @@ static void activate_new_session (DbusmenuMenuitem * mi,
static void activate_user_session (DbusmenuMenuitem *mi,
guint timestamp,
gpointer user_data);
+static void activate_user_accounts (DbusmenuMenuitem *mi,
+ guint timestamp,
+ gpointer user_data);
static gint compare_users_by_username (const gchar *a,
const gchar *b);
static void activate_online_accounts (DbusmenuMenuitem *mi,
diff --git a/src/user-widget.c b/src/user-widget.c
index a3ad1e4..937a9eb 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,10 +297,12 @@ 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;
- y = allocation.height / 2;
+ y = allocation.y + allocation.height/2;
cairo_arc (cr, x, y, 3.0, 0.0, 2 * G_PI);;