Logging out is now supported in embedded mode (but disabled by default)

This commit is contained in:
Pierre Pronchery 2013-07-20 05:17:16 +02:00
parent 00e6223895
commit 31d57a04fe
6 changed files with 44 additions and 40 deletions

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Panel 0.2.18\n" "Project-Id-Version: Panel 0.2.18\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-07-20 05:00+0200\n" "POT-Creation-Date: 2013-07-20 05:17+0200\n"
"PO-Revision-Date: 2010-04-22 12:45+0200\n" "PO-Revision-Date: 2010-04-22 12:45+0200\n"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n" "Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: French\n" "Language-Team: French\n"
@ -25,7 +25,7 @@ msgstr "Afficher le niveau de batterie"
msgid "Unknown" msgid "Unknown"
msgstr "Inconnu" msgstr "Inconnu"
#: ../src/applets/battery.c:271 ../src/panel.c:460 ../src/panel.c:465 #: ../src/applets/battery.c:271 ../src/panel.c:463 ../src/panel.c:468
#: ../src/run.c:216 ../src/run.c:222 #: ../src/run.c:216 ../src/run.c:222
msgid "Error" msgid "Error"
msgstr "Erreur" msgstr "Erreur"
@ -120,8 +120,8 @@ msgstr "Verrouiller l'écran"
msgid "logout: Logging out is disabled" msgid "logout: Logging out is disabled"
msgstr "logout: Se déconnecter est désactivé" msgstr "logout: Se déconnecter est désactivé"
#: ../src/applets/logout.c:79 ../src/helper.c:189 ../src/helper.c:201 #: ../src/applets/logout.c:79 ../src/helper.c:186 ../src/helper.c:198
#: ../src/helper.c:210 #: ../src/helper.c:207
msgid "Logout" msgid "Logout"
msgstr "Déconnexion" msgstr "Déconnexion"
@ -221,15 +221,15 @@ msgstr "Maximiser"
msgid "USB networking device connected" msgid "USB networking device connected"
msgstr "Périphérique réseau USB connecté" msgstr "Périphérique réseau USB connecté"
#: ../src/helper.c:111 #: ../src/helper.c:109
msgid "Panel for the DeforaOS desktop" msgid "Panel for the DeforaOS desktop"
msgstr "Panel pour l'environnement DeforaOS" msgstr "Panel pour l'environnement DeforaOS"
#: ../src/helper.c:119 #: ../src/helper.c:117
msgid "translator-credits" msgid "translator-credits"
msgstr "Pierre Pronchery <khorben@defora.org>" msgstr "Pierre Pronchery <khorben@defora.org>"
#: ../src/helper.c:175 #: ../src/helper.c:172
msgid "" msgid ""
"This will log you out of the current session, therefore closing any " "This will log you out of the current session, therefore closing any "
"application currently opened and losing any unsaved data.\n" "application currently opened and losing any unsaved data.\n"
@ -240,7 +240,7 @@ msgstr ""
"sauvegardées.\n" "sauvegardées.\n"
"Voulez-vous continuer?" "Voulez-vous continuer?"
#: ../src/helper.c:332 #: ../src/helper.c:328
msgid "" msgid ""
"This will shutdown your device, therefore closing any application currently " "This will shutdown your device, therefore closing any application currently "
"opened and losing any unsaved data.\n" "opened and losing any unsaved data.\n"
@ -251,7 +251,7 @@ msgstr ""
"sauvegardées.\n" "sauvegardées.\n"
"Voulez-vous continuer?" "Voulez-vous continuer?"
#: ../src/helper.c:337 #: ../src/helper.c:333
msgid "" msgid ""
"This will shutdown your computer, therefore closing any application " "This will shutdown your computer, therefore closing any application "
"currently opened and losing any unsaved data.\n" "currently opened and losing any unsaved data.\n"
@ -262,11 +262,11 @@ msgstr ""
"sauvegardées.\n" "sauvegardées.\n"
"Voulez-vous continuer?" "Voulez-vous continuer?"
#: ../src/helper.c:352 ../src/helper.c:364 ../src/helper.c:373 #: ../src/helper.c:348 ../src/helper.c:360 ../src/helper.c:369
msgid "Shutdown" msgid "Shutdown"
msgstr "Arrêter" msgstr "Arrêter"
#: ../src/helper.c:363 #: ../src/helper.c:359
msgid "Restart" msgid "Restart"
msgstr "Redémarrer" msgstr "Redémarrer"
@ -284,51 +284,51 @@ msgstr ""
" -x\tIcônes de la taille de menus\n" " -x\tIcônes de la taille de menus\n"
" -m\tMoniteur à utiliser (par défaut : 0)\n" " -m\tMoniteur à utiliser (par défaut : 0)\n"
#: ../src/panel.c:113 #: ../src/panel.c:111
msgid "Large" msgid "Large"
msgstr "Grande" msgstr "Grande"
#: ../src/panel.c:115 #: ../src/panel.c:113
msgid "Small" msgid "Small"
msgstr "Petite" msgstr "Petite"
#: ../src/panel.c:117 #: ../src/panel.c:115
msgid "Smaller" msgid "Smaller"
msgstr "Très petite" msgstr "Très petite"
#: ../src/panel.c:588 #: ../src/panel.c:591
msgid "Panel preferences" msgid "Panel preferences"
msgstr "Préférences du Panel" msgstr "Préférences du Panel"
#: ../src/panel.c:604 #: ../src/panel.c:607
msgid "General" msgid "General"
msgstr "Général" msgstr "Général"
#: ../src/panel.c:608 #: ../src/panel.c:611
msgid "Applets" msgid "Applets"
msgstr "Greffons" msgstr "Greffons"
#: ../src/panel.c:637 #: ../src/panel.c:640
msgid "Applets:" msgid "Applets:"
msgstr "Greffons :" msgstr "Greffons :"
#: ../src/panel.c:717 #: ../src/panel.c:720
msgid "Top panel:" msgid "Top panel:"
msgstr "Panneau supérieur :" msgstr "Panneau supérieur :"
#: ../src/panel.c:723 ../src/panel.c:727 ../src/panel.c:758 ../src/panel.c:762 #: ../src/panel.c:726 ../src/panel.c:730 ../src/panel.c:761 ../src/panel.c:765
msgid "Default" msgid "Default"
msgstr "Par défaut" msgstr "Par défaut"
#: ../src/panel.c:752 #: ../src/panel.c:755
msgid "Bottom panel:" msgid "Bottom panel:"
msgstr "Panneau inférieur :" msgstr "Panneau inférieur :"
#: ../src/panel.c:859 #: ../src/panel.c:862
msgid "Accept focus" msgid "Accept focus"
msgstr "Autoriser le focus" msgstr "Autoriser le focus"
#: ../src/panel.c:863 #: ../src/panel.c:866
msgid "Keep above other windows" msgid "Keep above other windows"
msgstr "Conserver au dessus des fenêtres" msgstr "Conserver au dessus des fenêtres"
@ -384,7 +384,7 @@ msgstr "Usage: run\n"
msgid "Invalid panel size" msgid "Invalid panel size"
msgstr "Taille invalide pour le panel" msgstr "Taille invalide pour le panel"
#: ../tools/notify.c:168 #: ../tools/notify.c:166
msgid "" msgid ""
"Usage: panel-notify [-L|-S|-X|-x][-t timeout] applet...\n" "Usage: panel-notify [-L|-S|-X|-x][-t timeout] applet...\n"
" panel-notify -l\n" " panel-notify -l\n"
@ -404,7 +404,7 @@ msgstr ""
" -t\tDurée d'affichage (0 : illimité)\n" " -t\tDurée d'affichage (0 : illimité)\n"
" -l\tLister les applets disponibles\n" " -l\tLister les applets disponibles\n"
#: ../tools/test.c:139 #: ../tools/test.c:137
msgid "" msgid ""
"Usage: panel-test [-L|-S|-X|-x] applet...\n" "Usage: panel-test [-L|-S|-X|-x] applet...\n"
" panel-test -l\n" " panel-test -l\n"

