aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/menus
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2002-06-05 01:16:57 +0800
committerChris Lahey <clahey@src.gnome.org>2002-06-05 01:16:57 +0800
commitc1dadee81ade19d8524cd5d8466f76ffd4f5f289 (patch)
tree0897a3c8d7b9035d720f170534841ad22b7a77b8 /widgets/menus
parentb7f26419b3178309b0d5ad957f1be4727c7f362c (diff)
downloadgsoc2013-evolution-c1dadee81ade19d8524cd5d8466f76ffd4f5f289.tar.gz
gsoc2013-evolution-c1dadee81ade19d8524cd5d8466f76ffd4f5f289.tar.zst
gsoc2013-evolution-c1dadee81ade19d8524cd5d8466f76ffd4f5f289.zip
Don't show this dialog more than once per collection.
2002-06-04 Christopher James Lahey <clahey@ximian.com> * menus/gal-view-menus.c (define_views): Don't show this dialog more than once per collection. svn path=/trunk/; revision=17106
Diffstat (limited to 'widgets/menus')
-rw-r--r--widgets/menus/gal-view-menus.c41
1 files changed, 32 insertions, 9 deletions
diff --git a/widgets/menus/gal-view-menus.c b/widgets/menus/gal-view-menus.c
index 6c796dd6ee..6e703c0cce 100644
--- a/widgets/menus/gal-view-menus.c
+++ b/widgets/menus/gal-view-menus.c
@@ -31,6 +31,7 @@ struct _GalViewMenusPrivate {
int instance_changed_id;
BonoboUIComponent *component;
EList *listenerClosures;
+ GtkWidget *define_views_dialog;
};
typedef struct {
@@ -132,6 +133,13 @@ add_instance (GalViewMenus *gvm,
}
static void
+clear_define_views_dialog (gpointer data)
+{
+ GalViewMenus *gvm = GAL_VIEW_MENUS (data);
+ gvm->priv->define_views_dialog = NULL;
+}
+
+static void
gvm_destroy (GtkObject *object)
{
GalViewMenus *gvm = GAL_VIEW_MENUS (object);
@@ -140,6 +148,11 @@ gvm_destroy (GtkObject *object)
gal_view_menus_unmerge (gvm, NULL);
+ if (gvm->priv->define_views_dialog) {
+ gtk_object_weakunref (GTK_OBJECT (gvm->priv->define_views_dialog),
+ clear_define_views_dialog,
+ gvm);
+ }
g_free(gvm->priv);
gvm->priv = NULL;
@@ -157,12 +170,13 @@ gvm_class_init (GtkObjectClass *klass)
static void
gvm_init (GalViewMenus *gvm)
{
- gvm->priv = g_new(GalViewMenusPrivate, 1);
- gvm->priv->instance = NULL;
+ gvm->priv = g_new(GalViewMenusPrivate, 1);
+ gvm->priv->instance = NULL;
gvm->priv->collection_changed_id = 0;
- gvm->priv->instance_changed_id = 0;
- gvm->priv->component = NULL;
- gvm->priv->listenerClosures = NULL;
+ gvm->priv->instance_changed_id = 0;
+ gvm->priv->component = NULL;
+ gvm->priv->listenerClosures = NULL;
+ gvm->priv->define_views_dialog = NULL;
}
E_MAKE_TYPE(gal_view_menus, "GalViewMenus", GalViewMenus, gvm_class_init, gvm_init, PARENT_TYPE);
@@ -209,10 +223,19 @@ define_views(BonoboUIComponent *component,
GalViewMenus *menus,
char *cname)
{
- GtkWidget *dialog = gal_define_views_dialog_new(menus->priv->instance->collection);
- gtk_signal_connect(GTK_OBJECT(dialog), "clicked",
- GTK_SIGNAL_FUNC(dialog_clicked), menus);
- gtk_widget_show(dialog);
+ if (menus->priv->define_views_dialog) {
+ gdk_window_raise (menus->priv->define_views_dialog->window);
+ } else {
+ GtkWidget *dialog = gal_define_views_dialog_new(menus->priv->instance->collection);
+
+ gtk_signal_connect(GTK_OBJECT(dialog), "clicked",
+ GTK_SIGNAL_FUNC(dialog_clicked), menus);
+ menus->priv->define_views_dialog = dialog;
+ gtk_object_weakref (GTK_OBJECT (dialog),
+ clear_define_views_dialog,
+ menus);
+ gtk_widget_show(dialog);
+ }
}
static void