changeset 336:51b8f124936e trunk

[svn] And that concludes the story of the whacky OK button. Thank you.
author chainsaw
date Sun, 25 Dec 2005 14:19:40 -0800
parents e089ce1ba088
children dcf5995824bf
files Plugins/Output/crossfade/configure.c
diffstat 1 files changed, 32 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Output/crossfade/configure.c	Sun Dec 25 14:10:13 2005 -0800
+++ b/Plugins/Output/crossfade/configure.c	Sun Dec 25 14:19:40 2005 -0800
@@ -43,6 +43,8 @@
 #include <unistd.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
+#include <libaudacious/util.h>
+#include <glib/gi18n.h>
 
 #ifdef HAVE_LIBSAMPLERATE
 #  include <samplerate.h>
@@ -103,7 +105,6 @@
 
 
 static GtkWidget *config_win = NULL;
-static GtkWidget *about_win = NULL;
 static GtkWidget *set_wgt;
 static GtkWidget *get_wgt;
 
@@ -1822,45 +1823,36 @@
 
 void xfade_about()
 {
-  if(!about_win) {
-    gchar *about_text = 
-      "Audacious crossfading plugin\n"
-      "Code adapted for Audacious usage by Tony Vroon <chainsaw@gentoo.org> from:\n"
-      "XMMS Crossfade Plugin "VERSION"\n"
-      "Copyright (C) 2000-2004  Peter Eisenlohr <peter@eisenlohr.org>\n"
-      "\n"
-      "based on the original OSS Output Plugin  Copyright (C) 1998-2000\n"
-      "Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies\n"
-      "\n"
-      "This program is free software; you can redistribute it and/or modify\n"
-      "it under the terms of the GNU General Public License as published by\n"
-      "the Free Software Foundation; either version 2 of the License, or\n"
-      "(at your option) any later version.\n"
-      "\n"
-      "This program is distributed in the hope that it will be useful,\n"
-      "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-      "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
-      "GNU General Public License for more details.\n"
-      "\n"
-      "You should have received a copy of the GNU General Public License\n"
-      "along with this program; if not, write to the Free Software\n"
-      "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,\n"
-      "USA.";
+    static GtkWidget *dialog;
+
+    if (dialog != NULL)
+        return;
 
-    about_win = create_about_win();
+    dialog = xmms_show_message(
+             _("About crossfade"),
+             _("Audacious crossfading plugin\n"
+             "Code adapted for Audacious usage by Tony Vroon <chainsaw@gentoo.org> from:\n"
+             "XMMS Crossfade Plugin "VERSION"\n"
+             "Copyright (C) 2000-2004  Peter Eisenlohr <peter@eisenlohr.org>\n"
+             "\n"
+             "based on the original OSS Output Plugin  Copyright (C) 1998-2000\n"
+             "Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies\n"
+             "\n"
+             "This program is free software; you can redistribute it and/or modify\n"
+             "it under the terms of the GNU General Public License as published by\n"
+             "the Free Software Foundation; either version 2 of the License, or\n"
+             "(at your option) any later version.\n"
+             "\n"
+             "This program is distributed in the hope that it will be useful,\n"
+             "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+             "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
+             "GNU General Public License for more details.\n"
+             "\n"
+             "You should have received a copy of the GNU General Public License\n"
+             "along with this program; if not, write to the Free Software\n"
+             "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,\n"
+             "USA."),_("OK"), FALSE, NULL, NULL);
 
-    /* update about_win when window is destroyed */
-    gtk_signal_connect(GTK_OBJECT(about_win), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &about_win);
-    
-    /* set about box text (this is done here and not in interface.c because
-       of the VERSION #define -- there is no way to do this with GLADE */
-    if((set_wgt = lookup_widget(about_win, "about_label")))
-      gtk_label_set_text(GTK_LABEL(set_wgt), about_text);
-    
-    /* show near mouse pointer */
-    gtk_window_set_position(GTK_WINDOW(about_win), GTK_WIN_POS_MOUSE);
-    gtk_widget_show(about_win);
-  }
-  else
-    gdk_window_raise(about_win->window);
+    gtk_signal_connect(GTK_OBJECT(dialog), "destroy",
+              GTK_SIGNAL_FUNC(gtk_widget_destroyed), &dialog);
 }