[gnome-control-center] region: Shared non-modal layout preview dialog
- From: Sergey V. Udaltsov <svu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] region: Shared non-modal layout preview dialog
- Date: Fri, 25 Feb 2011 00:53:40 +0000 (UTC)
commit 8760016db24446d0922d1e5ee14425e357973a6a
Author: Sergey V. Udaltsov <svu gnome org>
Date: Fri Feb 25 00:50:28 2011 +0000
region: Shared non-modal layout preview dialog
https://bugzilla.gnome.org/show_bug.cgi?id=642903
panels/region/gnome-region-panel-xkbltadd.c | 40 ++++++++++++++++++---------
1 files changed, 27 insertions(+), 13 deletions(-)
---
diff --git a/panels/region/gnome-region-panel-xkbltadd.c b/panels/region/gnome-region-panel-xkbltadd.c
index f40554b..ffbaf3a 100644
--- a/panels/region/gnome-region-panel-xkbltadd.c
+++ b/panels/region/gnome-region-panel-xkbltadd.c
@@ -40,6 +40,8 @@ enum {
static gchar **search_pattern_list = NULL;
+static GtkWidget *preview_dialog = NULL;
+
#define RESPONSE_PREVIEW 1
static void
@@ -58,6 +60,12 @@ xkl_layout_chooser_add_default_switcher_if_necessary (gchar **
}
static void
+xkb_preview_destroy_callback (GtkWidget * widget)
+{
+ preview_dialog = NULL;
+}
+
+static void
xkb_layout_chooser_response (GtkDialog * dialog,
gint response, GtkBuilder * chooser_dialog)
{
@@ -91,25 +99,31 @@ xkb_layout_chooser_response (GtkDialog * dialog,
(chooser_dialog);
if (selected_id != NULL) {
- GtkWidget *dlg =
- gkbd_keyboard_drawing_dialog_new
- ();
+ if (preview_dialog == NULL) {
+ preview_dialog =
+ gkbd_keyboard_drawing_dialog_new
+ ();
+ g_signal_connect (G_OBJECT
+ (preview_dialog),
+ "destroy",
+ G_CALLBACK
+ (xkb_preview_destroy_callback),
+ NULL);
+ };
gkbd_keyboard_drawing_dialog_set_layout
- (dlg, config_registry,
- selected_id);
- gtk_window_set_transient_for
- (GTK_WINDOW (dlg),
- GTK_WINDOW (CWID
- ("xkb_layout_chooser")));
- gtk_window_set_modal (GTK_WINDOW
- (dlg), TRUE);
-
- gtk_widget_show_all (dlg);
+ (preview_dialog,
+ config_registry, selected_id);
+
+ gtk_widget_show_all
+ (preview_dialog);
}
}
return;
}
+ if (preview_dialog != NULL) {
+ gtk_widget_destroy (preview_dialog);
+ }
if (search_pattern_list != NULL) {
g_strfreev (search_pattern_list);
search_pattern_list = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]