summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-06-27 20:46:56 +0200
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-06-27 20:46:56 +0200
commit0e25f2b3d4b2ce21a587703a08043d2b98a31d4d (patch)
treee6aab37c75355b09b270bbc874dc2b532cb48624 /plugins
parent4934931f6616d7e0c480ac7b5dedfeeaaa2a4fdc (diff)
shellexecui: disallow multiple shellexecui dialogs
Diffstat (limited to 'plugins')
-rw-r--r--plugins/shellexecui/callbacks.c1
-rw-r--r--plugins/shellexecui/callbacks.h4
-rw-r--r--plugins/shellexecui/interface.c4
-rw-r--r--plugins/shellexecui/shellexec.glade3
-rw-r--r--plugins/shellexecui/shellexecui.c11
5 files changed, 21 insertions, 2 deletions
diff --git a/plugins/shellexecui/callbacks.c b/plugins/shellexecui/callbacks.c
index b8fb56d3..019fde92 100644
--- a/plugins/shellexecui/callbacks.c
+++ b/plugins/shellexecui/callbacks.c
@@ -8,4 +8,3 @@
#include "interface.h"
#include "support.h"
-
diff --git a/plugins/shellexecui/callbacks.h b/plugins/shellexecui/callbacks.h
index c4b57687..4b1f2037 100644
--- a/plugins/shellexecui/callbacks.h
+++ b/plugins/shellexecui/callbacks.h
@@ -28,3 +28,7 @@ on_edit_cancel_button_clicked (GtkButton *button,
void
on_edit_ok_button_clicked (GtkButton *button,
gpointer user_data);
+
+void
+on_shellexec_conf_dialog_destroy (GObject *object,
+ gpointer user_data);
diff --git a/plugins/shellexecui/interface.c b/plugins/shellexecui/interface.c
index d00c0fc7..6296617b 100644
--- a/plugins/shellexecui/interface.c
+++ b/plugins/shellexecui/interface.c
@@ -44,6 +44,7 @@ create_shellexec_conf_dialog (void)
shellexec_conf_dialog = gtk_dialog_new ();
gtk_container_set_border_width (GTK_CONTAINER (shellexec_conf_dialog), 12);
gtk_window_set_title (GTK_WINDOW (shellexec_conf_dialog), _("Custom Shell Commands"));
+ gtk_window_set_destroy_with_parent (GTK_WINDOW (shellexec_conf_dialog), TRUE);
gtk_window_set_type_hint (GTK_WINDOW (shellexec_conf_dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
gtk_dialog_set_has_separator (GTK_DIALOG (shellexec_conf_dialog), FALSE);
@@ -89,6 +90,9 @@ create_shellexec_conf_dialog (void)
gtk_dialog_add_action_widget (GTK_DIALOG (shellexec_conf_dialog), save_button, 0);
gtk_widget_set_can_default(save_button, TRUE);
+ g_signal_connect ((gpointer) shellexec_conf_dialog, "destroy",
+ G_CALLBACK (on_shellexec_conf_dialog_destroy),
+ NULL);
g_signal_connect ((gpointer) add_button, "clicked",
G_CALLBACK (on_add_button_clicked),
NULL);
diff --git a/plugins/shellexecui/shellexec.glade b/plugins/shellexecui/shellexec.glade
index aea894ae..aa872167 100644
--- a/plugins/shellexecui/shellexec.glade
+++ b/plugins/shellexecui/shellexec.glade
@@ -11,7 +11,7 @@
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
+ <property name="destroy_with_parent">True</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
@@ -20,6 +20,7 @@
<property name="focus_on_map">True</property>
<property name="urgency_hint">False</property>
<property name="has_separator">False</property>
+ <signal name="destroy" handler="on_shellexec_conf_dialog_destroy" last_modification_time="Fri, 27 Jun 2014 18:45:21 GMT"/>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox">
diff --git a/plugins/shellexecui/shellexecui.c b/plugins/shellexecui/shellexecui.c
index 482cec2b..6b6744dd 100644
--- a/plugins/shellexecui/shellexecui.c
+++ b/plugins/shellexecui/shellexecui.c
@@ -345,9 +345,20 @@ init_treeview() {
g_object_unref(liststore);
}
+void
+on_shellexec_conf_dialog_destroy (GObject *object,
+ gpointer user_data)
+{
+ conf_dlg = NULL;
+}
+
+
static gboolean
shellexecui_action_gtk (void *data)
{
+ if (conf_dlg) {
+ return FALSE;
+ }
conf_dlg = create_shellexec_conf_dialog();
gtk_widget_set_size_request (conf_dlg, 400, 400);
gtk_window_set_transient_for(GTK_WINDOW(conf_dlg),