changeset 2192:e5401b6c4665

the same thing in many plugins
author Eugene Zagidullin <e.asphyx@gmail.com>
date Wed, 28 Nov 2007 03:51:34 +0300
parents 329267b09658
children 80d7ab8f2ec5
files src/CoreAudio/configure.c src/alsa/configure.c src/amidi-plug/i_configure.c src/cdaudio-ng/cdaudio-ng.c src/cdaudio-ng/configure.c src/flacng/plugin.c src/jack/configure.c src/shnplug/gtk.c src/sid/xs_about.c src/sid/xs_config.c src/sid/xs_fileinfo.c src/sun/configure.c src/timidity/xmms-timidity.c src/vtx/about.c
diffstat 14 files changed, 92 insertions(+), 89 deletions(-) [+]
line wrap: on
line diff
--- a/src/CoreAudio/configure.c	Wed Nov 28 02:50:15 2007 +0300
+++ b/src/CoreAudio/configure.c	Wed Nov 28 03:51:34 2007 +0300
@@ -157,7 +157,7 @@
 	
 	if (configure_win)
 	{
-		gdk_window_raise(configure_win->window);
+                gtk_window_present(GTK_WINDOW(configure_win));
 		return;
 	}
 
--- a/src/alsa/configure.c	Wed Nov 28 02:50:15 2007 +0300
+++ b/src/alsa/configure.c	Wed Nov 28 03:51:34 2007 +0300
@@ -248,7 +248,7 @@
 
 	if (configure_win)
 	{
-		gdk_window_raise(configure_win->window);
+                gtk_window_present(GTK_WINDOW(configure_win));
 		return;
 	}
 
--- a/src/amidi-plug/i_configure.c	Wed Nov 28 02:50:15 2007 +0300
+++ b/src/amidi-plug/i_configure.c	Wed Nov 28 03:51:34 2007 +0300
@@ -234,7 +234,7 @@
     g_object_set_data( G_OBJECT(button_ok) , "bapply_pressed" , GUINT_TO_POINTER(0) );
     if ( configwin_warnmsg != NULL )
     {
-      gdk_window_raise( configwin_warnmsg->window );
+      gtk_window_present(GTK_WINDOW(configwin_warnmsg));
     }
     else
     {
--- a/src/cdaudio-ng/cdaudio-ng.c	Wed Nov 28 02:50:15 2007 +0300
+++ b/src/cdaudio-ng/cdaudio-ng.c	Wed Nov 28 03:51:34 2007 +0300
@@ -206,17 +206,17 @@
 	static GtkWidget* about_window = NULL;
 
 	if (about_window) {
-		gdk_window_raise(about_window->window);
-	}
-	about_window = audacious_info_dialog(_("About CD Audio Plugin NG"),
-	_("Copyright (c) 2007, by Calin Crisan <ccrisan@gmail.com> and The Audacious Team.\n\n"
-	"Many thanks to libcdio developers <http://www.gnu.org/software/libcdio/>\n"
-	"\tand to libcddb developers <http://libcddb.sourceforge.net/>.\n\n"
-	"Also thank you Tony Vroon for mentoring & guiding me.\n\n"
-	"This was a Google Summer of Code 2007 project."), _("OK"), FALSE, NULL, NULL);
+            gtk_window_present(GTK_WINDOW(about_window));
+	} else {
+            about_window = audacious_info_dialog(_("About CD Audio Plugin NG"),
+	    _("Copyright (c) 2007, by Calin Crisan <ccrisan@gmail.com> and The Audacious Team.\n\n"
+	    "Many thanks to libcdio developers <http://www.gnu.org/software/libcdio/>\n"
+	    "\tand to libcddb developers <http://libcddb.sourceforge.net/>.\n\n"
+	    "Also thank you Tony Vroon for mentoring & guiding me.\n\n"
+	    "This was a Google Summer of Code 2007 project."), _("OK"), FALSE, NULL, NULL);
 
-	g_signal_connect(G_OBJECT(about_window), "destroy",
-		G_CALLBACK(gtk_widget_destroyed), &about_window);
+	    g_signal_connect(G_OBJECT(about_window), "destroy",	G_CALLBACK(gtk_widget_destroyed), &about_window);
+        }
 }
 
 static void cdaudio_configure()