View File

@ -42,9 +42,7 @@ static int _panel_helper_config_set(Panel * panel, char const * section,
static int _panel_helper_error(Panel * panel, char const * message, int ret); static int _panel_helper_error(Panel * panel, char const * message, int ret);
static void _panel_helper_about_dialog(Panel * panel); static void _panel_helper_about_dialog(Panel * panel);
static int _panel_helper_lock(Panel * panel); static int _panel_helper_lock(Panel * panel);
#ifndef EMBEDDED
static void _panel_helper_logout_dialog(Panel * panel); static void _panel_helper_logout_dialog(Panel * panel);
#endif
#ifndef HELPER_POSITION_MENU_WIDGET #ifndef HELPER_POSITION_MENU_WIDGET
static void _panel_helper_position_menu(Panel * panel, GtkMenu * menu, gint * x, static void _panel_helper_position_menu(Panel * panel, GtkMenu * menu, gint * x,
gint * y, gboolean * push_in, PanelPosition position); gint * y, gboolean * push_in, PanelPosition position);
@ -165,7 +163,6 @@ static gboolean _lock_on_idle(gpointer data)
} }
#ifndef EMBEDDED
/* panel_helper_logout_dialog */ /* panel_helper_logout_dialog */
static gboolean _logout_dialog_on_closex(gpointer data); static gboolean _logout_dialog_on_closex(gpointer data);
static void _logout_dialog_on_response(GtkWidget * widget, gint response); static void _logout_dialog_on_response(GtkWidget * widget, gint response);
@ -235,7 +232,6 @@ static void _logout_dialog_on_response(GtkWidget * widget, gint response)
#endif #endif
} }
} }
#endif
#ifndef HELPER_POSITION_MENU_WIDGET #ifndef HELPER_POSITION_MENU_WIDGET

