aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/menus
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/menus')
-rw-r--r--widgets/menus/gal-define-views-dialog.c19
-rw-r--r--widgets/menus/gal-define-views.glade2
-rw-r--r--widgets/menus/gal-view-collection.c22
-rw-r--r--widgets/menus/gal-view-collection.h6
4 files changed, 45 insertions, 4 deletions
diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c
index 8d8c903de8..750d3c35c6 100644
--- a/widgets/menus/gal-define-views-dialog.c
+++ b/widgets/menus/gal-define-views-dialog.c
@@ -224,7 +224,7 @@ gal_define_views_dialog_init (GalDefineViewsDialog *dialog)
dialog->collection = NULL;
- gui = glade_xml_new_with_domain (GAL_GLADEDIR "/gal-define-views.glade", NULL, PACKAGE);
+ gui = glade_xml_new_with_domain (GAL_GLADEDIR "/gal-define-views.glade", NULL, E_I18N_DOMAIN);
dialog->gui = gui;
widget = glade_xml_get_widget(gui, "table-top");
@@ -254,7 +254,7 @@ gal_define_views_dialog_init (GalDefineViewsDialog *dialog)
"collection", dialog->collection,
NULL);
}
-
+
gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, TRUE, FALSE);
}
@@ -279,6 +279,21 @@ gal_define_views_dialog_set_collection(GalDefineViewsDialog *dialog,
"collection", collection,
NULL);
}
+ if (dialog->gui) {
+ GtkWidget *widget = glade_xml_get_widget(dialog->gui, "label-views");
+ if (widget && GTK_IS_LABEL (widget)) {
+ if (collection->title) {
+ char *text = g_strdup_printf (_("Define Views for %s"),
+ collection->title);
+ gtk_label_set_text (GTK_LABEL (widget),
+ text);
+ g_free (text);
+ } else {
+ gtk_label_set_text (GTK_LABEL (widget),
+ _("Define Views"));
+ }
+ }
+ }
}
/**
diff --git a/widgets/menus/gal-define-views.glade b/widgets/menus/gal-define-views.glade
index b393d97d2e..72eac5764b 100644
--- a/widgets/menus/gal-define-views.glade
+++ b/widgets/menus/gal-define-views.glade
@@ -282,7 +282,7 @@
<widget>
<class>GtkLabel</class>
<name>label-views</name>
- <label>Views for &quot;%s&quot;</label>
+ <label>Define Views for %s</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
<xalign>0</xalign>
diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c
index 290c28f688..675c926bc1 100644
--- a/widgets/menus/gal-view-collection.c
+++ b/widgets/menus/gal-view-collection.c
@@ -159,17 +159,29 @@ gal_view_collection_destroy (GtkObject *object)
gal_view_collection_item_free (collection->view_data[i]);
}
g_free(collection->view_data);
+ collection->view_count = 0;
+ collection->view_data = NULL;
+
e_free_object_list(collection->factory_list);
+ collection->factory_list = NULL;
for (i = 0; i < collection->removed_view_count; i++) {
gal_view_collection_item_free (collection->removed_view_data[i]);
}
g_free(collection->removed_view_data);
+ collection->removed_view_count = 0;
+ collection->removed_view_data = NULL;
g_free(collection->system_dir);
g_free(collection->local_dir);
+ collection->system_dir = NULL;
+ collection->local_dir = NULL;
g_free (collection->default_view);
+ collection->default_view = NULL;
+
+ g_free (collection->title);
+ collection->title = NULL;
if (gal_view_collection_parent_class->destroy)
(*gal_view_collection_parent_class->destroy)(object);
@@ -221,6 +233,8 @@ gal_view_collection_init (GalViewCollection *collection)
collection->loaded = FALSE;
collection->default_view = NULL;
collection->default_view_built_in = TRUE;
+
+ collection->title = NULL;
}
/**
@@ -263,6 +277,14 @@ gal_view_collection_new (void)
return gtk_type_new(gal_view_collection_get_type());
}
+void
+gal_view_collection_set_title (GalViewCollection *collection,
+ const char *title)
+{
+ g_free (collection->title);
+ collection->title = g_strdup (title);
+}
+
/**
* gal_view_collection_set_storage_directories
* @collection: The view collection to initialize
diff --git a/widgets/menus/gal-view-collection.h b/widgets/menus/gal-view-collection.h
index 89501cda4c..68e7cae4b7 100644
--- a/widgets/menus/gal-view-collection.h
+++ b/widgets/menus/gal-view-collection.h
@@ -57,6 +57,8 @@ typedef struct {
char *local_dir;
char *default_view;
+
+ char *title;
} GalViewCollection;
typedef struct {
@@ -87,7 +89,9 @@ struct GalViewCollectionItem {
GtkType gal_view_collection_get_type (void);
GalViewCollection *gal_view_collection_new (void);
-/* Set up the view collection. Call these three functions before ever doing load or save and never call them again. */
+void gal_view_collection_set_title (GalViewCollection *collection,
+ const char *title);
+/* Set up the view collection. Call these two functions before ever doing load or save and never call them again. */
void gal_view_collection_set_storage_directories (GalViewCollection *collection,
const char *system_dir,
const char *local_dir);