--- a/src/cdaudio-ng/configure.c	Wed Nov 28 02:50:15 2007 +0300
+++ b/src/cdaudio-ng/configure.c	Wed Nov 28 03:51:34 2007 +0300
@@ -244,6 +244,7 @@
 {
 	configure_values_to_gui();
 	gtk_widget_show(configwindow);
+        gtk_window_present(GTK_WINDOW(configwindow));
 }
 
 
--- a/src/flacng/plugin.c	Wed Nov 28 02:50:15 2007 +0300
+++ b/src/flacng/plugin.c	Wed Nov 28 03:51:34 2007 +0300
@@ -714,7 +714,8 @@
     gchar *about_text;
 
     if (about_window) {
-        gdk_window_raise(about_window->window);
+        gtk_window_present(GTK_WINDOW(about_window));
+        return;
     }
 
     about_text = g_strjoin("", _("FLAC Audio Plugin "), _VERSION,
--- a/src/jack/configure.c	Wed Nov 28 02:50:15 2007 +0300
+++ b/src/jack/configure.c	Wed Nov 28 03:51:34 2007 +0300
@@ -46,20 +46,20 @@
 
 static void configure_win_ok_cb(GtkWidget * w, gpointer data)
 {
-	ConfigDb *cfgfile;
+        ConfigDb *cfgfile;
 
-	jack_cfg.isTraceEnabled = (gint) GTK_CHECK_BUTTON(GTK_isTraceEnabled)->toggle_button.active;
+        jack_cfg.isTraceEnabled = (gint) GTK_CHECK_BUTTON(GTK_isTraceEnabled)->toggle_button.active;
   jack_cfg.port_connection_mode = GET_CHARS(GTK_COMBO(port_connection_mode_combo)->entry);
 
   jack_set_port_connection_mode(); /* update the connection mode */
 
-	cfgfile = aud_cfg_db_open();
+        cfgfile = aud_cfg_db_open();
 
-	aud_cfg_db_set_bool(cfgfile, "jack", "isTraceEnabled", jack_cfg.isTraceEnabled);
-	aud_cfg_db_set_string(cfgfile, "jack", "port_connection_mode", jack_cfg.port_connection_mode);
-	aud_cfg_db_close(cfgfile);
+        aud_cfg_db_set_bool(cfgfile, "jack", "isTraceEnabled", jack_cfg.isTraceEnabled);
+        aud_cfg_db_set_string(cfgfile, "jack", "port_connection_mode", jack_cfg.port_connection_mode);
+        aud_cfg_db_close(cfgfile);
 
-	gtk_widget_destroy(configure_win);
+        gtk_widget_destroy(configure_win);
 }
 
 static void get_port_connection_modes(GtkCombo *combo)
@@ -91,68 +91,68 @@
 
 void jack_configure(void)
 {
-	if (!configure_win)
-	{
-		configure_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-		gtk_window_set_type_hint ( GTK_WINDOW(configure_win), GDK_WINDOW_TYPE_HINT_DIALOG);
-		gtk_signal_connect(GTK_OBJECT(configure_win), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &configure_win);
-		gtk_window_set_title(GTK_WINDOW(configure_win), _("jack Plugin configuration"));
-		gtk_window_set_policy(GTK_WINDOW(configure_win), FALSE, FALSE, FALSE);
-		gtk_window_set_position(GTK_WINDOW(configure_win), GTK_WIN_POS_MOUSE);
-		gtk_container_border_width(GTK_CONTAINER(configure_win), 10);
+        if (!configure_win)
+        {
+                configure_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+                gtk_window_set_type_hint ( GTK_WINDOW(configure_win), GDK_WINDOW_TYPE_HINT_DIALOG);
+                gtk_signal_connect(GTK_OBJECT(configure_win), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &configure_win);
+                gtk_window_set_title(GTK_WINDOW(configure_win), _("jack Plugin configuration"));
+                gtk_window_set_policy(GTK_WINDOW(configure_win), FALSE, FALSE, FALSE);
+                gtk_window_set_position(GTK_WINDOW(configure_win), GTK_WIN_POS_MOUSE);
+                gtk_container_border_width(GTK_CONTAINER(configure_win), 10);
 
-    vbox = gtk_vbox_new(FALSE, 10);
-    gtk_container_add(GTK_CONTAINER(configure_win), vbox);
+                vbox = gtk_vbox_new(FALSE, 10);
+                gtk_container_add(GTK_CONTAINER(configure_win), vbox);
 
-    /* add a frame for other xmms-jack options */
-    option_frame = gtk_frame_new(_("Options:"));
-    gtk_box_pack_start(GTK_BOX(vbox), option_frame, FALSE, FALSE, 0);
+                /* add a frame for other xmms-jack options */
+                option_frame = gtk_frame_new(_("Options:"));
+                gtk_box_pack_start(GTK_BOX(vbox), option_frame, FALSE, FALSE, 0);
 
-    /* add a hbox that will contain a label for a dropdown and the dropdown itself */
-    port_connection_mode_box = gtk_hbox_new(FALSE, 5);
-    gtk_container_set_border_width(GTK_CONTAINER(port_connection_mode_box), 5);
-    gtk_container_add(GTK_CONTAINER(option_frame), port_connection_mode_box);
+                /* add a hbox that will contain a label for a dropdown and the dropdown itself */
+                port_connection_mode_box = gtk_hbox_new(FALSE, 5);
+                gtk_container_set_border_width(GTK_CONTAINER(port_connection_mode_box), 5);
+                gtk_container_add(GTK_CONTAINER(option_frame), port_connection_mode_box);
 
-    /* add the label */
-    gtk_box_pack_start(GTK_BOX(port_connection_mode_box), gtk_label_new(_("Connection mode:")),
-                       FALSE, FALSE, 0);
+                /* add the label */
+                gtk_box_pack_start(GTK_BOX(port_connection_mode_box), gtk_label_new(_("Connection mode:")),
+                                   FALSE, FALSE, 0);
 
-    /* add the dropdown */
-    port_connection_mode_combo = gtk_combo_new();
-    get_port_connection_modes(GTK_COMBO(port_connection_mode_combo));
-    gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(port_connection_mode_combo)->entry),
-                       jack_cfg.port_connection_mode);
-    gtk_box_pack_start(GTK_BOX(port_connection_mode_box), port_connection_mode_combo,
-                       TRUE, TRUE, 0);
+                /* add the dropdown */
+                port_connection_mode_combo = gtk_combo_new();
+                get_port_connection_modes(GTK_COMBO(port_connection_mode_combo));
+                gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(port_connection_mode_combo)->entry),
+                                   jack_cfg.port_connection_mode);
+                gtk_box_pack_start(GTK_BOX(port_connection_mode_box), port_connection_mode_combo,
+                                   TRUE, TRUE, 0);
 
