aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-09-30 23:53:42 +0800
committerMilan Crha <mcrha@redhat.com>2013-09-30 23:55:19 +0800
commit9fa92f150e3d150e8a17962f26a42f594aa45793 (patch)
tree2684d9bd7695c4c56c9ab37c8990694e1c349b90
parentb1005b64b65b8ff7c0d19088620963a4892d2295 (diff)
downloadgsoc2013-evolution-9fa92f150e3d150e8a17962f26a42f594aa45793.tar
gsoc2013-evolution-9fa92f150e3d150e8a17962f26a42f594aa45793.tar.gz
gsoc2013-evolution-9fa92f150e3d150e8a17962f26a42f594aa45793.tar.bz2
gsoc2013-evolution-9fa92f150e3d150e8a17962f26a42f594aa45793.tar.lz
gsoc2013-evolution-9fa92f150e3d150e8a17962f26a42f594aa45793.tar.xz
gsoc2013-evolution-9fa92f150e3d150e8a17962f26a42f594aa45793.tar.zst
gsoc2013-evolution-9fa92f150e3d150e8a17962f26a42f594aa45793.zip
Bug #708840 - Crash when closing subscription dialog with running operation
-rw-r--r--mail/em-subscription-editor.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/mail/em-subscription-editor.c b/mail/em-subscription-editor.c
index c8b3c016e3..88240e9c9d 100644
--- a/mail/em-subscription-editor.c
+++ b/mail/em-subscription-editor.c
@@ -1429,6 +1429,33 @@ subscription_editor_add_store (EMSubscriptionEditor *editor,
}
static void
+emse_notebook_sensitive_changed_cb (GtkWidget *notebook,
+ GParamSpec *param,
+ GtkDialog *editor)
+{
+ gtk_dialog_set_response_sensitive (editor,
+ GTK_RESPONSE_CLOSE, gtk_widget_get_sensitive (notebook));
+}
+
+static gboolean
+subscription_editor_delete_event_cb (EMSubscriptionEditor *editor,
+ GdkEvent *event,
+ gpointer user_data)
+{
+ /* stop processing if the button is insensitive */
+ return !gtk_widget_get_sensitive (editor->priv->notebook);
+}
+
+static void
+subscription_editor_response_cb (EMSubscriptionEditor *editor,
+ gint response_id,
+ gpointer user_data)
+{
+ if (!gtk_widget_get_sensitive (editor->priv->notebook))
+ g_signal_stop_emission_by_name (editor, "response");
+}
+
+static void
subscription_editor_set_store (EMSubscriptionEditor *editor,
CamelStore *store)
{
@@ -1574,6 +1601,9 @@ subscription_editor_constructed (GObject *object)
/* Chain up to parent's constructed() method. */
G_OBJECT_CLASS (em_subscription_editor_parent_class)->constructed (object);
+
+ g_signal_connect (editor, "delete-event", G_CALLBACK (subscription_editor_delete_event_cb), NULL);
+ g_signal_connect (editor, "response", G_CALLBACK (subscription_editor_response_cb), NULL);
}
static void
@@ -1771,6 +1801,9 @@ em_subscription_editor_init (EMSubscriptionEditor *editor)
G_BINDING_BIDIRECTIONAL |
G_BINDING_SYNC_CREATE);
+ g_signal_connect (widget, "notify::sensitive",
+ G_CALLBACK (emse_notebook_sensitive_changed_cb), editor);
+
widget = gtk_button_box_new (GTK_ORIENTATION_VERTICAL);
gtk_box_set_spacing (GTK_BOX (widget), 6);
gtk_button_box_set_layout (