aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am3
-rw-r--r--configure.ac33
-rw-r--r--po/POTFILES.in14
-rw-r--r--src/indicator-session.c2
-rw-r--r--src/session-service.c24
-rw-r--r--src/status-service.c22
-rw-r--r--src/users-service.c4
7 files changed, 74 insertions, 28 deletions
diff --git a/Makefile.am b/Makefile.am
index f63afb4..0233fbf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,8 @@
SUBDIRS = \
src \
- data
+ data \
+ po
EXTRA_DIST = COPYING.LGPL
diff --git a/configure.ac b/configure.ac
index 5c5fbe1..1d42cb0 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.1)
+AM_INIT_AUTOMAKE(indicator-session, 0.1.1)
AM_MAINTAINER_MODE
@@ -27,7 +27,7 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
GTK_REQUIRED_VERSION=2.12
INDICATOR_REQUIRED_VERSION=0.2.0
-DBUSMENUGTK_REQUIRED_VERSION=0.1.0
+DBUSMENUGTK_REQUIRED_VERSION=0.1.1
PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION
indicator >= $INDICATOR_REQUIRED_VERSION
@@ -35,7 +35,7 @@ PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION
AC_SUBST(APPLET_CFLAGS)
AC_SUBST(APPLET_LIBS)
-DBUSMENUGLIB_REQUIRED_VERSION=0.0.0
+DBUSMENUGLIB_REQUIRED_VERSION=0.1.1
PKG_CHECK_MODULES(STATUSSERVICE, dbusmenu-glib >= $DBUSMENUGLIB_REQUIRED_VERSION)
@@ -100,6 +100,33 @@ else
fi
AC_SUBST(DBUSSERVICEDIR)
+##############################
+# Custom Junk
+##############################
+
+AC_DEFUN([AC_DEFINE_PATH], [
+ test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+ ac_define_path=`eval echo [$]$2`
+ ac_define_path=`eval echo [$]ac_define_path`
+ $1="$ac_define_path"
+ AC_SUBST($1)
+ ifelse($3, ,
+ AC_DEFINE_UNQUOTED($1, "$ac_define_path"),
+ AC_DEFINE_UNQUOTED($1, "$ac_define_path", $3))
+])
+
+###########################
+# Internationalization
+###########################
+
+GETTEXT_PACKAGE=indicator-session
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the default get text domain])
+AC_DEFINE_PATH(GNOMELOCALEDIR, "${datadir}/locale", [locale directory])
+
+AM_GLIB_GNU_GETTEXT
+
###########################
# Files
###########################
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..e3d4a5e
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,14 @@
+[encoding: UTF-8]
+data/indicator-session.schemas.in
+src/gtk-dialog/ck-pk-helper.c
+src/gtk-dialog/gconf-helper.c
+src/gtk-dialog/gtk-logout-helper.c
+src/gtk-dialog/logout-dialog.c
+src/indicator-session.c
+src/session-service.c
+src/status-provider.c
+src/status-provider-pidgin.c
+src/status-provider-telepathy.c
+src/status-service.c
+src/status-service-dbus.c
+src/users-service.c
diff --git a/src/indicator-session.c b/src/indicator-session.c
index 43c568f..8a4e298 100644
--- a/src/indicator-session.c
+++ b/src/indicator-session.c
@@ -367,7 +367,7 @@ build_users_menu (gpointer userdata)
}
if (!org_freedesktop_DBus_start_service_by_name (proxy, INDICATOR_USERS_DBUS_NAME, 0, &returnval, &error)) {
- g_error("Unable to send message to DBus to start service: %s", error != NULL ? error->message : "(NULL error)" );
+ g_error("Unable to send message to DBus to start service");
g_error_free(error);
return FALSE;
}
diff --git a/src/session-service.c b/src/session-service.c
index 0e89fed..9e5cbb2 100644
--- a/src/session-service.c
+++ b/src/session-service.c
@@ -84,7 +84,7 @@ suspend_prop_cb (DBusGProxy * proxy, DBusGProxyCall * call, gpointer userdata)
g_debug("Got Suspend: %s", g_value_get_boolean(&candoit) ? "true" : "false");
if (suspend_mi != NULL) {
- dbusmenu_menuitem_property_set(suspend_mi, "visible", g_value_get_boolean(&candoit) ? "true" : "false");
+ dbusmenu_menuitem_property_set(suspend_mi, DBUSMENU_MENUITEM_PROP_VISIBLE, g_value_get_boolean(&candoit) ? "true" : "false");
}
return;
@@ -107,7 +107,7 @@ hibernate_prop_cb (DBusGProxy * proxy, DBusGProxyCall * call, gpointer userdata)
g_debug("Got Hibernate: %s", g_value_get_boolean(&candoit) ? "true" : "false");
if (suspend_mi != NULL) {
- dbusmenu_menuitem_property_set(hibernate_mi, "visible", g_value_get_boolean(&candoit) ? "true" : "false");
+ dbusmenu_menuitem_property_set(hibernate_mi, DBUSMENU_MENUITEM_PROP_VISIBLE, g_value_get_boolean(&candoit) ? "true" : "false");
}
return;
@@ -226,39 +226,39 @@ create_items (DbusmenuMenuitem * root) {
mi = dbusmenu_menuitem_new();
if (supress_confirmations()) {
- dbusmenu_menuitem_property_set(mi, "label", _("Log Out"));
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Log Out"));
} else {
- dbusmenu_menuitem_property_set(mi, "label", _("Log Out ..."));
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Log Out ..."));
}
dbusmenu_menuitem_child_append(root, mi);
g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "logout");
suspend_mi = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set(suspend_mi, "visible", "false");
- dbusmenu_menuitem_property_set(suspend_mi, "label", _("Suspend"));
+ dbusmenu_menuitem_property_set(suspend_mi, DBUSMENU_MENUITEM_PROP_VISIBLE, "false");
+ dbusmenu_menuitem_property_set(suspend_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Suspend"));
dbusmenu_menuitem_child_append(root, suspend_mi);
g_signal_connect(G_OBJECT(suspend_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(sleep), "Suspend");
hibernate_mi = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set(hibernate_mi, "visible", "false");
- dbusmenu_menuitem_property_set(hibernate_mi, "label", _("Hibernate"));
+ dbusmenu_menuitem_property_set(hibernate_mi, DBUSMENU_MENUITEM_PROP_VISIBLE, "false");
+ dbusmenu_menuitem_property_set(hibernate_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Hibernate"));
dbusmenu_menuitem_child_append(root, hibernate_mi);
g_signal_connect(G_OBJECT(hibernate_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(sleep), "Hibernate");
mi = dbusmenu_menuitem_new();
if (supress_confirmations()) {
- dbusmenu_menuitem_property_set(mi, "label", _("Restart"));
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart"));
} else {
- dbusmenu_menuitem_property_set(mi, "label", _("Restart ..."));
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart ..."));
}
dbusmenu_menuitem_child_append(root, mi);
g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "restart");
mi = dbusmenu_menuitem_new();
if (supress_confirmations()) {
- dbusmenu_menuitem_property_set(mi, "label", _("Shutdown"));
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown"));
} else {
- dbusmenu_menuitem_property_set(mi, "label", _("Shutdown ..."));
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown ..."));
}
dbusmenu_menuitem_child_append(root, mi);
g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "shutdown");
diff --git a/src/status-service.c b/src/status-service.c
index 14d8a34..b210dcd 100644
--- a/src/status-service.c
+++ b/src/status-service.c
@@ -30,6 +30,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-bindings.h>
+#include <libdbusmenu-glib/client.h>
#include <libdbusmenu-glib/server.h>
#include <libdbusmenu-glib/menuitem.h>
@@ -88,7 +89,7 @@ status_update (void) {
if (global_status != oldglobal) {
g_debug("Global status changed to: %s", _(status_strings[global_status]));
- dbusmenu_menuitem_property_set(status_menuitem, "label", _(status_strings[global_status]));
+ dbusmenu_menuitem_property_set(status_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[global_status]));
status_service_dbus_set_status(dbus_interface, status_icons[global_status]);
}
@@ -165,10 +166,12 @@ build_user_item (DbusmenuMenuitem * root)
while (*walker != '\0' && *walker != ',') { walker++; }
*walker = '\0';
- DbusmenuMenuitem * useritem = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set(useritem, "label", name);
- dbusmenu_menuitem_property_set(useritem, "sensitive", "false");
- dbusmenu_menuitem_child_append(root, useritem);
+ if (name[0] != '\0') {
+ DbusmenuMenuitem * useritem = dbusmenu_menuitem_new();
+ dbusmenu_menuitem_property_set(useritem, DBUSMENU_MENUITEM_PROP_LABEL, name);
+ dbusmenu_menuitem_property_set(useritem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "false");
+ dbusmenu_menuitem_child_append(root, useritem);
+ }
g_free(name);
} else {
@@ -187,15 +190,16 @@ build_menu (gpointer data)
build_user_item(root);
status_menuitem = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set(status_menuitem, "label", _(status_strings[global_status]));
+ dbusmenu_menuitem_property_set(status_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[global_status]));
dbusmenu_menuitem_child_append(root, status_menuitem);
StatusProviderStatus i;
for (i = STATUS_PROVIDER_STATUS_ONLINE; i < STATUS_PROVIDER_STATUS_LAST; i++) {
DbusmenuMenuitem * mi = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set(mi, "label", _(status_strings[i]));
- dbusmenu_menuitem_property_set(mi, "icon", status_icons[i]);
+ dbusmenu_menuitem_property_set(mi, "type", DBUSMENU_CLIENT_TYPES_IMAGE);
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[i]));
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_ICON, status_icons[i]);
g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(status_menu_click), GINT_TO_POINTER(i));
dbusmenu_menuitem_child_append(status_menuitem, mi);
@@ -204,7 +208,7 @@ build_menu (gpointer data)
}
DbusmenuMenuitem * mi = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set(mi, "label", _("Lock Screen"));
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen"));
g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(lock_screen), GINT_TO_POINTER(i));
dbusmenu_menuitem_child_append(root, mi);
diff --git a/src/users-service.c b/src/users-service.c
index 9ada91f..5db832b 100644
--- a/src/users-service.c
+++ b/src/users-service.c
@@ -113,14 +113,14 @@ create_items (DbusmenuMenuitem * root) {
if (check_guest_session()) {
mi = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set(mi, "label", _("Guest Session"));
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Guest Session"));
dbusmenu_menuitem_child_append(root, mi);
g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_guest_session), NULL);
}
if (check_new_session()) {
mi = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set(mi, "label", _("New Session..."));
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("New Session..."));
dbusmenu_menuitem_child_append(root, mi);
g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_new_session), NULL);
}