-    /* create a check_button for debug output */
-    GTK_isTraceEnabled = gtk_check_button_new_with_label(_("Enable debug printing"));
-    gtk_box_pack_start(GTK_BOX(vbox), GTK_isTraceEnabled, FALSE, FALSE, 0);
-    gtk_widget_show(GTK_isTraceEnabled);
+                /* create a check_button for debug output */
+                GTK_isTraceEnabled = gtk_check_button_new_with_label(_("Enable debug printing"));
+                gtk_box_pack_start(GTK_BOX(vbox), GTK_isTraceEnabled, FALSE, FALSE, 0);
+                gtk_widget_show(GTK_isTraceEnabled);
 
-    /* set the state of the check_button based upon the value of */
-    /* isTracingEnabled */
-    GTK_CHECK_BUTTON(GTK_isTraceEnabled)->toggle_button.active = jack_cfg.isTraceEnabled;
+                /* set the state of the check_button based upon the value of */
+                /* isTracingEnabled */
+                GTK_CHECK_BUTTON(GTK_isTraceEnabled)->toggle_button.active = jack_cfg.isTraceEnabled;
 
-    /* add the box for the ok/canceled buttons at the bottom */
-    bbox = gtk_hbox_new(FALSE, 10);
-    gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
+                /* add the box for the ok/canceled buttons at the bottom */
+                bbox = gtk_hbox_new(FALSE, 10);
+                gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
 
