comparison pkui-icon.c @ 18:9537882d759f

add an about dialog
author Guido Berhoerster <guido@berhoerster.name>
date Thu, 20 Oct 2011 13:03:37 +0200
parents 64f05992d8ec
children 38b37e4a4d63
comparison
equal deleted inserted replaced
17:a28d0d9b5410 18:9537882d759f
96 96
97 self->priv->backend = NULL; 97 self->priv->backend = NULL;
98 } 98 }
99 99
100 static void 100 static void
101 about_dialog_show(GtkMenuItem *item, gpointer user_data)
102 {
103 static const gchar *copyright = "Copyright \xc2\xa9 2011 Guido "
104 "Berhoerster\nCopyright \xc2\xa9 2011 Pavol Rusnak\n";
105 static const gchar *authors[3] = {
106 "Guido Berhoerster <gber@opensuse.org>",
107 "Pavol Rusnak <stick@gk2.sk>",
108 NULL
109 };
110 static const gchar *documenters[2] = {
111 "Guido Berhoerster <gber@opensuse.org>",
112 NULL
113 };
114 static const gchar *license =
115 "Licensed under the GNU General Public License Version 2\n\nThis "
116 "program is free software; you can redistribute it and/or modify it"
117 " under the terms of the GNU General Public License as published by"
118 " the Free Software Foundation; either version 2 of the License, or"
119 " (at your option) any later version.\n\nThis program is "
120 "distributed in the hope that it will be useful, but WITHOUT ANY "
121 "WARRANTY; without even the implied warranty of MERCHANTABILITY or "
122 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public "
123 "License for more details.\n\nYou should have received a copy of "
124 "the GNU General Public License along with this program; if not, "
125 "write to the Free Software Foundation, Inc., 51 Franklin Street, "
126 "Fifth Floor, Boston, MA 02110-1301 USA.";
127 const gchar *translators = _("translators");
128
129 if (strcmp(translators, "translators") == 0)
130 translators = NULL;
131
132 gtk_show_about_dialog (NULL, "version", "0.1", "copyright", copyright,
133 "authors", authors, "documenters", documenters,
134 "translator-credits", translators, "license", license,
135 "wrap-license", TRUE, NULL);
136 }
137
138 static void
101 backend_check_now(GtkMenuItem *menu_item, gpointer user_data) 139 backend_check_now(GtkMenuItem *menu_item, gpointer user_data)
102 { 140 {
103 PkuiIcon *self = PKUI_ICON(user_data); 141 PkuiIcon *self = PKUI_ICON(user_data);
104 142
105 g_return_if_fail(PKUI_IS_BACKEND(self->priv->backend)); 143 g_return_if_fail(PKUI_IS_BACKEND(self->priv->backend));
119 GTK_ICON_SIZE_MENU); 157 GTK_ICON_SIZE_MENU);
120 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image); 158 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
121 gtk_menu_shell_append(GTK_MENU_SHELL(popup_menu), item); 159 gtk_menu_shell_append(GTK_MENU_SHELL(popup_menu), item);
122 g_signal_connect(G_OBJECT(item), "activate", 160 g_signal_connect(G_OBJECT(item), "activate",
123 G_CALLBACK(backend_check_now), self); 161 G_CALLBACK(backend_check_now), self);
162
163 item = gtk_image_menu_item_new_with_mnemonic(_("_About"));
164 image = gtk_image_new_from_icon_name(GTK_STOCK_ABOUT,
165 GTK_ICON_SIZE_MENU);
166 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
167 gtk_menu_shell_append(GTK_MENU_SHELL(popup_menu), item);
168 g_signal_connect(G_OBJECT(item), "activate",
169 G_CALLBACK(about_dialog_show), self);
124 170
125 gtk_widget_show_all(GTK_WIDGET(popup_menu)); 171 gtk_widget_show_all(GTK_WIDGET(popup_menu));
126 172
127 return (popup_menu); 173 return (popup_menu);
128 } 174 }