Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 302524 Details for
Bug 442398
"Do not ask me again" buttons don't work
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
what's in git master
gpk-dont-notify-anymore.patch (text/plain), 16.80 KB, created by
Richard Hughes
on 2008-04-15 21:01:52 UTC
(
hide
)
Description:
what's in git master
Filename:
MIME Type:
Creator:
Richard Hughes
Created:
2008-04-15 21:01:52 UTC
Size:
16.80 KB
patch
obsolete
>diff --git a/data/gnome-packagekit.schemas.in b/data/gnome-packagekit.schemas.in >index eac311b..2d63356 100644 >--- a/data/gnome-packagekit.schemas.in >+++ b/data/gnome-packagekit.schemas.in >@@ -14,38 +14,62 @@ > </schema> > > <schema> >- <key>/schemas/apps/gnome-packagekit/notify_restart</key> >- <applyto>/apps/gnome-packagekit/notify_restart</applyto> >+ <key>/schemas/apps/gnome-packagekit/notify_update_failed</key> >+ <applyto>/apps/gnome-packagekit/notify_update_failed</applyto> > <owner>gnome-packagekit</owner> > <type>bool</type> > <default>true</default> > <locale name="C"> >- <short>Notify the user when we have to restart</short> >- <long>Notify the user when we have to restart</long> >+ <short>Notify the user when we have failed an update</short> >+ <long>Notify the user when we have failed an update</long> > </locale> > </schema> > > <schema> >- <key>/schemas/apps/gnome-packagekit/notify_battery_update</key> >- <applyto>/apps/gnome-packagekit/notify_battery_update</applyto> >+ <key>/schemas/apps/gnome-packagekit/notify_update_complete</key> >+ <applyto>/apps/gnome-packagekit/notify_update_complete</applyto> > <owner>gnome-packagekit</owner> > <type>bool</type> > <default>true</default> > <locale name="C"> >- <short>Notify the user when we have not started an autoupdate on battery</short> >- <long>Notify the user when we have not started an autoupdate on battery</long> >+ <short>Notify the user when we have completed an update</short> >+ <long>Notify the user when we have completed an update</long> > </locale> > </schema> > > <schema> >- <key>/schemas/apps/gnome-packagekit/notify_started</key> >- <applyto>/apps/gnome-packagekit/notify_started</applyto> >+ <key>/schemas/apps/gnome-packagekit/notify_update_complete_restart</key> >+ <applyto>/apps/gnome-packagekit/notify_update_complete_restart</applyto> > <owner>gnome-packagekit</owner> > <type>bool</type> > <default>true</default> > <locale name="C"> >- <short>Notify the user when we have started a task</short> >- <long>Notify the user when we have started a task</long> >+ <short>Notify the user when we have completed an update and need to restart</short> >+ <long>Notify the user when we have completed an update and need to restart</long> >+ </locale> >+ </schema> >+ >+ <schema> >+ <key>/schemas/apps/gnome-packagekit/notify_update_not_battery</key> >+ <applyto>/apps/gnome-packagekit/notify_update_not_battery</applyto> >+ <owner>gnome-packagekit</owner> >+ <type>bool</type> >+ <default>true</default> >+ <locale name="C"> >+ <short>Notify the user when we have not started an auto-update on battery</short> >+ <long>Notify the user when we have not started an auto-update on battery</long> >+ </locale> >+ </schema> >+ >+ <schema> >+ <key>/schemas/apps/gnome-packagekit/notify_update_started</key> >+ <applyto>/apps/gnome-packagekit/notify_update_started</applyto> >+ <owner>gnome-packagekit</owner> >+ <type>bool</type> >+ <default>true</default> >+ <locale name="C"> >+ <short>Notify the user when we have started an update</short> >+ <long>Notify the user when we have started an update</long> > </locale> > </schema> > >diff --git a/libpackagekit-gnome/gpk-common.h b/libpackagekit-gnome/gpk-common.h >index 22f216b..0fc1761 100644 >--- a/libpackagekit-gnome/gpk-common.h >+++ b/libpackagekit-gnome/gpk-common.h >@@ -32,9 +32,11 @@ G_BEGIN_DECLS > #define GPK_CONF_NOTIFY_CRITICAL "/apps/gnome-packagekit/notify_critical" > #define GPK_CONF_NOTIFY_ERROR "/apps/gnome-packagekit/notify_errors" > #define GPK_CONF_NOTIFY_MESSAGE "/apps/gnome-packagekit/notify_message" >-#define GPK_CONF_NOTIFY_STARTED "/apps/gnome-packagekit/notify_started" >-#define GPK_CONF_NOTIFY_BATTERY_UPDATE "/apps/gnome-packagekit/notify_battery_update" >-#define GPK_CONF_NOTIFY_RESTART "/apps/gnome-packagekit/notify_restart" >+#define GPK_CONF_NOTIFY_UPDATE_STARTED "/apps/gnome-packagekit/notify_update_started" >+#define GPK_CONF_NOTIFY_UPDATE_NOT_BATTERY "/apps/gnome-packagekit/notify_update_not_battery" >+#define GPK_CONF_NOTIFY_UPDATE_FAILED "/apps/gnome-packagekit/notify_update_failed" >+#define GPK_CONF_NOTIFY_UPDATE_COMPLETE "/apps/gnome-packagekit/notify_update_complete" >+#define GPK_CONF_NOTIFY_UPDATE_COMPLETE_RESTART "/apps/gnome-packagekit/notify_update_complete_restart" > #define GPK_CONF_AUTOCOMPLETE "/apps/gnome-packagekit/autocomplete" > #define GPK_CONF_SESSION_STARTUP_TIMEOUT "/apps/gnome-packagekit/session_startup_timeout" > #define GPK_CONF_FREQUENCY_GET_UPDATES "/apps/gnome-packagekit/frequency_get_updates" >diff --git a/src/gpk-notify.c b/src/gpk-notify.c >index 632c8e6..e04c967 100644 >--- a/src/gpk-notify.c >+++ b/src/gpk-notify.c >@@ -146,7 +146,7 @@ gpk_notify_about_dialog_url_cb (GtkAboutDialog *about, const char *address, gpoi > cmdline = g_strconcat ("gnome-open ", url, NULL); > ret = gdk_spawn_command_line_on_screen (gscreen, cmdline, &error); > g_free (cmdline); >- >+ > if (ret == FALSE) { > error_dialog = gtk_message_dialog_new (GTK_WINDOW (about), > GTK_DIALOG_MODAL, >@@ -232,10 +232,7 @@ gpk_notify_show_about_cb (GtkMenuItem *item, gpointer data) > * Display the popup menu. > **/ > static void >-gpk_notify_popup_menu_cb (GtkStatusIcon *status_icon, >- guint button, >- guint32 timestamp, >- GpkNotify *icon) >+gpk_notify_popup_menu_cb (GtkStatusIcon *status_icon, guint button, guint32 timestamp, GpkNotify *icon) > { > GtkMenu *menu = (GtkMenu*) gtk_menu_new (); > GtkWidget *item; >@@ -299,7 +296,6 @@ gpk_notify_update_system_finished_cb (PkClient *client, PkExitEnum exit_code, gu > GString *message_text; > guint skipped_number = 0; > const gchar *message; >- gboolean value; > > g_return_if_fail (GPK_IS_NOTIFY (notify)); > >@@ -318,13 +314,6 @@ gpk_notify_update_system_finished_cb (PkClient *client, PkExitEnum exit_code, gu > return; > } > >- /* are we accepting notifications */ >- value = gconf_client_get_bool (notify->priv->gconf_client, GPK_CONF_NOTIFY_MESSAGE, NULL); >- if (value == FALSE) { >- pk_debug ("not showing notification as prevented in gconf"); >- return; >- } >- > message_text = g_string_new (""); > > /* find any we skipped */ >@@ -368,16 +357,19 @@ gpk_notify_update_system_finished_cb (PkClient *client, PkExitEnum exit_code, gu > g_string_set_size (message_text, message_text->len-1); > } > >- /* do the notify, and show the right buttons */ >- pk_debug ("Doing notification"); >+ /* this will not show if specified in gconf */ > gpk_smart_icon_notify_new (notify->priv->sicon, > _("The system update has completed"), message_text->str, > "software-update-available", > GPK_NOTIFY_URGENCY_LOW, GPK_NOTIFY_TIMEOUT_LONG); > if (restart == PK_RESTART_ENUM_SYSTEM) { > gpk_smart_icon_notify_button (notify->priv->sicon, GPK_NOTIFY_BUTTON_RESTART_COMPUTER, NULL); >+ gpk_smart_icon_notify_button (notify->priv->sicon, GPK_NOTIFY_BUTTON_DO_NOT_SHOW_AGAIN, >+ GPK_CONF_NOTIFY_UPDATE_COMPLETE_RESTART); >+ } else { >+ gpk_smart_icon_notify_button (notify->priv->sicon, GPK_NOTIFY_BUTTON_DO_NOT_SHOW_AGAIN, >+ GPK_CONF_NOTIFY_UPDATE_COMPLETE); > } >- gpk_smart_icon_notify_button (notify->priv->sicon, GPK_NOTIFY_BUTTON_DO_NOT_SHOW_AGAIN, GPK_CONF_NOTIFY_RESTART); > gpk_smart_icon_notify_show (notify->priv->sicon); > g_string_free (message_text, TRUE); > } >@@ -411,7 +403,9 @@ gpk_notify_update_system (GpkNotify *notify) > gpk_smart_icon_notify_new (notify->priv->sicon, _("Failed to update system"), message, > "process-stop", GPK_NOTIFY_URGENCY_LOW, GPK_NOTIFY_TIMEOUT_SHORT); > g_free (message); >- gpk_smart_icon_notify_button (notify->priv->sicon, GPK_NOTIFY_BUTTON_DO_NOT_SHOW_AGAIN, GPK_CONF_NOTIFY_ERROR); >+ gpk_smart_icon_notify_button (notify->priv->sicon, >+ GPK_NOTIFY_BUTTON_DO_NOT_SHOW_AGAIN, >+ GPK_CONF_NOTIFY_UPDATE_FAILED); > gpk_smart_icon_notify_show (notify->priv->sicon); > } > return ret; >@@ -497,18 +491,10 @@ gpk_notify_critical_updates_warning (GpkNotify *notify, const gchar *details, gu > { > const gchar *title; > gchar *message; >- gboolean value; > GString *string; > > g_return_if_fail (GPK_IS_NOTIFY (notify)); > >- /* are we accepting notifications */ >- value = gconf_client_get_bool (notify->priv->gconf_client, GPK_CONF_NOTIFY_CRITICAL, NULL); >- if (value == FALSE) { >- pk_debug ("not showing notification as prevented in gconf"); >- return; >- } >- > /* format title */ > title = ngettext ("Security update available", "Security updates available", number); > >@@ -520,7 +506,7 @@ gpk_notify_critical_updates_warning (GpkNotify *notify, const gchar *details, gu > g_string_append (string, details); > message = g_string_free (string, FALSE); > >- pk_debug ("Doing critical updates warning: %s", message); >+ /* this will not show if specified in gconf */ > gpk_smart_icon_notify_new (notify->priv->sicon, title, message, "software-update-urgent", > GPK_NOTIFY_URGENCY_CRITICAL, GPK_NOTIFY_TIMEOUT_NEVER); > gpk_smart_icon_notify_button (notify->priv->sicon, GPK_NOTIFY_BUTTON_UPDATE_COMPUTER, NULL); >@@ -536,23 +522,17 @@ gpk_notify_critical_updates_warning (GpkNotify *notify, const gchar *details, gu > static void > gpk_notify_auto_update_message (GpkNotify *notify) > { >- gboolean value; >- > g_return_if_fail (GPK_IS_NOTIFY (notify)); > >- /* are we accepting notifications */ >- value = gconf_client_get_bool (notify->priv->gconf_client, GPK_CONF_NOTIFY_MESSAGE, NULL); >- if (value == FALSE) { >- pk_debug ("not showing notification as prevented in gconf"); >- return; >- } >- >+ /* this will not show if specified in gconf */ > gpk_smart_icon_notify_new (notify->priv->sicon, > _("Updates are being installed"), >- _("Updates are being automatically installed on your computer"), "software-update-urgent", >+ _("Updates are being automatically installed on your computer"), >+ "software-update-urgent", > GPK_NOTIFY_URGENCY_LOW, GPK_NOTIFY_TIMEOUT_LONG); > gpk_smart_icon_notify_button (notify->priv->sicon, GPK_NOTIFY_BUTTON_CANCEL_UPDATE, NULL); >- gpk_smart_icon_notify_button (notify->priv->sicon, GPK_NOTIFY_BUTTON_DO_NOT_SHOW_AGAIN, GPK_CONF_NOTIFY_STARTED); >+ gpk_smart_icon_notify_button (notify->priv->sicon, GPK_NOTIFY_BUTTON_DO_NOT_SHOW_AGAIN, >+ GPK_CONF_NOTIFY_UPDATE_STARTED); > gpk_smart_icon_notify_show (notify->priv->sicon); > } > >@@ -629,28 +609,25 @@ gpk_notify_check_on_battery (GpkNotify *notify) > { > gboolean on_battery; > gboolean conf_update_battery; >- gboolean value; >+ gboolean ret; > > g_return_val_if_fail (GPK_IS_NOTIFY (notify), FALSE); > > on_battery = gpk_auto_refresh_get_on_battery (notify->priv->arefresh); > conf_update_battery = gconf_client_get_bool (notify->priv->gconf_client, GPK_CONF_UPDATE_BATTERY, NULL); > if (!conf_update_battery && on_battery) { >- /* are we accepting notifications */ >- value = gconf_client_get_bool (notify->priv->gconf_client, GPK_CONF_NOTIFY_BATTERY_UPDATE, NULL); >- if (value) { >- gpk_smart_icon_notify_new (notify->priv->sicon, >- _("Will not install updates"), >- _("Automatic updates are not being installed as the computer is on battery power"), >- "dialog-information", GPK_NOTIFY_URGENCY_LOW, GPK_NOTIFY_TIMEOUT_LONG); >- gpk_smart_icon_notify_button (notify->priv->sicon, >- GPK_NOTIFY_BUTTON_DO_NOT_SHOW_AGAIN, >- GPK_CONF_NOTIFY_BATTERY_UPDATE); >- gpk_smart_icon_notify_show (notify->priv->sicon); >- } >- return FALSE; >+ /* this will not show if specified in gconf */ >+ gpk_smart_icon_notify_new (notify->priv->sicon, >+ _("Will not install updates"), >+ _("Automatic updates are not being installed as the computer is on battery power"), >+ "dialog-information", >+ GPK_NOTIFY_URGENCY_LOW, GPK_NOTIFY_TIMEOUT_LONG); >+ gpk_smart_icon_notify_button (notify->priv->sicon, >+ GPK_NOTIFY_BUTTON_DO_NOT_SHOW_AGAIN, >+ GPK_CONF_NOTIFY_UPDATE_NOT_BATTERY); >+ ret = gpk_smart_icon_notify_show (notify->priv->sicon); > } >- return TRUE; >+ return ret; > } > > /** >@@ -826,7 +803,6 @@ static void > gpk_notify_error_code_cb (PkClient *client, PkErrorCodeEnum error_code, const gchar *details, GpkNotify *notify) > { > const gchar *title; >- gboolean value; > > g_return_if_fail (GPK_IS_NOTIFY (notify)); > >@@ -839,16 +815,11 @@ gpk_notify_error_code_cb (PkClient *client, PkErrorCodeEnum error_code, const gc > return; > } > >- /* are we accepting notifications */ >- value = gconf_client_get_bool (notify->priv->gconf_client, GPK_CONF_NOTIFY_ERROR, NULL); >- if (value == FALSE) { >- pk_debug ("not showing notification as prevented in gconf"); >- return; >- } >- >+ /* this will not show if specified in gconf */ > gpk_smart_icon_notify_new (notify->priv->sicon, title, details, "help-browser", > GPK_NOTIFY_URGENCY_LOW, GPK_NOTIFY_TIMEOUT_LONG); >- gpk_smart_icon_notify_button (notify->priv->sicon, GPK_NOTIFY_BUTTON_DO_NOT_SHOW_AGAIN, GPK_CONF_NOTIFY_ERROR); >+ gpk_smart_icon_notify_button (notify->priv->sicon, >+ GPK_NOTIFY_BUTTON_DO_NOT_SHOW_AGAIN, GPK_CONF_NOTIFY_ERROR); > gpk_smart_icon_notify_show (notify->priv->sicon); > } > >diff --git a/src/gpk-smart-icon.c b/src/gpk-smart-icon.c >index 994557a..11f00d6 100644 >--- a/src/gpk-smart-icon.c >+++ b/src/gpk-smart-icon.c >@@ -38,6 +38,7 @@ > #include <libnotify/notify.h> > #include <gtk/gtkstatusicon.h> > #include <libnotify/notify.h> >+#include <gconf/gconf-client.h> > > #include <pk-debug.h> > #include <pk-enum.h> >@@ -56,10 +57,12 @@ struct GpkSmartIconPrivate > { > GtkStatusIcon *status_icon; > NotifyNotification *dialog; >+ GConfClient *gconf_client; > gchar *current; > gchar *new; > gchar *notify_data; > guint event_source; >+ gboolean has_gconf_check; > }; > > enum { >@@ -201,12 +204,17 @@ gpk_smart_icon_set_tooltip (GpkSmartIcon *sicon, const gchar *tooltip) > **/ > gboolean > gpk_smart_icon_notify_new (GpkSmartIcon *sicon, const gchar *title, const gchar *message, >- const gchar *icon, GpkNotifyUrgency urgency, GpkNotifyTimeout timeout) >+ const gchar *icon, GpkNotifyUrgency urgency, GpkNotifyTimeout timeout) > { > guint timeout_val = 0; > > g_return_val_if_fail (PK_IS_SMART_ICON (sicon), FALSE); > >+ pk_debug ("Doing notification: %s, %s, %s", title, message, icon); >+ >+ /* no gconf to check */ >+ sicon->priv->has_gconf_check = FALSE; >+ > /* default values */ > if (timeout == GPK_NOTIFY_TIMEOUT_SHORT) { > timeout_val = 5000; >@@ -259,8 +267,10 @@ gpk_smart_icon_notify_button (GpkSmartIcon *sicon, GpkNotifyButton button, const > /* find the localised text */ > if (button == GPK_NOTIFY_BUTTON_DO_NOT_SHOW_AGAIN) { > text = _("Do not show this notification again"); >+ sicon->priv->has_gconf_check = TRUE; > } else if (button == GPK_NOTIFY_BUTTON_DO_NOT_WARN_AGAIN) { > text = _("Do not warn me again"); >+ sicon->priv->has_gconf_check = TRUE; > } else if (button == GPK_NOTIFY_BUTTON_CANCEL_UPDATE) { > text = _("Cancel system update"); > } else if (button == GPK_NOTIFY_BUTTON_UPDATE_COMPUTER) { >@@ -279,15 +289,35 @@ gpk_smart_icon_notify_button (GpkSmartIcon *sicon, GpkNotifyButton button, const > > /** > * gpk_smart_icon_notify_show: >+ * Return value: if the notification is being displayed >+ * >+ * This will show the notification previously setup with gpk_smart_icon_notify_new() and >+ * gpk_smart_icon_notify_button(). >+ * >+ * If you set a key using %GPK_NOTIFY_BUTTON_DO_NOT_SHOW_AGAIN or >+ * %GPK_NOTIFY_BUTTON_DO_NOT_WARN_AGAIN then this key will be checked before the notification is >+ * shown. > **/ > gboolean > gpk_smart_icon_notify_show (GpkSmartIcon *sicon) > { > GError *error = NULL; >+ gboolean value; > > g_return_val_if_fail (PK_IS_SMART_ICON (sicon), FALSE); > g_return_val_if_fail (sicon->priv->dialog != NULL, FALSE); > >+ /* check the gconf key isn't set to ignore */ >+ if (sicon->priv->has_gconf_check) { >+ pk_debug ("key is %s", sicon->priv->notify_data); >+ /* are we accepting notifications */ >+ value = gconf_client_get_bool (sicon->priv->gconf_client, sicon->priv->notify_data, NULL); >+ if (!value) { >+ pk_debug ("not showing notification as prevented in gconf with %s", sicon->priv->notify_data); >+ return FALSE; >+ } >+ } >+ > notify_notification_close (sicon->priv->dialog, NULL); > notify_notification_show (sicon->priv->dialog, &error); > if (error != NULL) { >@@ -323,6 +353,8 @@ gpk_smart_icon_init (GpkSmartIcon *sicon) > sicon->priv->dialog = NULL; > sicon->priv->notify_data = NULL; > sicon->priv->event_source = 0; >+ sicon->priv->has_gconf_check = FALSE; >+ sicon->priv->gconf_client = gconf_client_get_default (); > > /* signal we are here... */ > notify_init ("packagekit"); >@@ -346,6 +378,7 @@ gpk_smart_icon_finalize (GObject *object) > > g_free (sicon->priv->new); > g_free (sicon->priv->current); >+ g_object_unref (sicon->priv->gconf_client); > > g_object_unref (sicon->priv->status_icon); > if (sicon->priv->dialog != NULL) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 442398
:
302387
| 302524