-		ok = gtk_button_new_with_label(_("Ok"));
-		gtk_signal_connect(GTK_OBJECT(ok), "clicked", GTK_SIGNAL_FUNC(configure_win_ok_cb), NULL);
-		GTK_WIDGET_SET_FLAGS(ok, GTK_CAN_DEFAULT);
-		gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 0);
-		gtk_widget_show(ok);
-		gtk_widget_grab_default(ok);
+                ok = gtk_button_new_with_label(_("Ok"));
+                gtk_signal_connect(GTK_OBJECT(ok), "clicked", GTK_SIGNAL_FUNC(configure_win_ok_cb), NULL);
+                GTK_WIDGET_SET_FLAGS(ok, GTK_CAN_DEFAULT);
+                gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 0);
+                gtk_widget_show(ok);
+                gtk_widget_grab_default(ok);
 
-		cancel = gtk_button_new_with_label(_("Cancel"));
-		gtk_signal_connect_object(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(configure_win));
-		GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT);
-		gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
-		gtk_widget_show(cancel);
+                cancel = gtk_button_new_with_label(_("Cancel"));
+                gtk_signal_connect_object(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(configure_win));
+                GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT);
+                gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
+                gtk_widget_show(cancel);
 
-		gtk_widget_show_all(configure_win);
-	}
-	else
-		gdk_window_raise(configure_win->window);
+                gtk_widget_show_all(configure_win);
+        }
+        else
+                gtk_window_present(GTK_WINDOW(configure_win));
 }
