diff --git a/data/panel-settings.desktop b/data/panel-settings.desktop index 3dbd18e..0271974 100644 --- a/data/panel-settings.desktop +++ b/data/panel-settings.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Name=Panel settings -Exec=panel-settings +Exec=panelctl -S Icon=panel-settings Type=Application Categories=Settings;GTK; diff --git a/po/fr.po b/po/fr.po index 979d717..2deed15 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Panel 0.0.5\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-09 19:20+0200\n" +"POT-Creation-Date: 2011-10-27 16:31+0200\n" "PO-Revision-Date: 2010-04-22 12:45+0200\n" "Last-Translator: Pierre Pronchery \n" "Language-Team: French\n" @@ -88,8 +88,8 @@ msgstr "Verrouiller l'écran" msgid "Logging out is disabled" msgstr "Se déconnecter est désactivé" -#: ../src/applets/logout.c:69 ../src/panel.c:1278 ../src/panel.c:1285 -#: ../src/panel.c:1294 +#: ../src/applets/logout.c:69 ../src/panel.c:1282 ../src/panel.c:1289 +#: ../src/panel.c:1298 msgid "Logout" msgstr "Déconnexion" @@ -223,7 +223,7 @@ msgstr "Panneau inférieur :" msgid "translator-credits" msgstr "Pierre Pronchery " -#: ../src/panel.c:1264 +#: ../src/panel.c:1268 msgid "" "This will log you out of the current session, therefore closing any " "application currently opened and losing any unsaved data.\n" @@ -234,7 +234,7 @@ msgstr "" "sauvegardées.\n" "Voulez-vous continuer?" -#: ../src/panel.c:1380 +#: ../src/panel.c:1384 msgid "" "This will shutdown your device, therefore closing any application currently " "opened and losing any unsaved data.\n" @@ -245,7 +245,7 @@ msgstr "" "sauvegardées.\n" "Voulez-vous continuer?" -#: ../src/panel.c:1385 +#: ../src/panel.c:1389 msgid "" "This will shutdown your computer, therefore closing any application " "currently opened and losing any unsaved data.\n" @@ -256,11 +256,11 @@ msgstr "" "sauvegardées.\n" "Voulez-vous continuer?" -#: ../src/panel.c:1399 ../src/panel.c:1406 ../src/panel.c:1415 +#: ../src/panel.c:1403 ../src/panel.c:1410 ../src/panel.c:1419 msgid "Shutdown" msgstr "Arrêter" -#: ../src/panel.c:1405 +#: ../src/panel.c:1409 msgid "Restart" msgstr "Redémarrer" diff --git a/src/.cvsignore b/src/.cvsignore index e346b97..039a4ca 100644 --- a/src/.cvsignore +++ b/src/.cvsignore @@ -1,3 +1,3 @@ panel -panel-settings +panelctl run diff --git a/src/Makefile b/src/Makefile index d833032..3cd4fd1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,5 @@ SUBDIRS = applets -TARGETS = panel panel-settings run +TARGETS = panel panelctl run PREFIX = /usr/local DESTDIR = BINDIR = $(PREFIX)/bin @@ -26,12 +26,12 @@ panel_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) `pkg-config --libs libSystem libDesktop` panel: $(panel_OBJS) $(CC) -o panel $(panel_OBJS) $(panel_LDFLAGS) -panel-settings_OBJS = settings.o -panel-settings_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) `pkg-config --cflags gtk+-2.0` -panel-settings_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) `pkg-config --libs gtk+-2.0` +panelctl_OBJS = panelctl.o +panelctl_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) `pkg-config --cflags gtk+-2.0` +panelctl_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) `pkg-config --libs gtk+-2.0` -panel-settings: $(panel-settings_OBJS) - $(CC) -o panel-settings $(panel-settings_OBJS) $(panel-settings_LDFLAGS) +panelctl: $(panelctl_OBJS) + $(CC) -o panelctl $(panelctl_OBJS) $(panelctl_LDFLAGS) run_OBJS = run.o run_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) -D PREFIX=\"$(PREFIX)\" $(CFLAGSF) $(CFLAGS) `pkg-config --cflags libSystem gtk+-2.0` @@ -49,19 +49,19 @@ window.o: window.c common.h window.h main.o: main.c common.h ../config.h $(CC) $(panel_CFLAGS) -c main.c -settings.o: settings.c - $(CC) $(panel-settings_CFLAGS) -c settings.c +panelctl.o: panelctl.c + $(CC) $(panelctl_CFLAGS) -c panelctl.c run.o: run.c $(CC) $(run_CFLAGS) -c run.c clean: @for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean) || exit; done - $(RM) -- $(panel_OBJS) $(panel-settings_OBJS) $(run_OBJS) + $(RM) -- $(panel_OBJS) $(panelctl_OBJS) $(run_OBJS) distclean: @for i in $(SUBDIRS); do (cd $$i && $(MAKE) distclean) || exit; done - $(RM) -- $(panel_OBJS) $(panel-settings_OBJS) $(run_OBJS) + $(RM) -- $(panel_OBJS) $(panelctl_OBJS) $(run_OBJS) $(RM) -- $(TARGETS) install: $(TARGETS) @@ -69,14 +69,14 @@ install: $(TARGETS) $(MKDIR) $(DESTDIR)$(BINDIR) $(INSTALL) -m 0755 -- panel $(DESTDIR)$(BINDIR)/panel $(MKDIR) $(DESTDIR)$(BINDIR) - $(INSTALL) -m 0755 -- panel-settings $(DESTDIR)$(BINDIR)/panel-settings + $(INSTALL) -m 0755 -- panelctl $(DESTDIR)$(BINDIR)/panelctl $(MKDIR) $(DESTDIR)$(BINDIR) $(INSTALL) -m 0755 -- run $(DESTDIR)$(BINDIR)/run uninstall: @for i in $(SUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit; done $(RM) -- $(DESTDIR)$(BINDIR)/panel - $(RM) -- $(DESTDIR)$(BINDIR)/panel-settings + $(RM) -- $(DESTDIR)$(BINDIR)/panelctl $(RM) -- $(DESTDIR)$(BINDIR)/run .PHONY: all subdirs clean distclean install uninstall diff --git a/src/applets/lock.c b/src/applets/lock.c index cc811c5..8f49b4a 100644 --- a/src/applets/lock.c +++ b/src/applets/lock.c @@ -1,5 +1,5 @@ /* $Id$ */ -/* Copyright (c) 2010 Pierre Pronchery */ +/* Copyright (c) 2011 Pierre Pronchery */ /* This file is part of DeforaOS Desktop Panel */ /* This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/settings.c b/src/panelctl.c similarity index 72% rename from src/settings.c rename to src/panelctl.c index 98d9f74..ad678a3 100644 --- a/src/settings.c +++ b/src/panelctl.c @@ -22,28 +22,19 @@ #include "common.h" -/* usage */ -static int _usage(void) -{ - fputs("Usage: panel-settings\n", stderr); - return 1; -} +/* panelctl */ +/* private */ +/* prototypes */ +static int _panelctl(PanelMessageShow show); +static int _usage(void); -/* main */ -int main(int argc, char * argv[]) +/* functions */ +static int _panelctl(PanelMessageShow show) { - int o; GdkEvent event; GdkEventClient * client = &event.client; - gtk_init(&argc, &argv); - while((o = getopt(argc, argv, "")) != -1) - switch(o) - { - default: - return _usage(); - } memset(&event, 0, sizeof(event)); client->type = GDK_CLIENT_EVENT; client->window = NULL; @@ -51,8 +42,41 @@ int main(int argc, char * argv[]) client->message_type = gdk_atom_intern(PANEL_CLIENT_MESSAGE, FALSE); client->data_format = 8; client->data.b[0] = PANEL_MESSAGE_SHOW; - client->data.b[1] = PANEL_MESSAGE_SHOW_SETTINGS; + client->data.b[1] = show; client->data.b[2] = TRUE; gdk_event_send_clientmessage_toall(&event); return 0; } + + +/* usage */ +static int _usage(void) +{ + fputs("Usage: panelctl -S\n" +" -S Display or change settings\n", stderr); + return 1; +} + + +/* public */ +/* functions */ +/* main */ +int main(int argc, char * argv[]) +{ + int o; + int show = -1; + + gtk_init(&argc, &argv); + while((o = getopt(argc, argv, "S")) != -1) + switch(o) + { + case 'S': + show = PANEL_MESSAGE_SHOW_SETTINGS; + break; + default: + return _usage(); + } + if(argc != optind || show < 0) + return _usage(); + return (_panelctl(show) == 0) ? 0 : 2; +} diff --git a/src/project.conf b/src/project.conf index e5b0097..0645f90 100644 --- a/src/project.conf +++ b/src/project.conf @@ -1,5 +1,5 @@ subdirs=applets -targets=panel,panel-settings,run +targets=panel,panelctl,run cppflags_force=-I ../include #cppflags=-D EMBEDDED cflags_force=-W @@ -23,9 +23,9 @@ depends=common.h,window.h,../include/Panel.h,../config.h [window.c] depends=common.h,window.h -[panel-settings] +[panelctl] type=binary -sources=settings.c +sources=panelctl.c cflags=`pkg-config --cflags gtk+-2.0` ldflags=`pkg-config --libs gtk+-2.0` install=$(BINDIR)