diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-12-19 06:16:40 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-12-19 06:16:40 +0800 |
commit | 323baedeb83c11c4640b77f4ce96b192eeb3c3f7 (patch) | |
tree | 44c5cb9015643461bb9468cb45a0ca58f5cb48ab /src/window-commands.c | |
parent | fb964a82fd2244d91b6303853d3a49ec338b94cc (diff) | |
download | gsoc2013-epiphany-323baedeb83c11c4640b77f4ce96b192eeb3c3f7.tar gsoc2013-epiphany-323baedeb83c11c4640b77f4ce96b192eeb3c3f7.tar.gz gsoc2013-epiphany-323baedeb83c11c4640b77f4ce96b192eeb3c3f7.tar.bz2 gsoc2013-epiphany-323baedeb83c11c4640b77f4ce96b192eeb3c3f7.tar.lz gsoc2013-epiphany-323baedeb83c11c4640b77f4ce96b192eeb3c3f7.tar.xz gsoc2013-epiphany-323baedeb83c11c4640b77f4ce96b192eeb3c3f7.tar.zst gsoc2013-epiphany-323baedeb83c11c4640b77f4ce96b192eeb3c3f7.zip |
Don't show multiple toolbar editors for the same window. Part of bug
2004-12-18 Christian Persch <chpe@cvs.gnome.org>
* src/window-commands.c: (toolbar_editor_destroy_cb),
(window_cmd_edit_toolbar):
Don't show multiple toolbar editors for the same window.
Part of bug #111114.
Diffstat (limited to 'src/window-commands.c')
-rw-r--r-- | src/window-commands.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/window-commands.c b/src/window-commands.c index 171e16263..83665c9ec 100644 --- a/src/window-commands.c +++ b/src/window-commands.c @@ -59,6 +59,7 @@ #include <gtk/gtktoggleaction.h> #include <glib/gi18n.h> +#define TOOLBAR_EDITOR_KEY "EphyToolbarEditor" enum { RESPONSE_ADD_TOOLBAR @@ -794,6 +795,8 @@ toolbar_editor_destroy_cb (GtkWidget *tbe, (ephy_window_get_toolbar (window)), FALSE); egg_editable_toolbar_set_edit_mode (EGG_EDITABLE_TOOLBAR (ephy_window_get_bookmarksbar (window)), FALSE); + + g_object_set_data (G_OBJECT (window), TOOLBAR_EDITOR_KEY, NULL); } static void @@ -819,14 +822,19 @@ void window_cmd_edit_toolbar (GtkAction *action, EphyWindow *window) { - GtkWidget *editor; + GtkWidget *editor, *dialog, *toolbar; EggToolbarsModel *model; - GtkWidget *t; - GtkWidget *dialog; + + dialog = GTK_WIDGET (g_object_get_data (G_OBJECT (window), TOOLBAR_EDITOR_KEY)); + if (dialog != NULL) + { + gtk_window_present (GTK_WINDOW (dialog)); + return; + } model = EGG_TOOLBARS_MODEL (ephy_shell_get_toolbars_model (ephy_shell, FALSE)); - t = ephy_window_get_toolbar (window); + toolbar = ephy_window_get_toolbar (window); dialog = gtk_dialog_new (); gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); @@ -863,9 +871,11 @@ window_cmd_edit_toolbar (GtkAction *action, EPHY_STATE_WINDOW_SAVE_SIZE); gtk_widget_show (dialog); - egg_editable_toolbar_set_edit_mode (EGG_EDITABLE_TOOLBAR (t), TRUE); + egg_editable_toolbar_set_edit_mode (EGG_EDITABLE_TOOLBAR (toolbar), TRUE); egg_editable_toolbar_set_edit_mode (EGG_EDITABLE_TOOLBAR (ephy_window_get_bookmarksbar (window)), TRUE); + + g_object_set_data (G_OBJECT (window), TOOLBAR_EDITOR_KEY, dialog); } void |