--- a/src/shnplug/gtk.c	Wed Nov 28 02:50:15 2007 +0300
+++ b/src/shnplug/gtk.c	Wed Nov 28 03:51:34 2007 +0300
@@ -78,7 +78,7 @@
 {
 	if (about_box != NULL)
 	{
-		gdk_window_raise(about_box->window);
+                gtk_window_present(GTK_WINDOW(about_box));
 		return;
 	}
 
@@ -153,7 +153,7 @@
 {
 	if (shn_configurewin != NULL)
 	{
-		gdk_window_raise(shn_configurewin->window);
+                gtk_window_present(GTK_WINDOW(shn_configurewin));
 		return;
 	}
 
--- a/src/sid/xs_about.c	Wed Nov 28 02:50:15 2007 +0300
+++ b/src/sid/xs_about.c	Wed Nov 28 03:51:34 2007 +0300
@@ -72,7 +72,7 @@
 
 	/* Check if there already is an open about window */
 	if (xs_aboutwin != NULL) {
-		gdk_window_raise(xs_aboutwin->window);
+                gtk_window_present(GTK_WINDOW(xs_aboutwin));
 		return;
 	}
 
--- a/src/sid/xs_config.c	Wed Nov 28 02:50:15 2007 +0300
+++ b/src/sid/xs_config.c	Wed Nov 28 03:51:34 2007 +0300
@@ -775,7 +775,7 @@
 	(void) user_data;
 
 	if (xs_sldb_fileselector != NULL) {
-		gdk_window_raise(xs_sldb_fileselector->window);
+                gtk_window_present(GTK_WINDOW(xs_sldb_fileselector));
 		return;
 	}
 
@@ -813,7 +813,7 @@
 	(void) user_data;
 
 	if (xs_stil_fileselector != NULL) {
-		gdk_window_raise(xs_stil_fileselector->window);
+                gtk_window_present(GTK_WINDOW(xs_stil_fileselector));
 		return;
 	}
 
@@ -852,7 +852,7 @@
 	(void) user_data;
 
 	if (xs_hvsc_selector != NULL) {
-		gdk_window_raise(xs_hvsc_selector->window);
+                gtk_window_present(GTK_WINDOW(xs_hvsc_selector));
 		return;
 	}
 
@@ -1011,7 +1011,7 @@
 	(void) user_data;
 
 	if (xs_filt_importselector != NULL) {
-		gdk_window_raise(xs_filt_importselector->window);
+                gtk_window_present(GTK_WINDOW(xs_filt_importselector));
 		return;
 	}
 
@@ -1050,7 +1050,7 @@
 	(void) user_data;
 
 	if (xs_filt_exportselector != NULL) {
-		gdk_window_raise(xs_filt_exportselector->window);
+                gtk_window_present(GTK_WINDOW(xs_filt_exportselector));
 		return;
 	}
 
@@ -1260,7 +1260,7 @@
 
 	/* Check if the window already exists */
 	if (xs_configwin) {
-		gdk_window_raise(xs_configwin->window);
+                gtk_window_present(GTK_WINDOW(xs_configwin));
 		return;
 	}
 
--- a/src/sid/xs_fileinfo.c	Wed Nov 28 02:50:15 2007 +0300
+++ b/src/sid/xs_fileinfo.c	Wed Nov 28 03:51:34 2007 +0300
@@ -202,7 +202,7 @@
 
 	/* Check if there already is an open fileinfo window */
 	if (xs_fileinfowin)
-		gdk_window_raise(xs_fileinfowin->window);
+                gtk_window_present(GTK_WINDOW(xs_fileinfowin));
 	else {
 		xs_fileinfowin = create_xs_fileinfowin();
 #ifndef AUDACIOUS_PLUGIN
--- a/src/sun/configure.c	Wed Nov 28 02:50:15 2007 +0300
+++ b/src/sun/configure.c	Wed Nov 28 03:51:34 2007 +0300
@@ -527,7 +527,7 @@
 
 	if (configure_win)
 	{
-		gdk_window_raise(configure_win->window);
+                gtk_window_present(GTK_WINDOW(configure_win));
 		return;
 	}
 	configure_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
--- a/src/timidity/xmms-timidity.c	Wed Nov 28 02:50:15 2007 +0300
+++ b/src/timidity/xmms-timidity.c	Wed Nov 28 03:51:34 2007 +0300
@@ -122,7 +122,7 @@
 	}
 	else
 	{
-		gdk_window_raise(xmmstimid_about_wnd->window);
+                gtk_window_present(GTK_WINDOW(xmmstimid_about_wnd));
 	}
 }
 
@@ -182,7 +182,7 @@
 	if (tb != NULL) gtk_toggle_button_set_active(tb, TRUE);
 
 	gtk_widget_show(xmmstimid_conf_wnd);
-	gdk_window_raise(xmmstimid_conf_wnd->window);
+        gtk_window_present(GTK_WINDOW(xmmstimid_conf_wnd));
 }
 
 void xmmstimid_conf_ok(GtkButton *button, gpointer user_data) {
--- a/src/vtx/about.c	Wed Nov 28 02:50:15 2007 +0300
+++ b/src/vtx/about.c	Wed Nov 28 03:51:34 2007 +0300
@@ -17,8 +17,9 @@
 vtx_about (void)
 {
   static GtkWidget *box;
-  if (box) gdk_window_raise(box->window);
-  else {
+  if (box) {
+      gtk_window_present(GTK_WINDOW(box));
+  } else {
 	box = audacious_info_dialog (_("About Vortex Player"),
 				_
 				("Vortex file format player by Sashnov Alexander <sashnov@ngs.ru>\n"