summaryrefslogtreecommitdiffhomepage
path: root/mixgtk/mixgtk_widgets.c
diff options
context:
space:
mode:
Diffstat (limited to 'mixgtk/mixgtk_widgets.c')
-rw-r--r--mixgtk/mixgtk_widgets.c43
1 files changed, 31 insertions, 12 deletions
diff --git a/mixgtk/mixgtk_widgets.c b/mixgtk/mixgtk_widgets.c
index 243c6b3..95fd6f0 100644
--- a/mixgtk/mixgtk_widgets.c
+++ b/mixgtk/mixgtk_widgets.c
@@ -46,6 +46,7 @@ static const gchar * dnames_[] = {
};
const gchar *SPLIT_MAIN_NAME_ = "split_main_window";
+const gchar *MAIN_NAME_ = "main_window";
#define DLG_NO_ (sizeof (dnames_) / sizeof(dnames_[0]))
@@ -134,20 +135,38 @@ mixgtk_widget_factory_init (gboolean split)
const gchar *glade_file = GLADE_FILE;
const gchar *local_glade_file = LOCAL_GLADE_FILE;
FILE *f;
+
+ about_ = NULL;
+
+ if (!file_)
+ {
+ glade_init ();
+ f = fopen (glade_file, "r");
+ if (!f) {
+ f = fopen (local_glade_file, "r");
+ if (!f) return FALSE;
+ glade_file = local_glade_file;
+ }
+ fclose (f);
+ file_ = g_strdup (glade_file);
+ }
+ else
+ {
+ gint k;
+ for (k = 0; k < DLG_NO_; ++k)
+ {
+ if (xml_[k])
+ {
+ if (k != MIXGTK_MAIN)
+ gtk_widget_destroy (mixgtk_widget_factory_get_dialog (k));
+ xml_[k] = NULL;
+ }
+ }
+ }
- glade_init ();
split_ = split;
-
- f = fopen (glade_file, "r");
- if (!f) {
- f = fopen (local_glade_file, "r");
- if (!f) return FALSE;
- glade_file = local_glade_file;
- }
- fclose (f);
- file_ = g_strdup (glade_file);
-
- if (split_) dnames_[MIXGTK_MAIN] = SPLIT_MAIN_NAME_;
+
+ dnames_[MIXGTK_MAIN] = split_? SPLIT_MAIN_NAME_ : MAIN_NAME_;
init_xml_ (MIXGTK_MAIN);
init_autosave_ ();