[gnome-commander] Make dialogs opened from the options dialog modal and transient



commit b94999d78decdfe7374713d696a9c7224836272d
Author: Thomas Jost <thomas jost gmail com>
Date:   Fri Sep 24 16:00:04 2010 +0200

    Make dialogs opened from the options dialog modal and transient
    
    Without this, it is possible close the Options dialog while a child dialog is
    open. When this child dialog will be closed, its modifications will just be
    discarded, which is probably not what the user wants.

 src/gnome-cmd-options-dialog.cc |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/gnome-cmd-options-dialog.cc b/src/gnome-cmd-options-dialog.cc
index cd61d84..75beb93 100644
--- a/src/gnome-cmd-options-dialog.cc
+++ b/src/gnome-cmd-options-dialog.cc
@@ -407,6 +407,9 @@ static void on_colors_edit (GtkButton *btn, GtkWidget *parent)
     GtkWidget *dlg = gnome_cmd_dialog_new (_("Edit Colors..."));
     g_object_ref (dlg);
 
+    gnome_cmd_dialog_set_modal (GNOME_CMD_DIALOG (dlg));
+    gnome_cmd_dialog_set_transient_for (GNOME_CMD_DIALOG (dlg), GTK_WINDOW (parent));
+
     GtkWidget *cat, *cat_box;
     GtkWidget *table, *label;
     GtkWidget *cbutton;
@@ -539,6 +542,9 @@ static void on_ls_colors_edit (GtkButton *btn, GtkWidget *parent)
     GtkWidget *dlg = gnome_cmd_dialog_new (_("Edit LS_COLORS Palette"));
     g_object_ref (dlg);
 
+    gnome_cmd_dialog_set_modal (GNOME_CMD_DIALOG (dlg));
+    gnome_cmd_dialog_set_transient_for (GNOME_CMD_DIALOG (dlg), GTK_WINDOW (parent));
+
     GtkWidget *cat, *cat_box;
     GtkWidget *table, *label;
     GtkWidget *cbutton;
@@ -1292,6 +1298,9 @@ static GtkWidget *create_app_dialog (GnomeCmdApp *app, GtkSignalFunc on_ok, GtkS
     g_object_ref (dialog);
     g_object_set_data (G_OBJECT (dialog), "options_dialog", options_dialog);
 
+    gnome_cmd_dialog_set_modal (GNOME_CMD_DIALOG (dialog));
+    gnome_cmd_dialog_set_transient_for (GNOME_CMD_DIALOG (dialog), GTK_WINDOW (options_dialog));
+
     hbox = create_hbox (dialog, FALSE, 6);
     gnome_cmd_dialog_add_category (GNOME_CMD_DIALOG (dialog), hbox);
     vbox = create_vbox (dialog, FALSE, 6);
@@ -1694,6 +1703,9 @@ static GtkWidget *create_device_dialog (GnomeCmdConDevice *dev, GtkSignalFunc on
     gtk_window_set_title (GTK_WINDOW (dialog), "");
     g_object_set_data (G_OBJECT (dialog), "options_dialog", options_dialog);
 
+    gnome_cmd_dialog_set_modal (GNOME_CMD_DIALOG (dialog));
+    gnome_cmd_dialog_set_transient_for (GNOME_CMD_DIALOG (dialog), GTK_WINDOW (options_dialog));
+
     table = create_table (dialog, 4, 2);
     gnome_cmd_dialog_add_category (GNOME_CMD_DIALOG (dialog), table);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]