View File

@ -88,9 +88,7 @@ struct _Panel
/* dialogs */ /* dialogs */
GtkWidget * ab_window; GtkWidget * ab_window;
#ifndef EMBEDDED
GtkWidget * lo_window; GtkWidget * lo_window;
#endif
GtkWidget * sh_window; GtkWidget * sh_window;
}; };
@ -171,10 +169,15 @@ Panel * panel_new(PanelPrefs const * prefs)
panel->top_helper.about_dialog = _panel_helper_about_dialog; panel->top_helper.about_dialog = _panel_helper_about_dialog;
panel->top_helper.lock = _panel_helper_lock; panel->top_helper.lock = _panel_helper_lock;
#ifndef EMBEDDED #ifndef EMBEDDED
panel->top_helper.logout_dialog = _panel_helper_logout_dialog; if((p = config_get(panel->config, NULL, "logout")) == NULL
|| strtol(p, NULL, 0) != 0)
#else #else
panel->top_helper.logout_dialog = NULL; if((p = config_get(panel->config, NULL, "logout")) != NULL
&& strtol(p, NULL, 0) != 0)
#endif #endif
panel->top_helper.logout_dialog = _panel_helper_logout_dialog;
else
panel->top_helper.logout_dialog = NULL;
panel->top_helper.position_menu = _panel_helper_position_menu_top; panel->top_helper.position_menu = _panel_helper_position_menu_top;
panel->top_helper.preferences_dialog = _panel_helper_preferences_dialog; panel->top_helper.preferences_dialog = _panel_helper_preferences_dialog;
panel->top_helper.rotate_screen = _panel_helper_rotate_screen; panel->top_helper.rotate_screen = _panel_helper_rotate_screen;

View File

@ -53,9 +53,7 @@ struct _Panel
/* dialogs */ /* dialogs */
GtkWidget * ab_window; GtkWidget * ab_window;
#ifndef EMBEDDED
GtkWidget * lo_window; GtkWidget * lo_window;
#endif
GtkWidget * sh_window; GtkWidget * sh_window;
}; };
@ -179,6 +177,8 @@ static int _error(char const * message, int ret)
static void _helper_init(PanelAppletHelper * helper, Panel * panel, static void _helper_init(PanelAppletHelper * helper, Panel * panel,
PanelAppletType type, GtkIconSize iconsize) PanelAppletType type, GtkIconSize iconsize)
{ {
char const * p;
memset(helper, 0, sizeof(*helper)); memset(helper, 0, sizeof(*helper));
helper->panel = panel; helper->panel = panel;
helper->type = type; helper->type = type;
@ -188,7 +188,16 @@ static void _helper_init(PanelAppletHelper * helper, Panel * panel,
helper->error = _panel_helper_error; helper->error = _panel_helper_error;
helper->about_dialog = _panel_helper_about_dialog; helper->about_dialog = _panel_helper_about_dialog;
helper->lock = _panel_helper_lock; helper->lock = _panel_helper_lock;
helper->logout_dialog = _panel_helper_logout_dialog; #ifndef EMBEDDED
if((p = config_get(panel->config, NULL, "logout")) == NULL
|| strtol(p, NULL, 0) != 0)
#else
if((p = config_get(panel->config, NULL, "logout")) != NULL
&& strtol(p, NULL, 0) != 0)
#endif
helper->logout_dialog = _panel_helper_logout_dialog;
else
helper->logout_dialog = NULL;
helper->position_menu = _panel_helper_position_menu_widget; helper->position_menu = _panel_helper_position_menu_widget;
helper->preferences_dialog = _panel_helper_preferences_dialog; helper->preferences_dialog = _panel_helper_preferences_dialog;
helper->rotate_screen = _panel_helper_rotate_screen; helper->rotate_screen = _panel_helper_rotate_screen;

View File

@ -137,9 +137,7 @@ static int _notify(GtkIconSize iconsize, int timeout, char * applets[])
panel.root_width = rect.width; panel.root_width = rect.width;
panel.source = 0; panel.source = 0;
panel.ab_window = NULL; panel.ab_window = NULL;
#ifndef EMBEDDED
panel.lo_window = NULL; panel.lo_window = NULL;
#endif
panel.sh_window = NULL; panel.sh_window = NULL;
gtk_main(); gtk_main();
if(panel.timeout != 0) if(panel.timeout != 0)

View File

@ -122,9 +122,7 @@ static int _test(GtkIconSize iconsize, char * applets[])
panel.root_width = rect.width; panel.root_width = rect.width;
panel.source = 0; panel.source = 0;
panel.ab_window = NULL; panel.ab_window = NULL;
#ifndef EMBEDDED
panel.lo_window = NULL; panel.lo_window = NULL;
#endif
panel.sh_window = NULL; panel.sh_window = NULL;
gtk_main(); gtk_main();
if(panel.source != 0) if(panel.source != 0)