changeset 2458:853c7686e922

initialize configuration GUI only if needed
author mf0102 <0102@gmx.at>
date Tue, 25 Mar 2008 17:28:14 +0100
parents bb55de702ffb
children a336fe28b63a
files src/cdaudio-ng/cdaudio-ng.c src/cdaudio-ng/configure.c
diffstat 2 files changed, 26 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/cdaudio-ng/cdaudio-ng.c	Mon Mar 24 17:40:33 2008 +0100
+++ b/src/cdaudio-ng/cdaudio-ng.c	Tue Mar 25 17:28:14 2008 +0100
@@ -200,8 +200,6 @@
 		cdng_cfg.use_dae, cdng_cfg.limitspeed, cdng_cfg.use_cdtext, cdng_cfg.use_cddb,
 		cdng_cfg.cddb_server, cdng_cfg.cddb_port, cdng_cfg.cddb_http, cdng_cfg.device, cdng_cfg.debug);
 
-	configure_create_gui();
-
 	menu_item_text = _("Add CD");
 	main_menu_item = gtk_image_menu_item_new_with_label(menu_item_text);
 	gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(main_menu_item), gtk_image_new_from_stock(GTK_STOCK_CDROM, GTK_ICON_SIZE_MENU));
--- a/src/cdaudio-ng/configure.c	Mon Mar 24 17:40:33 2008 +0100
+++ b/src/cdaudio-ng/configure.c	Tue Mar 25 17:28:14 2008 +0100
@@ -9,29 +9,29 @@
 
 extern cdng_cfg_t cdng_cfg;
 
-static GtkWidget *configwindow,
-		*okbutton,
-		*cancelbutton,
-		*maintable,
-		*daeframe,
-		*titleinfoframe,
-		*miscframe,
-		*daetable,
-		*titleinfotable,
-		*misctable,
-		*limitcheckbutton,
-		*usecdtextcheckbutton,
-		*usecddbcheckbutton,
-		*cddbserverlabel,
-		*cddbportlabel,
-		*cddbserverentry,
-		*cddbportentry,
-		*cddbhttpcheckbutton,
-		*usedevicecheckbutton,
-		*buttonbox,
-		*limitspinbutton,
-		*deviceentry,
-		*debugcheckbutton;
+static GtkWidget *configwindow = NULL,
+                 *okbutton = NULL,
+                 *cancelbutton = NULL,
+                 *maintable = NULL,
+                 *daeframe = NULL,
+                 *titleinfoframe = NULL,
+                 *miscframe = NULL,
+                 *daetable = NULL,
+                 *titleinfotable = NULL,
+                 *misctable = NULL,
+                 *limitcheckbutton = NULL,
+                 *usecdtextcheckbutton = NULL,
+                 *usecddbcheckbutton = NULL,
+                 *cddbserverlabel = NULL,
+                 *cddbportlabel = NULL,
+                 *cddbserverentry = NULL,
+                 *cddbportentry = NULL,
+                 *cddbhttpcheckbutton = NULL,
+                 *usedevicecheckbutton = NULL,
+                 *buttonbox = NULL,
+                 *limitspinbutton = NULL,
+                 *deviceentry = NULL,
+                 *debugcheckbutton = NULL;
 
 
 static void configure_values_to_gui(void)
@@ -265,6 +265,9 @@
 
 void configure_show_gui(void)
 {
+    if (configwindow == NULL)
+        configure_create_gui();
+
 	configure_values_to_gui();
 	gtk_widget_show(configwindow);
 	gtk_window_present(GTK_WINDOW(configwindow));