summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mate-panel/mate-panel-applet-frame.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/mate-panel/mate-panel-applet-frame.c b/mate-panel/mate-panel-applet-frame.c
index dda1290e..ab301838 100644
--- a/mate-panel/mate-panel-applet-frame.c
+++ b/mate-panel/mate-panel-applet-frame.c
@@ -46,6 +46,10 @@
#include "mate-panel-applet-frame.h"
+#define PANEL_RESPONSE_DELETE 0
+#define PANEL_RESPONSE_DONT_RELOAD 1
+#define PANEL_RESPONSE_RELOAD 2
+
static void mate_panel_applet_frame_activating_free (MatePanelAppletFrameActivating *frame_act);
static void mate_panel_applet_frame_loading_failed (const char *iid,
@@ -816,7 +820,7 @@ mate_panel_applet_frame_reload_response (GtkWidget *dialog,
info = frame->priv->applet_info;
- if (response == GTK_RESPONSE_YES) {
+ if (response == PANEL_RESPONSE_RELOAD) {
PanelWidget *panel;
char *iid;
char *id = NULL;
@@ -839,11 +843,11 @@ mate_panel_applet_frame_reload_response (GtkWidget *dialog,
g_free (iid);
g_free (id);
- } else if (info) {
+ } else if (response == PANEL_RESPONSE_DELETE) {
/* if we can't write to applets list we can't really delete
it, so we'll just ignore this. FIXME: handle this
more correctly I suppose. */
- if (panel_profile_id_lists_are_writable ())
+ if (panel_profile_id_lists_are_writable () && info)
panel_profile_delete_object (info);
}
@@ -886,13 +890,21 @@ _mate_panel_applet_frame_applet_broken (MatePanelAppletFrame *frame)
gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- _("_Don't Reload"), GTK_RESPONSE_NO,
- _("_Reload"), GTK_RESPONSE_YES,
- NULL);
+ if (panel_profile_id_lists_are_writable ()) {
+ gtk_dialog_add_buttons (GTK_DIALOG (dialog),
+ _("D_elete"), PANEL_RESPONSE_DELETE,
+ _("_Don't Reload"), PANEL_RESPONSE_DONT_RELOAD,
+ _("_Reload"), PANEL_RESPONSE_RELOAD,
+ NULL);
+ } else {
+ gtk_dialog_add_buttons (GTK_DIALOG (dialog),
+ _("_Don't Reload"), PANEL_RESPONSE_DONT_RELOAD,
+ _("_Reload"), PANEL_RESPONSE_RELOAD,
+ NULL);
+ }
gtk_dialog_set_default_response (GTK_DIALOG (dialog),
- GTK_RESPONSE_YES);
+ PANEL_RESPONSE_RELOAD);
gtk_window_set_screen (GTK_WINDOW (dialog), screen);