aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gtk-dialog/gtk-logout-helper.c8
-rw-r--r--src/session-service.c11
-rw-r--r--src/status-service.c45
-rw-r--r--src/users-service.c42
4 files changed, 66 insertions, 40 deletions
diff --git a/src/gtk-dialog/gtk-logout-helper.c b/src/gtk-dialog/gtk-logout-helper.c
index e6a9ef8..0c03e86 100644
--- a/src/gtk-dialog/gtk-logout-helper.c
+++ b/src/gtk-dialog/gtk-logout-helper.c
@@ -21,7 +21,7 @@ You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
+#include <config.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <dbus/dbus-glib.h>
@@ -121,6 +121,12 @@ main (int argc, char * argv[])
{
gtk_init(&argc, &argv);
+ /* Setting up i18n and gettext. Apparently, we need
+ all of these. */
+ setlocale (LC_ALL, "");
+ bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
+ textdomain (GETTEXT_PACKAGE);
+
GError * error = NULL;
GOptionContext * context = g_option_context_new(" - logout of the current session");
g_option_context_add_main_entries(context, options, "gtk-logout-helper");
diff --git a/src/session-service.c b/src/session-service.c
index 59a3a97..9c3c4ef 100644
--- a/src/session-service.c
+++ b/src/session-service.c
@@ -21,6 +21,7 @@ You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <config.h>
#include <glib/gi18n.h>
@@ -258,9 +259,9 @@ create_items (DbusmenuMenuitem * root) {
shutdown_mi = dbusmenu_menuitem_new();
if (supress_confirmations()) {
- dbusmenu_menuitem_property_set(shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown"));
+ dbusmenu_menuitem_property_set(shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shut Down"));
} else {
- dbusmenu_menuitem_property_set(shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown..."));
+ dbusmenu_menuitem_property_set(shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shut Down..."));
}
dbusmenu_menuitem_child_append(root, shutdown_mi);
g_signal_connect(G_OBJECT(shutdown_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "shutdown");
@@ -282,6 +283,12 @@ main (int argc, char ** argv)
{
g_type_init();
+ /* Setting up i18n and gettext. Apparently, we need
+ all of these. */
+ setlocale (LC_ALL, "");
+ bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
+ textdomain (GETTEXT_PACKAGE);
+
DBusGConnection * connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
GError * error = NULL;
diff --git a/src/status-service.c b/src/status-service.c
index d8f60d4..0cb9185 100644
--- a/src/status-service.c
+++ b/src/status-service.c
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <config.h>
#include <sys/types.h>
#include <pwd.h>
@@ -60,7 +61,7 @@ static const gchar * status_strings [STATUS_PROVIDER_STATUS_LAST] = {
};
static const gchar * status_icons[STATUS_PROVIDER_STATUS_LAST] = {
- /* STATUS_PROVIDER_STATUS_ONLINE, */ "user-online",
+ /* STATUS_PROVIDER_STATUS_ONLINE, */ "user-available",
/* STATUS_PROVIDER_STATUS_AWAY, */ "user-away",
/* STATUS_PROVIDER_STATUS_DND, */ "user-busy",
/* STATUS_PROVIDER_STATUS_INVISIBLE, */ "user-invisible",
@@ -95,8 +96,6 @@ status_update (void) {
if (global_status != oldglobal) {
g_debug("Global status changed to: %s", _(status_strings[global_status]));
- /* Set the status name on the menu item */
- dbusmenu_menuitem_property_set(status_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[global_status]));
/* Configure the icon on the panel */
status_service_dbus_set_status(dbus_interface, status_icons[global_status]);
@@ -124,33 +123,6 @@ status_update (void) {
return;
}
-/* A fun little function to actually lock the screen. If,
- that's what you want, let's do it! */
-static void
-lock_screen (DbusmenuMenuitem * mi, gpointer data)
-{
- g_debug("Lock Screen");
-
- DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
- g_return_if_fail(session_bus != NULL);
-
- DBusGProxy * proxy = dbus_g_proxy_new_for_name_owner(session_bus,
- "org.gnome.ScreenSaver",
- "/",
- "org.gnome.ScreenSaver",
- NULL);
- g_return_if_fail(proxy != NULL);
-
- dbus_g_proxy_call_no_reply(proxy,
- "Lock",
- G_TYPE_INVALID,
- G_TYPE_INVALID);
-
- g_object_unref(proxy);
-
- return;
-}
-
static void
status_menu_click (DbusmenuMenuitem * mi, gpointer data)
{
@@ -218,7 +190,7 @@ build_menu (gpointer data)
build_user_item(root);
status_menuitem = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set(status_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[global_status]));
+ dbusmenu_menuitem_property_set(status_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Set Status"));
dbusmenu_menuitem_child_append(root, status_menuitem);
StatusProviderStatus i;
@@ -244,11 +216,6 @@ build_menu (gpointer data)
g_debug("Built %s", status_strings[i]);
}
- DbusmenuMenuitem * mi = dbusmenu_menuitem_new();
- 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);
-
return FALSE;
}
@@ -257,6 +224,12 @@ main (int argc, char ** argv)
{
g_type_init();
+ /* Setting up i18n and gettext. Apparently, we need
+ all of these. */
+ setlocale (LC_ALL, "");
+ bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
+ textdomain (GETTEXT_PACKAGE);
+
DBusGConnection * connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
GError * error = NULL;
diff --git a/src/users-service.c b/src/users-service.c
index 5db832b..7ad1732 100644
--- a/src/users-service.c
+++ b/src/users-service.c
@@ -20,6 +20,8 @@ You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <config.h>
+
#include <unistd.h>
#include <glib/gi18n.h>
@@ -107,10 +109,42 @@ activate_new_session (DbusmenuMenuitem * mi, gpointer user_data)
return;
}
+/* A fun little function to actually lock the screen. If,
+ that's what you want, let's do it! */
+static void
+lock_screen (DbusmenuMenuitem * mi, gpointer data)
+{
+ g_debug("Lock Screen");
+
+ DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
+ g_return_if_fail(session_bus != NULL);
+
+ DBusGProxy * proxy = dbus_g_proxy_new_for_name_owner(session_bus,
+ "org.gnome.ScreenSaver",
+ "/",
+ "org.gnome.ScreenSaver",
+ NULL);
+ g_return_if_fail(proxy != NULL);
+
+ dbus_g_proxy_call_no_reply(proxy,
+ "Lock",
+ G_TYPE_INVALID,
+ G_TYPE_INVALID);
+
+ g_object_unref(proxy);
+
+ return;
+}
+
static void
create_items (DbusmenuMenuitem * root) {
DbusmenuMenuitem * mi = NULL;
+ mi = dbusmenu_menuitem_new();
+ 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), NULL);
+ dbusmenu_menuitem_child_append(root, mi);
+
if (check_guest_session()) {
mi = dbusmenu_menuitem_new();
dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Guest Session"));
@@ -120,7 +154,7 @@ create_items (DbusmenuMenuitem * root) {
if (check_new_session()) {
mi = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("New Session..."));
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Switch User..."));
dbusmenu_menuitem_child_append(root, mi);
g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_new_session), NULL);
}
@@ -133,6 +167,12 @@ main (int argc, char ** argv)
{
g_type_init();
+ /* Setting up i18n and gettext. Apparently, we need
+ all of these. */
+ setlocale (LC_ALL, "");
+ bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
+ textdomain (GETTEXT_PACKAGE);
+
session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
bus_proxy = dbus_g_proxy_new_for_name(session_bus, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
GError * error = NULL;