comparison pkui-icon.c @ 39:f6edbee6441f

Stylistic fixes
author Guido Berhoerster <gber@opensuse.org>
date Fri, 07 Feb 2014 21:56:46 +0100
parents bae8a7e20382
children aa5d3752091d
comparison
equal deleted inserted replaced
38:db09b66c3853 39:f6edbee6441f
37 GtkStatusIcon *status_icon; 37 GtkStatusIcon *status_icon;
38 GtkWidget *status_icon_popup_menu; 38 GtkWidget *status_icon_popup_menu;
39 NotifyNotification *notification; 39 NotifyNotification *notification;
40 }; 40 };
41 41
42 static GtkWidget* icon_popup_menu_create(PkuiIcon *self); 42 static GtkWidget* icon_popup_menu_create(PkuiIcon *self);
43 static void icon_popup_menu_popup(GtkStatusIcon *status_icon, guint button, 43 static void icon_popup_menu_popup(GtkStatusIcon *status_icon, guint button,
44 guint activate_time, gpointer user_data); 44 guint activate_time, gpointer user_data);
45 static void icon_activated(GtkStatusIcon *status_icon, gpointer user_data); 45 static void icon_activated(GtkStatusIcon *status_icon, gpointer user_data);
46 static void hide_notification(PkuiIcon *self); 46 static void hide_notification(PkuiIcon *self);
47 static void backend_state_changed(PkuiBackend *backend, gpointer user_data); 47 static void backend_state_changed(PkuiBackend *backend, gpointer user_data);
48 static void update_viewer_exited(GPid pid, gint status, gpointer user_data); 48 static void update_viewer_exited(GPid pid, gint status, gpointer user_data);
49 49
50 static void 50 static void
51 pkui_icon_finalize(GObject *gobject) 51 pkui_icon_finalize(GObject *gobject)
52 { 52 {
53 PkuiIcon *self = PKUI_ICON(gobject); 53 PkuiIcon *self = PKUI_ICON(gobject);
123 } 123 }
124 124
125 static void 125 static void
126 about_dialog_show(GtkMenuItem *item, gpointer user_data) 126 about_dialog_show(GtkMenuItem *item, gpointer user_data)
127 { 127 {
128 static const gchar *copyright = "Copyright \xc2\xa9 2011 Guido " 128 static const gchar *copyright = "Copyright \xc2\xa9 2011 Guido "
129 "Berhoerster\nCopyright \xc2\xa9 2011 Pavol Rusnak\n"; 129 "Berhoerster\nCopyright \xc2\xa9 2011 Pavol Rusnak\n";
130 static const gchar *authors[3] = { 130 static const gchar *authors[3] = {
131 "Guido Berhoerster <gber@opensuse.org>", 131 "Guido Berhoerster <gber@opensuse.org>",
132 "Pavol Rusnak <stick@gk2.sk>", 132 "Pavol Rusnak <stick@gk2.sk>",
133 NULL 133 NULL
134 }; 134 };
135 static const gchar *documenters[2] = { 135 static const gchar *documenters[2] = {
136 "Guido Berhoerster <gber@opensuse.org>", 136 "Guido Berhoerster <gber@opensuse.org>",
137 NULL 137 NULL
138 }; 138 };
139 static const gchar *license = 139 static const gchar *license =
140 "Licensed under the GNU General Public License Version 2\n\nThis " 140 "Licensed under the GNU General Public License Version 2\n\n"
141 "program is free software; you can redistribute it and/or modify it" 141 "This program is free software; you can redistribute it and/or "
142 " under the terms of the GNU General Public License as published by" 142 "modify it under the terms of the GNU General Public License as "
143 " the Free Software Foundation; either version 2 of the License, or" 143 "published by the Free Software Foundation; either version 2 of "
144 " (at your option) any later version.\n\nThis program is " 144 "the License, or (at your option) any later version.\n\n"
145 "distributed in the hope that it will be useful, but WITHOUT ANY " 145 "This program is distributed in the hope that it will be useful, "
146 "WARRANTY; without even the implied warranty of MERCHANTABILITY or " 146 "but WITHOUT ANY WARRANTY; without even the implied warranty of "
147 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public " 147 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU "
148 "License for more details.\n\nYou should have received a copy of " 148 "General Public License for more details.\n\n"
149 "the GNU General Public License along with this program; if not, " 149 "You should have received a copy of the GNU General Public License "
150 "write to the Free Software Foundation, Inc., 51 Franklin Street, " 150 "along with this program; if not, write to the Free Software "
151 "Fifth Floor, Boston, MA 02110-1301 USA."; 151 "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, "
152 const gchar *translators = _("translators"); 152 "MA 02110-1301 USA.";
153 const gchar *translators = _("translators");
153 154
154 if (strcmp(translators, "translators") == 0) 155 if (strcmp(translators, "translators") == 0)
155 translators = NULL; 156 translators = NULL;
156 157
157 gtk_show_about_dialog (NULL, "version", VERSION, "copyright", copyright, 158 gtk_show_about_dialog (NULL, "version", VERSION, "copyright", copyright,
200 201
201 static void 202 static void
202 icon_popup_menu_popup(GtkStatusIcon *status_icon, guint button, 203 icon_popup_menu_popup(GtkStatusIcon *status_icon, guint button,
203 guint activate_time, gpointer user_data) 204 guint activate_time, gpointer user_data)
204 { 205 {
205 PkuiIcon *self = PKUI_ICON(user_data); 206 PkuiIcon *self = PKUI_ICON(user_data);
206 207
207 gtk_menu_popup(GTK_MENU(self->priv->status_icon_popup_menu), NULL, NULL, 208 gtk_menu_popup(GTK_MENU(self->priv->status_icon_popup_menu), NULL, NULL,
208 NULL, NULL, button, activate_time); 209 NULL, NULL, button, activate_time);
209 } 210 }
210 211
211 static void 212 static void
212 notification_handle_action(NotifyNotification *notification, gchar *action, 213 notification_handle_action(NotifyNotification *notification, gchar *action,
213 gpointer user_data) 214 gpointer user_data)
214 { 215 {
215 PkuiIcon *self = PKUI_ICON(user_data); 216 PkuiIcon *self = PKUI_ICON(user_data);
216 217
217 if (strcmp(action, "install-updates") == 0) 218 if (strcmp(action, "install-updates") == 0)
218 exec_update_viewer(self); 219 exec_update_viewer(self);
219 } 220 }
220 221
221 static void 222 static void
222 update_notification(PkuiIcon *self, guint updates_normal, 223 update_notification(PkuiIcon *self, guint updates_normal,
223 guint updates_important) 224 guint updates_important)
224 { 225 {
225 gchar *message; 226 gchar *message;
226 gchar *title = updates_important ? 227 gchar *title = updates_important ?
227 ngettext("Important Software Update", "Important Software Updates", 228 ngettext("Important Software Update", "Important Software Updates",
228 updates_important + updates_normal) : 229 updates_important + updates_normal) :
229 ngettext("Software Update", "Software Updates", updates_important + 230 ngettext("Software Update", "Software Updates", updates_important +
230 updates_normal); 231 updates_normal);
231 gchar *icon = updates_important ? "software-update-urgent" : 232 gchar *icon = updates_important ? "software-update-urgent" :
232 "software-update-available"; 233 "software-update-available";
233 234
234 if (updates_important > 0) 235 if (updates_important > 0)
235 if (updates_normal > 0) 236 if (updates_normal > 0)
236 message = g_strdup_printf(ngettext("There are %d " 237 message = g_strdup_printf(ngettext("There are %d "