projects/pk-update-icon

changeset 18:9537882d759f

add an about dialog
author Guido Berhoerster <guido@berhoerster.name>
date Thu Oct 20 13:03:37 2011 +0200 (2011-10-20)
parents a28d0d9b5410
children 38b37e4a4d63
files pkui-icon.c po/de.po po/id.po
line diff
     1.1 --- a/pkui-icon.c	Thu Oct 20 12:20:14 2011 +0200
     1.2 +++ b/pkui-icon.c	Thu Oct 20 13:03:37 2011 +0200
     1.3 @@ -98,6 +98,44 @@
     1.4  }
     1.5  
     1.6  static void
     1.7 +about_dialog_show(GtkMenuItem *item, gpointer user_data)
     1.8 +{
     1.9 +	static const gchar *copyright = "Copyright \xc2\xa9 2011 Guido "
    1.10 +	    "Berhoerster\nCopyright \xc2\xa9 2011 Pavol Rusnak\n";
    1.11 +	static const gchar *authors[3] = {
    1.12 +	    "Guido Berhoerster <gber@opensuse.org>",
    1.13 +	    "Pavol Rusnak <stick@gk2.sk>",
    1.14 +	    NULL
    1.15 +	};
    1.16 +	static const gchar *documenters[2] = {
    1.17 +	    "Guido Berhoerster <gber@opensuse.org>",
    1.18 +	    NULL
    1.19 +	};
    1.20 +	static const gchar *license =
    1.21 +	    "Licensed under the GNU General Public License Version 2\n\nThis "
    1.22 +	    "program is free software; you can redistribute it and/or modify it"
    1.23 +	    " under the terms of the GNU General Public License as published by"
    1.24 +	    " the Free Software Foundation; either version 2 of the License, or"
    1.25 +	    " (at your option) any later version.\n\nThis program is "
    1.26 +	    "distributed in the hope that it will be useful, but WITHOUT ANY "
    1.27 +	    "WARRANTY; without even the implied warranty of MERCHANTABILITY or "
    1.28 +	    "FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public "
    1.29 +	    "License for more details.\n\nYou should have received a copy of "
    1.30 +	    "the GNU General Public License along with this program; if not, "
    1.31 +	    "write to the Free Software Foundation, Inc., 51 Franklin Street, "
    1.32 +	    "Fifth Floor, Boston, MA 02110-1301 USA.";
    1.33 +	const gchar *translators = _("translators");
    1.34 +
    1.35 +	if (strcmp(translators, "translators") == 0)
    1.36 +	    translators = NULL;
    1.37 +
    1.38 +	gtk_show_about_dialog (NULL, "version", "0.1", "copyright", copyright,
    1.39 +	    "authors", authors, "documenters", documenters,
    1.40 +	    "translator-credits", translators, "license", license,
    1.41 +	    "wrap-license", TRUE, NULL);
    1.42 +}
    1.43 +
    1.44 +static void
    1.45  backend_check_now(GtkMenuItem *menu_item, gpointer user_data)
    1.46  {
    1.47  	PkuiIcon	*self = PKUI_ICON(user_data);
    1.48 @@ -122,6 +160,14 @@
    1.49  	g_signal_connect(G_OBJECT(item), "activate",
    1.50  	    G_CALLBACK(backend_check_now), self);
    1.51  
    1.52 +	item = gtk_image_menu_item_new_with_mnemonic(_("_About"));
    1.53 +	image = gtk_image_new_from_icon_name(GTK_STOCK_ABOUT,
    1.54 +	    GTK_ICON_SIZE_MENU);
    1.55 +	gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
    1.56 +	gtk_menu_shell_append(GTK_MENU_SHELL(popup_menu), item);
    1.57 +	g_signal_connect(G_OBJECT(item), "activate",
    1.58 +	    G_CALLBACK(about_dialog_show), self);
    1.59 +
    1.60  	gtk_widget_show_all(GTK_WIDGET(popup_menu));
    1.61  
    1.62  	return (popup_menu);
     2.1 --- a/po/de.po	Thu Oct 20 12:20:14 2011 +0200
     2.2 +++ b/po/de.po	Thu Oct 20 13:03:37 2011 +0200
     2.3 @@ -7,7 +7,7 @@
     2.4  msgstr ""
     2.5  "Project-Id-Version: pk-update-icon 0.1\n"
     2.6  "Report-Msgid-Bugs-To: \n"
     2.7 -"POT-Creation-Date: 2011-10-20 12:07+0200\n"
     2.8 +"POT-Creation-Date: 2011-10-20 12:32+0200\n"
     2.9  "PO-Revision-Date: 2011-10-10 19:21+0200\n"
    2.10  "Last-Translator: Guido Berhoerster <gber@opensuse.org>\n"
    2.11  "Language-Team: German\n"
    2.12 @@ -19,11 +19,15 @@
    2.13  
    2.14  #: ../main.c:41
    2.15  msgid "Set the delay in seconds before the first check for updates"
    2.16 -msgstr "Bestimme die Verzögerung in Sekunden vor dem ersten Überprüfen auf Aktualisierungen"
    2.17 +msgstr ""
    2.18 +"Bestimme die Verzögerung in Sekunden vor dem ersten Überprüfen auf "
    2.19 +"Aktualisierungen"
    2.20  
    2.21  #: ../main.c:44
    2.22  msgid "Set the interval in seconds between checks for updates"
    2.23 -msgstr "Bestimme das Intervall in Sekunden zwischen dem Überprüfen auf Aktualisierungen"
    2.24 +msgstr ""
    2.25 +"Bestimme das Intervall in Sekunden zwischen dem Überprüfen auf "
    2.26 +"Aktualisierungen"
    2.27  
    2.28  #: ../main.c:47
    2.29  msgid "Print the version number and exit"
    2.30 @@ -37,23 +41,31 @@
    2.31  msgid "Software Updates"
    2.32  msgstr "Softwareaktualisierungen"
    2.33  
    2.34 -#: ../pkui-icon.c:117
    2.35 +#: ../pkui-icon.c:127
    2.36 +msgid "translators"
    2.37 +msgstr "Guido Berhörster <gber@opensuse.org>"
    2.38 +
    2.39 +#: ../pkui-icon.c:154
    2.40  msgid "_Check for Updates"
    2.41  msgstr "Nach Aktualisierungen _Suchen"
    2.42  
    2.43 -#: ../pkui-icon.c:146
    2.44 +#: ../pkui-icon.c:162
    2.45 +msgid "_About"
    2.46 +msgstr "_Info"
    2.47 +
    2.48 +#: ../pkui-icon.c:191
    2.49  msgid "Important Software Update"
    2.50  msgid_plural "Important Software Updates"
    2.51  msgstr[0] "Wichtige Aktualisierung"
    2.52  msgstr[1] "Wichtige Aktualisierungen"
    2.53  
    2.54 -#: ../pkui-icon.c:148
    2.55 +#: ../pkui-icon.c:193
    2.56  msgid "Software Update"
    2.57  msgid_plural "Software Updates"
    2.58  msgstr[0] "Softwareaktualisierung"
    2.59  msgstr[1] "Softwareaktualisierungen"
    2.60  
    2.61 -#: ../pkui-icon.c:155
    2.62 +#: ../pkui-icon.c:200
    2.63  #, c-format
    2.64  msgid "There are %d software updates available, %d of them is important."
    2.65  msgid_plural ""
    2.66 @@ -63,14 +75,14 @@
    2.67  msgstr[1] ""
    2.68  "Es sind %d Softwareaktualisierungen verfügbar, davon sind %d wichtig."
    2.69  
    2.70 -#: ../pkui-icon.c:163
    2.71 +#: ../pkui-icon.c:208
    2.72  #, c-format
    2.73  msgid "There is an important software update available."
    2.74  msgid_plural "There are %d important software updates available."
    2.75  msgstr[0] "Es ist eine wichtige Softwareaktualisierung verfügbar."
    2.76  msgstr[1] "Es sind %d wichtige Softwareaktualisierungen verfügbar."
    2.77  
    2.78 -#: ../pkui-icon.c:168
    2.79 +#: ../pkui-icon.c:213
    2.80  #, c-format
    2.81  msgid "There is a software update available."
    2.82  msgid_plural "There are %d software updates available."
     3.1 --- a/po/id.po	Thu Oct 20 12:20:14 2011 +0200
     3.2 +++ b/po/id.po	Thu Oct 20 13:03:37 2011 +0200
     3.3 @@ -8,7 +8,7 @@
     3.4  msgstr ""
     3.5  "Project-Id-Version: pk-update-icon 0.1\n"
     3.6  "Report-Msgid-Bugs-To: \n"
     3.7 -"POT-Creation-Date: 2011-10-20 12:16+0200\n"
     3.8 +"POT-Creation-Date: 2011-10-20 12:32+0200\n"
     3.9  "PO-Revision-Date: 2011-10-20 10:50+0200\n"
    3.10  "Last-Translator: Guido Berhoerster <gber@opensuse.org>\n"
    3.11  "Language-Team: Indonesian\n"
    3.12 @@ -42,23 +42,31 @@
    3.13  msgid "Software Updates"
    3.14  msgstr "Perangkat Lunak Pembaharuan-Pembaharuan"
    3.15  
    3.16 -#: ../pkui-icon.c:117
    3.17 +#: ../pkui-icon.c:127
    3.18 +msgid "translators"
    3.19 +msgstr "Guido Berhörster <gber@opensuse.org>"
    3.20 +
    3.21 +#: ../pkui-icon.c:154
    3.22  msgid "_Check for Updates"
    3.23  msgstr "Pemeriksaan untuk Pembaharuan-Pembaharuan"
    3.24  
    3.25 -#: ../pkui-icon.c:146
    3.26 +#: ../pkui-icon.c:162
    3.27 +msgid "_About"
    3.28 +msgstr "Tent_ang"
    3.29 +
    3.30 +#: ../pkui-icon.c:191
    3.31  msgid "Important Software Update"
    3.32  msgid_plural "Important Software Updates"
    3.33  msgstr[0] "Perangkat Lunak Pembaharuan yang penting"
    3.34  msgstr[1] "Perangkat Lunak Pembaharuan-Pembaharuan yang penting"
    3.35  
    3.36 -#: ../pkui-icon.c:148
    3.37 +#: ../pkui-icon.c:193
    3.38  msgid "Software Update"
    3.39  msgid_plural "Software Updates"
    3.40  msgstr[0] "Pembaharuan Perangkat Lunak"
    3.41  msgstr[1] "Pembaharuan-Pembaharuan Perangkat Lunak"
    3.42  
    3.43 -#: ../pkui-icon.c:155
    3.44 +#: ../pkui-icon.c:200
    3.45  #, c-format
    3.46  msgid "There are %d software updates available, %d of them is important."
    3.47  msgid_plural ""
    3.48 @@ -67,14 +75,14 @@
    3.49  msgstr[1] ""
    3.50  "Tersedia Pembaharuan-Pembaharuan Perangkat Lunak, diantaranya adalah penting."
    3.51  
    3.52 -#: ../pkui-icon.c:163
    3.53 +#: ../pkui-icon.c:208
    3.54  #, c-format
    3.55  msgid "There is an important software update available."
    3.56  msgid_plural "There are %d important software updates available."
    3.57  msgstr[0] "Tersedia sebuah Pembaharuan Perangkat Lunak yang penting."
    3.58  msgstr[1] "Tersedia Pembaharuan-Pembaharuan Perangkat Lunak yang penting."
    3.59  
    3.60 -#: ../pkui-icon.c:168
    3.61 +#: ../pkui-icon.c:213
    3.62  #, c-format
    3.63  msgid "There is a software update available."
    3.64  msgid_plural "There are %d software updates available."