changeset 18:9537882d759f

add an about dialog
author Guido Berhoerster <guido@berhoerster.name>
date Thu, 20 Oct 2011 13:03:37 +0200
parents a28d0d9b5410
children 38b37e4a4d63
files pkui-icon.c po/de.po po/id.po
diffstat 3 files changed, 82 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/pkui-icon.c	Thu Oct 20 12:20:14 2011 +0200
+++ b/pkui-icon.c	Thu Oct 20 13:03:37 2011 +0200
@@ -98,6 +98,44 @@
 }
 
 static void
+about_dialog_show(GtkMenuItem *item, gpointer user_data)
+{
+	static const gchar *copyright = "Copyright \xc2\xa9 2011 Guido "
+	    "Berhoerster\nCopyright \xc2\xa9 2011 Pavol Rusnak\n";
+	static const gchar *authors[3] = {
+	    "Guido Berhoerster <gber@opensuse.org>",
+	    "Pavol Rusnak <stick@gk2.sk>",
+	    NULL
+	};
+	static const gchar *documenters[2] = {
+	    "Guido Berhoerster <gber@opensuse.org>",
+	    NULL
+	};
+	static const gchar *license =
+	    "Licensed under the GNU General Public License Version 2\n\nThis "
+	    "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; either version 2 of the License, or"
+	    " (at your option) any later version.\n\nThis 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.\n\nYou should have received a copy of "
+	    "the GNU General Public License along with this program; if not, "
+	    "write to the Free Software Foundation, Inc., 51 Franklin Street, "
+	    "Fifth Floor, Boston, MA 02110-1301 USA.";
+	const gchar *translators = _("translators");
+
+	if (strcmp(translators, "translators") == 0)
+	    translators = NULL;
+
+	gtk_show_about_dialog (NULL, "version", "0.1", "copyright", copyright,
+	    "authors", authors, "documenters", documenters,
+	    "translator-credits", translators, "license", license,
+	    "wrap-license", TRUE, NULL);
+}
+
+static void
 backend_check_now(GtkMenuItem *menu_item, gpointer user_data)
 {
 	PkuiIcon	*self = PKUI_ICON(user_data);
@@ -122,6 +160,14 @@
 	g_signal_connect(G_OBJECT(item), "activate",
 	    G_CALLBACK(backend_check_now), self);
 
+	item = gtk_image_menu_item_new_with_mnemonic(_("_About"));
+	image = gtk_image_new_from_icon_name(GTK_STOCK_ABOUT,
+	    GTK_ICON_SIZE_MENU);
+	gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
+	gtk_menu_shell_append(GTK_MENU_SHELL(popup_menu), item);
+	g_signal_connect(G_OBJECT(item), "activate",
+	    G_CALLBACK(about_dialog_show), self);
+
 	gtk_widget_show_all(GTK_WIDGET(popup_menu));
 
 	return (popup_menu);
--- a/po/de.po	Thu Oct 20 12:20:14 2011 +0200
+++ b/po/de.po	Thu Oct 20 13:03:37 2011 +0200
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: pk-update-icon 0.1\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-10-20 12:07+0200\n"
+"POT-Creation-Date: 2011-10-20 12:32+0200\n"
 "PO-Revision-Date: 2011-10-10 19:21+0200\n"
 "Last-Translator: Guido Berhoerster <gber@opensuse.org>\n"
 "Language-Team: German\n"
@@ -19,11 +19,15 @@
 
 #: ../main.c:41
 msgid "Set the delay in seconds before the first check for updates"
-msgstr "Bestimme die Verzögerung in Sekunden vor dem ersten Überprüfen auf Aktualisierungen"
+msgstr ""
+"Bestimme die Verzögerung in Sekunden vor dem ersten Überprüfen auf "
+"Aktualisierungen"
 
 #: ../main.c:44
 msgid "Set the interval in seconds between checks for updates"
-msgstr "Bestimme das Intervall in Sekunden zwischen dem Überprüfen auf Aktualisierungen"
+msgstr ""
+"Bestimme das Intervall in Sekunden zwischen dem Überprüfen auf "
+"Aktualisierungen"
 
 #: ../main.c:47
 msgid "Print the version number and exit"
@@ -37,23 +41,31 @@
 msgid "Software Updates"
 msgstr "Softwareaktualisierungen"
 
-#: ../pkui-icon.c:117
+#: ../pkui-icon.c:127
+msgid "translators"
+msgstr "Guido Berhörster <gber@opensuse.org>"
+
+#: ../pkui-icon.c:154
 msgid "_Check for Updates"
 msgstr "Nach Aktualisierungen _Suchen"
 
-#: ../pkui-icon.c:146
+#: ../pkui-icon.c:162
+msgid "_About"
+msgstr "_Info"
+
+#: ../pkui-icon.c:191
 msgid "Important Software Update"
 msgid_plural "Important Software Updates"
 msgstr[0] "Wichtige Aktualisierung"
 msgstr[1] "Wichtige Aktualisierungen"
 
-#: ../pkui-icon.c:148
+#: ../pkui-icon.c:193
 msgid "Software Update"
 msgid_plural "Software Updates"
 msgstr[0] "Softwareaktualisierung"
 msgstr[1] "Softwareaktualisierungen"
 
-#: ../pkui-icon.c:155
+#: ../pkui-icon.c:200
 #, c-format
 msgid "There are %d software updates available, %d of them is important."
 msgid_plural ""
@@ -63,14 +75,14 @@
 msgstr[1] ""
 "Es sind %d Softwareaktualisierungen verfügbar, davon sind %d wichtig."
 
-#: ../pkui-icon.c:163
+#: ../pkui-icon.c:208
 #, c-format
 msgid "There is an important software update available."
 msgid_plural "There are %d important software updates available."
 msgstr[0] "Es ist eine wichtige Softwareaktualisierung verfügbar."
 msgstr[1] "Es sind %d wichtige Softwareaktualisierungen verfügbar."
 
-#: ../pkui-icon.c:168
+#: ../pkui-icon.c:213
 #, c-format
 msgid "There is a software update available."
 msgid_plural "There are %d software updates available."
--- a/po/id.po	Thu Oct 20 12:20:14 2011 +0200
+++ b/po/id.po	Thu Oct 20 13:03:37 2011 +0200
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: pk-update-icon 0.1\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-10-20 12:16+0200\n"
+"POT-Creation-Date: 2011-10-20 12:32+0200\n"
 "PO-Revision-Date: 2011-10-20 10:50+0200\n"
 "Last-Translator: Guido Berhoerster <gber@opensuse.org>\n"
 "Language-Team: Indonesian\n"
@@ -42,23 +42,31 @@
 msgid "Software Updates"
 msgstr "Perangkat Lunak Pembaharuan-Pembaharuan"
 
-#: ../pkui-icon.c:117
+#: ../pkui-icon.c:127
+msgid "translators"
+msgstr "Guido Berhörster <gber@opensuse.org>"
+
+#: ../pkui-icon.c:154
 msgid "_Check for Updates"
 msgstr "Pemeriksaan untuk Pembaharuan-Pembaharuan"
 
-#: ../pkui-icon.c:146
+#: ../pkui-icon.c:162
+msgid "_About"
+msgstr "Tent_ang"
+
+#: ../pkui-icon.c:191
 msgid "Important Software Update"
 msgid_plural "Important Software Updates"
 msgstr[0] "Perangkat Lunak Pembaharuan yang penting"
 msgstr[1] "Perangkat Lunak Pembaharuan-Pembaharuan yang penting"
 
-#: ../pkui-icon.c:148
+#: ../pkui-icon.c:193
 msgid "Software Update"
 msgid_plural "Software Updates"
 msgstr[0] "Pembaharuan Perangkat Lunak"
 msgstr[1] "Pembaharuan-Pembaharuan Perangkat Lunak"
 
-#: ../pkui-icon.c:155
+#: ../pkui-icon.c:200
 #, c-format
 msgid "There are %d software updates available, %d of them is important."
 msgid_plural ""
@@ -67,14 +75,14 @@
 msgstr[1] ""
 "Tersedia Pembaharuan-Pembaharuan Perangkat Lunak, diantaranya adalah penting."
 
-#: ../pkui-icon.c:163
+#: ../pkui-icon.c:208
 #, c-format
 msgid "There is an important software update available."
 msgid_plural "There are %d important software updates available."
 msgstr[0] "Tersedia sebuah Pembaharuan Perangkat Lunak yang penting."
 msgstr[1] "Tersedia Pembaharuan-Pembaharuan Perangkat Lunak yang penting."
 
-#: ../pkui-icon.c:168
+#: ../pkui-icon.c:213
 #, c-format
 msgid "There is a software update available."
 msgid_plural "There are %d software updates available."