From 88075c4bffe51e7a72ee955e39e5ceb3dbef690c Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sun, 28 Aug 2011 17:26:53 +0000 Subject: [PATCH] Moved the "About" dialog to the main application --- include/Phone/plugin.h | 1 + po/fr.po | 156 ++++++++++++++++++++------------------- src/Makefile | 10 +-- src/phone.c | 87 ++++++++++++++++++---- src/phone.h | 1 + src/plugins/Makefile | 4 +- src/plugins/project.conf | 2 - src/plugins/systray.c | 67 +++-------------- src/project.conf | 6 +- 9 files changed, 179 insertions(+), 155 deletions(-) diff --git a/include/Phone/plugin.h b/include/Phone/plugin.h index 57ab0b2..375b90b 100644 --- a/include/Phone/plugin.h +++ b/include/Phone/plugin.h @@ -38,6 +38,7 @@ typedef struct _PhonePluginHelper int (*config_set)(Phone * phone, char const * section, char const * variable, char const * value); int (*error)(Phone * phone, char const * message, int ret); + void (*about_dialog)(Phone * phone); int (*event)(Phone * phone, PhoneEvent * event); void (*message)(Phone * phone, PhoneMessage message, ...); int (*request)(Phone * phone, ModemRequest * request); diff --git a/po/fr.po b/po/fr.po index 8159270..a97add8 100644 --- a/po/fr.po +++ b/po/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Phone 0.0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-08-28 18:15+0200\n" +"POT-Creation-Date: 2011-08-28 19:22+0200\n" "PO-Revision-Date: 2010-04-24 02:07+0200\n" "Last-Translator: Pierre Pronchery \n" "Language-Team: DeforaOS development (French) \n" @@ -27,305 +27,309 @@ msgstr "" " -m\tNom du greffon modem à charger\n" " -r\tDélai entre deux tentatives d'accès au modem (ms)\n" -#: ../src/phone.c:337 +#: ../src/phone.c:355 msgid "All" msgstr "Tous" -#: ../src/phone.c:338 +#: ../src/phone.c:356 msgid "Inbox" msgstr "Reçus" -#: ../src/phone.c:339 +#: ../src/phone.c:357 msgid "Sent" msgstr "Envoyés" -#: ../src/phone.c:340 +#: ../src/phone.c:358 msgid "Drafts" msgstr "Brouillons" -#: ../src/phone.c:341 +#: ../src/phone.c:359 msgid "Trash" msgstr "Corbeille" -#: ../src/phone.c:509 ../src/phone.c:2522 +#: ../src/phone.c:529 ../src/phone.c:2573 msgid "System preferences" msgstr "Préférences système" -#: ../src/phone.c:520 ../src/phone.c:1951 +#: ../src/phone.c:540 ../src/phone.c:2002 msgid "Plug-ins" msgstr "Greffons" -#: ../src/phone.c:685 +#: ../src/phone.c:705 #, c-format msgid "Checking %s..." msgstr "Vérification %s..." -#: ../src/phone.c:748 +#: ../src/phone.c:768 msgid "Delete this contact?" msgstr "Supprimer ce contact?" -#: ../src/phone.c:1058 ../src/phone.c:1224 +#: ../src/phone.c:1078 ../src/phone.c:1244 msgid "Delete this message?" msgstr "Supprimer ce message?" -#: ../src/phone.c:1064 ../src/phone.c:1229 +#: ../src/phone.c:1084 ../src/phone.c:1249 msgid "Deleting message..." msgstr "Suppression du message..." -#: ../src/phone.c:1335 +#: ../src/phone.c:1332 +msgid "translator-credits" +msgstr "Pierre Pronchery " + +#: ../src/phone.c:1386 msgid "Unknown contact" msgstr "Contact inconnu" -#: ../src/phone.c:1342 +#: ../src/phone.c:1393 msgid "Unknown number" msgstr "Numéro inconnu" -#: ../src/phone.c:1354 +#: ../src/phone.c:1405 msgid "In conversation" msgstr "En conversation" -#: ../src/phone.c:1365 +#: ../src/phone.c:1416 msgid "Incoming call" msgstr "Appel entrant" -#: ../src/phone.c:1375 +#: ../src/phone.c:1426 msgid "Outgoing call" msgstr "Appel sortant" -#: ../src/phone.c:1386 +#: ../src/phone.c:1437 msgid "Call finished" msgstr "Appel terminé" -#: ../src/phone.c:1418 +#: ../src/phone.c:1469 msgid "_Answer" msgstr "_Répondre" -#: ../src/phone.c:1423 +#: ../src/phone.c:1474 msgid "_Hangup" msgstr "Ra_ccrocher" -#: ../src/phone.c:1428 +#: ../src/phone.c:1479 msgid "_Reject" msgstr "Re_jeter" -#: ../src/phone.c:1448 +#: ../src/phone.c:1499 msgid "Loudspeaker" msgstr "Haut-parleur" -#: ../src/phone.c:1456 +#: ../src/phone.c:1507 msgid "Mute microphone" msgstr "Couper le microphone" -#: ../src/phone.c:1498 +#: ../src/phone.c:1549 #, c-format msgid "Enter %s" msgstr "Entrer %s" -#: ../src/phone.c:1541 +#: ../src/phone.c:1592 msgid "Enter" msgstr "Entrer" -#: ../src/phone.c:1543 +#: ../src/phone.c:1594 msgid "Skip" msgstr "Ignorer" -#: ../src/phone.c:1571 +#: ../src/phone.c:1622 msgid "Contacts" msgstr "Contacts" -#: ../src/phone.c:1577 ../src/phone.c:1696 ../src/phone.c:1732 -#: ../src/phone.c:1847 ../src/phone.c:2203 +#: ../src/phone.c:1628 ../src/phone.c:1747 ../src/phone.c:1783 +#: ../src/phone.c:1898 ../src/phone.c:2254 msgid "Call" msgstr "Appeler" -#: ../src/phone.c:1583 +#: ../src/phone.c:1634 msgid "Write" msgstr "Écrire" -#: ../src/phone.c:1625 ../src/phone.c:1982 ../src/phone.c:2314 +#: ../src/phone.c:1676 ../src/phone.c:2033 ../src/phone.c:2365 msgid "Name" msgstr "Nom" -#: ../src/phone.c:1671 +#: ../src/phone.c:1722 msgid "Dialer" msgstr "Composer" -#: ../src/phone.c:1698 +#: ../src/phone.c:1749 msgid "Hang up" msgstr "Raccrocher" -#: ../src/phone.c:1726 +#: ../src/phone.c:1777 msgid "Phone logs" msgstr "Journal d'appels" -#: ../src/phone.c:1738 +#: ../src/phone.c:1789 msgid "Message" msgstr "Message" -#: ../src/phone.c:1769 +#: ../src/phone.c:1820 msgid "Direction" msgstr "Direction" -#: ../src/phone.c:1774 ../src/phone.c:1893 +#: ../src/phone.c:1825 ../src/phone.c:1944 msgid "To/From" msgstr "Vers/De" -#: ../src/phone.c:1780 ../src/phone.c:1901 +#: ../src/phone.c:1831 ../src/phone.c:1952 msgid "Date" msgstr "Date" -#: ../src/phone.c:1841 +#: ../src/phone.c:1892 msgid "Messages" msgstr "Messages" -#: ../src/phone.c:1852 +#: ../src/phone.c:1903 msgid "New message" msgstr "Nouveau message" -#: ../src/phone.c:1858 ../src/phone.c:2209 +#: ../src/phone.c:1909 ../src/phone.c:2260 msgid "Reply" msgstr "Répondre" -#: ../src/phone.c:1970 +#: ../src/phone.c:2021 msgid "Enabled" msgstr "Activé" -#: ../src/phone.c:2197 +#: ../src/phone.c:2248 msgid "Read message" msgstr "Lire le message" -#: ../src/phone.c:2215 +#: ../src/phone.c:2266 msgid "Forward" msgstr "Transmettre" -#: ../src/phone.c:2289 +#: ../src/phone.c:2340 msgid "Phone settings" msgstr "Paramètres du téléphone" -#: ../src/phone.c:2366 +#: ../src/phone.c:2417 msgid "missed calls" msgstr "appels manqués" -#: ../src/phone.c:2366 +#: ../src/phone.c:2417 msgid "missed call" msgstr "appel manqué" -#: ../src/phone.c:2375 +#: ../src/phone.c:2426 msgid "new messages" msgstr "nouveaux messages" -#: ../src/phone.c:2376 +#: ../src/phone.c:2427 msgid "new message" msgstr "nouveau message" -#: ../src/phone.c:2394 ../src/phone.c:3299 ../src/phone.c:3303 +#: ../src/phone.c:2445 ../src/phone.c:3358 ../src/phone.c:3362 msgid "Information" msgstr "Information" -#: ../src/phone.c:2404 +#: ../src/phone.c:2455 msgid "Status" msgstr "État" -#: ../src/phone.c:2428 +#: ../src/phone.c:2479 msgid "_View" msgstr "_Vue" -#: ../src/phone.c:2447 +#: ../src/phone.c:2498 msgid "_Read" msgstr "_Lire" -#: ../src/phone.c:2548 +#: ../src/phone.c:2599 msgid "Open file..." msgstr "Ouvrir fichier..." -#: ../src/phone.c:2734 +#: ../src/phone.c:2786 msgid "Write message" msgstr "Écrire un message" -#: ../src/phone.c:2740 +#: ../src/phone.c:2792 msgid "Send" msgstr "Envoyer" -#: ../src/phone.c:2746 +#: ../src/phone.c:2798 msgid "Attach" msgstr "Joindre" -#: ../src/phone.c:2862 +#: ../src/phone.c:2914 msgid "Attach file..." msgstr "Joindre un fichier..." -#: ../src/phone.c:2933 +#: ../src/phone.c:2985 #, c-format msgid "%d message%s, %d/%d characters" msgstr "%d message%s, %d/%d caractères" -#: ../src/phone.c:2934 +#: ../src/phone.c:2986 msgid "s" msgstr "s" -#: ../src/phone.c:2998 +#: ../src/phone.c:3050 msgid "Sending message..." msgstr "Envoi du message..." -#: ../src/phone.c:3027 +#: ../src/phone.c:3086 msgid "Outgoing" msgstr "Sortant" -#: ../src/phone.c:3213 +#: ../src/phone.c:3272 msgid "Operation in progress..." msgstr "Opération en cours..." -#: ../src/phone.c:3251 ../src/phone.c:3255 +#: ../src/phone.c:3310 ../src/phone.c:3314 msgid "Question" msgstr "Question" -#: ../src/phone.c:3275 ../src/phone.c:3279 +#: ../src/phone.c:3334 ../src/phone.c:3338 msgid "Error" msgstr "Erreur" -#: ../src/phone.c:3505 +#: ../src/phone.c:3564 msgid "Name: " msgstr "Nom: " -#: ../src/phone.c:3514 +#: ../src/phone.c:3573 msgid "Number: " msgstr "Numéro: " -#: ../src/phone.c:3530 +#: ../src/phone.c:3589 msgid "New contact" msgstr "Nouveau contact" -#: ../src/phone.c:3532 +#: ../src/phone.c:3591 msgid "Edit contact: " msgstr "Modifier contact: " -#: ../src/phone.c:3559 +#: ../src/phone.c:3618 msgid "The name cannot be empty" msgstr "Le nom ne peut être vide" -#: ../src/phone.c:3564 +#: ../src/phone.c:3623 msgid "The number cannot be empty" msgstr "Le numéro ne peut être vide" -#: ../src/phone.c:3700 +#: ../src/phone.c:3759 msgid "Message sent" msgstr "Message envoyé" -#: ../src/phone.c:3731 +#: ../src/phone.c:3790 #, c-format msgid "Wrong %s" msgstr "Mauvais %s" -#: ../src/phone.c:3738 +#: ../src/phone.c:3797 #, c-format msgid "%s is valid" msgstr "%s valide" -#: ../src/phone.c:3803 +#: ../src/phone.c:3862 msgid "Raw data (not shown)" msgstr "Données brutes (non affichées)" -#: ../src/phone.c:3836 +#: ../src/phone.c:3895 msgid "Message deleted" msgstr "Message effacé" diff --git a/src/Makefile b/src/Makefile index 9bc8867..499c19c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -6,7 +6,7 @@ BINDIR = $(PREFIX)/bin CC = cc CPPFLAGSF= -I ../include CPPFLAGS= -CFLAGSF = -W `pkg-config --cflags libSystem gtk+-2.0` +CFLAGSF = -W CFLAGS = -Wall -g -O2 -pedantic LDFLAGSF= `pkg-config --libs libSystem gtk+-2.0` LDFLAGS = -L $(PREFIX)/lib -Wl,-rpath,$(PREFIX)/lib @@ -22,15 +22,15 @@ subdirs: @for i in $(SUBDIRS); do (cd $$i && $(MAKE)) || exit; done phone_OBJS = callbacks.o main.o modem.o phone.o -phone_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) -phone_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) +phone_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) `pkg-config --cflags libDesktop` +phone_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) `pkg-config --libs libDesktop` phone: $(phone_OBJS) $(CC) -o phone $(phone_OBJS) $(phone_LDFLAGS) phonectl_OBJS = phonectl.o -phonectl_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) -phonectl_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) +phonectl_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) `pkg-config --cflags gtk+-2.0` +phonectl_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) `pkg-config --libs gtk+-2.0` phonectl: $(phonectl_OBJS) $(CC) -o phonectl $(phonectl_OBJS) $(phonectl_LDFLAGS) diff --git a/src/phone.c b/src/phone.c index 4062b0a..6f06bd6 100644 --- a/src/phone.c +++ b/src/phone.c @@ -1,17 +1,18 @@ /* $Id$ */ /* Copyright (c) 2011 Pierre Pronchery */ /* This file is part of DeforaOS Desktop Phone */ -/* 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 - * the Free Software Foundation, version 3 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . */ +static char const _license[] = +"This program is free software: you can redistribute it and/or modify\n" +"it under the terms of the GNU General Public License as published by\n" +"the Free Software Foundation, version 3 of the License.\n" +"\n" +"This program is distributed in the hope that it will be useful,\n" +"but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +"GNU General Public License for more details.\n" +"\n" +"You should have received a copy of the GNU General Public License\n" +"along with this program. If not, see ."; /* FIXME: * - keep track of missed calls */ @@ -28,6 +29,7 @@ #include #include #include +#include #include "Phone.h" #include "modem.h" #include "callbacks.h" @@ -160,6 +162,9 @@ struct _Phone /* widgets */ PangoFontDescription * bold; + /* about */ + GtkWidget * ab_window; + /* call */ GtkWidget * ca_window; GtkWidget * ca_name; @@ -255,7 +260,20 @@ struct _Phone #define PHONE_CONFIG_FILE ".phone" +/* variables */ +static char const * _authors[] = +{ + "Pierre Pronchery ", + NULL +}; + +static char _copyright[] = +"Copyright (c) 2011 DeforaOS Project "; + + /* prototypes */ +static void _phone_about(Phone * phone); + static int _phone_call_number(Phone * phone, char const * number); static void _phone_config_foreach(Phone * phone, char const * section, @@ -383,6 +401,7 @@ Phone * phone_new(char const * plugin, int retry) phone->helper.config_get = _phone_config_get; phone->helper.config_set = _phone_config_set; phone->helper.error = phone_error; + phone->helper.about_dialog = _phone_about; phone->helper.event = phone_event; phone->helper.message = _phone_message; phone->helper.request = _phone_request; @@ -393,6 +412,7 @@ Phone * phone_new(char const * plugin, int retry) /* widgets */ phone->bold = pango_font_description_new(); pango_font_description_set_weight(phone->bold, PANGO_WEIGHT_BOLD); + phone->ab_window = NULL; phone->ca_window = NULL; phone->en_window = NULL; phone->en_method = MODEM_AUTHENTICATION_METHOD_NONE; @@ -1291,6 +1311,37 @@ void phone_settings_open_selected(Phone * phone) /* show */ +void phone_show_about(Phone * phone, gboolean show) +{ + if(phone->ab_window != NULL) + { + if(show) + gtk_window_present(GTK_WINDOW(phone->ab_window)); + else + gtk_widget_hide(phone->ab_window); + return; + } + phone->ab_window = desktop_about_dialog_new(); + desktop_about_dialog_set_authors(phone->ab_window, _authors); + desktop_about_dialog_set_copyright(phone->ab_window, _copyright); + desktop_about_dialog_set_license(phone->ab_window, _license); + desktop_about_dialog_set_logo_icon_name(phone->ab_window, + "phone-dialer"); + desktop_about_dialog_set_name(phone->ab_window, PACKAGE); + desktop_about_dialog_set_translator_credits(phone->ab_window, + _("translator-credits")); + desktop_about_dialog_set_version(phone->ab_window, VERSION); + desktop_about_dialog_set_website(phone->ab_window, + "http://www.defora.org/"); + gtk_window_set_position(GTK_WINDOW(phone->ab_window), + GTK_WIN_POS_CENTER_ALWAYS); + g_signal_connect_swapped(phone->ab_window, "delete-event", + G_CALLBACK(on_phone_closex), NULL); + if(show) + gtk_window_present(GTK_WINDOW(phone->ab_window)); +} + + /* phone_show_call */ static void _show_call_window(Phone * phone); @@ -2524,7 +2575,7 @@ void phone_show_system(Phone * phone, gboolean show) G_CALLBACK(_on_system_closex), phone); vbox = gtk_vbox_new(FALSE, 4); config = modem_get_config(phone->modem); - for(i = 0; config[i].name != NULL; i++) + for(i = 0; config != NULL && config[i].name != NULL; i++) { widget = NULL; switch(config[i].type) @@ -2597,7 +2648,8 @@ static void _on_system_cancel(gpointer data) char buf[16]; gtk_widget_hide(phone->sy_window); - config = modem_get_config(phone->modem); + if((config = modem_get_config(phone->modem)) == NULL) + return; for(i = 0; config[i].name != NULL; i++) { if((widget = g_object_get_data(G_OBJECT(phone->sy_window), @@ -2651,7 +2703,7 @@ static void _on_system_ok(gpointer data) gtk_widget_hide(phone->sy_window); config = modem_get_config(phone->modem); - for(i = 0; config[i].name != NULL; i++) + for(i = 0; config != NULL && config[i].name != NULL; i++) { if((widget = g_object_get_data(G_OBJECT(phone->sy_window), config[i].name)) == NULL) @@ -3004,6 +3056,13 @@ void phone_write_send(Phone * phone) /* private */ +/* phone_about */ +static void _phone_about(Phone * phone) +{ + phone_show_about(phone, TRUE); +} + + /* phone_call_number */ static int _phone_call_number(Phone * phone, char const * number) { diff --git a/src/phone.h b/src/phone.h index e649b74..9ab7d8a 100644 --- a/src/phone.h +++ b/src/phone.h @@ -63,6 +63,7 @@ void phone_dialer_hangup(Phone * phone); int phone_event(Phone * phone, PhoneEvent * event); /* interface */ +void phone_show_about(Phone * phone, gboolean show); void phone_show_call(Phone * phone, gboolean show, ...); /* PhoneCall */ void phone_show_code(Phone * phone, gboolean show, ...); /* PhoneCode */ void phone_show_contacts(Phone * phone, gboolean show); diff --git a/src/plugins/Makefile b/src/plugins/Makefile index 432da19..31b4fd3 100644 --- a/src/plugins/Makefile +++ b/src/plugins/Makefile @@ -100,8 +100,8 @@ smscrypt.so: $(smscrypt_OBJS) $(LD) -o smscrypt.so $(smscrypt_OBJS) $(smscrypt_LDFLAGS) systray_OBJS = systray.o -systray_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) `pkg-config --cflags libDesktop` -systray_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) `pkg-config --libs libDesktop` +systray_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) +systray_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) systray.so: $(systray_OBJS) $(LD) -o systray.so $(systray_OBJS) $(systray_LDFLAGS) diff --git a/src/plugins/project.conf b/src/plugins/project.conf index 52a33d1..f15ef3b 100644 --- a/src/plugins/project.conf +++ b/src/plugins/project.conf @@ -103,8 +103,6 @@ depends=../../include/Phone.h [systray] type=plugin sources=systray.c -cflags=`pkg-config --cflags libDesktop` -ldflags=`pkg-config --libs libDesktop` install=$(LIBDIR)/Phone/plugins [systray.c] diff --git a/src/plugins/systray.c b/src/plugins/systray.c index 316aac2..ec62a69 100644 --- a/src/plugins/systray.c +++ b/src/plugins/systray.c @@ -1,18 +1,17 @@ /* $Id$ */ /* Copyright (c) 2011 Pierre Pronchery */ /* This file is part of DeforaOS Desktop Phone */ -static char const _license[] = -"This program is free software: you can redistribute it and/or modify\n" -"it under the terms of the GNU General Public License as published by\n" -"the Free Software Foundation, version 3 of the License.\n" -"\n" -"This program is distributed in the hope that it will be useful,\n" -"but WITHOUT ANY WARRANTY; without even the implied warranty of\n" -"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" -"GNU General Public License for more details.\n" -"\n" -"You should have received a copy of the GNU General Public License\n" -"along with this program. If not, see ."; +/* 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 + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ @@ -49,17 +48,6 @@ static void _systray_on_popup_menu(GtkStatusIcon * icon, guint button, #endif -/* variables */ -static char const * _authors[] = -{ - "Pierre Pronchery ", - NULL -}; - -static char _copyright[] = -"Copyright (c) 2011 DeforaOS Project "; - - /* public */ /* variables */ PhonePlugin plugin = @@ -115,42 +103,11 @@ static int _systray_destroy(PhonePlugin * plugin) #if GTK_CHECK_VERSION(2, 10, 0) /* callbacks */ /* systray_on_activate */ -static gboolean _activate_on_closex(gpointer data); - static void _systray_on_activate(gpointer data) { PhonePlugin * plugin = data; - Systray * systray = plugin->priv; - if(systray->ab_window != NULL) - { - gtk_window_present(GTK_WINDOW(systray->ab_window)); - return; - } - systray->ab_window = desktop_about_dialog_new(); - desktop_about_dialog_set_authors(systray->ab_window, _authors); - desktop_about_dialog_set_copyright(systray->ab_window, _copyright); - desktop_about_dialog_set_license(systray->ab_window, _license); - desktop_about_dialog_set_logo_icon_name(systray->ab_window, - "phone-dialer"); - desktop_about_dialog_set_name(systray->ab_window, PACKAGE); - desktop_about_dialog_set_version(systray->ab_window, VERSION); - desktop_about_dialog_set_website(systray->ab_window, - "http://www.defora.org/"); - gtk_window_set_position(GTK_WINDOW(systray->ab_window), - GTK_WIN_POS_CENTER_ALWAYS); - g_signal_connect_swapped(systray->ab_window, "delete-event", - G_CALLBACK(_activate_on_closex), plugin); - gtk_widget_show(systray->ab_window); -} - -static gboolean _activate_on_closex(gpointer data) -{ - PhonePlugin * plugin = data; - Systray * systray = plugin->priv; - - gtk_widget_hide(systray->ab_window); - return TRUE; + plugin->helper->about_dialog(plugin->helper->phone); } diff --git a/src/project.conf b/src/project.conf index 359eeed..2404f34 100644 --- a/src/project.conf +++ b/src/project.conf @@ -2,7 +2,7 @@ subdirs=modems,plugins targets=phone,phonectl cppflags_force=-I ../include cppflags= -cflags_force=-W `pkg-config --cflags libSystem gtk+-2.0` +cflags_force=-W cflags=-Wall -g -O2 -pedantic ldflags_force=`pkg-config --libs libSystem gtk+-2.0` ldflags=-L $(PREFIX)/lib -Wl,-rpath,$(PREFIX)/lib @@ -10,11 +10,15 @@ dist=Makefile,callbacks.h,modem.h,phone.h [phone] type=binary +cflags=`pkg-config --cflags libDesktop` +ldflags=`pkg-config --libs libDesktop` sources=callbacks.c,main.c,modem.c,phone.c install=$(BINDIR) [phonectl] type=binary +cflags=`pkg-config --cflags gtk+-2.0` +ldflags=`pkg-config --libs gtk+-2.0` sources=phonectl.c install=$(BINDIR)