changeset 3136:a9593b76cf19

crossfade: change about dialog to use audacious_info_dialog()
author Michal Lipski <tallica@o2.pl>
date Thu, 07 May 2009 15:31:32 +0200
parents 85b7dcee821f
children 8c884237cecd
files src/crossfade/configure.c src/crossfade/crossfade.c src/crossfade/crossfade.h src/crossfade/interface-2.0.c
diffstat 4 files changed, 33 insertions(+), 94 deletions(-) [+]
line wrap: on
line diff
--- a/src/crossfade/configure.c	Thu May 07 14:11:51 2009 +0200
+++ b/src/crossfade/configure.c	Thu May 07 15:31:32 2009 +0200
@@ -21,10 +21,6 @@
  *  USA.
  */
 
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
-
 #include "crossfade.h"
 #include "configure.h"
 #include "cfgutil.h"
@@ -97,7 +93,6 @@
 
 
 static GtkWidget *config_win = NULL;
-static GtkWidget *about_win = NULL;
 static GtkWidget *set_wgt;
 static GtkWidget *get_wgt;
 
@@ -1148,46 +1143,37 @@
 void
 xfade_about()
 {
-	if (!about_win)
-	{
-		gchar *about_text =
-			"Audacious Crossfade Plugin\n"
-			"Copyright © 2009 William Pitcock <nenolod@atheme.org>\n"
-			"\n"
-			"...based in part on XMMS-Crossfade:\n"
-			"Copyright © 2000-2009 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();
-
-		/* update about_win when window is destroyed */
-		gtk_signal_connect(GTK_OBJECT(about_win), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &about_win);
+    dialog = audacious_info_dialog(
+        _("About Crossfade Plugin"),
+        _("Audacious Crossfade Plugin\n\n"
+          "Copyright © 2009 William Pitcock <nenolod@atheme.org>\n"
+          "\n"
+          "...based in part on XMMS-Crossfade:\n"
+          "Copyright © 2000-2009 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);
 
-		/* 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);
+    g_signal_connect(G_OBJECT(dialog), "destroy",
+                     G_CALLBACK(gtk_widget_destroyed), &dialog);
 }
--- a/src/crossfade/crossfade.c	Thu May 07 14:11:51 2009 +0200
+++ b/src/crossfade/crossfade.c	Thu May 07 15:31:32 2009 +0200
@@ -153,9 +153,6 @@
 static gboolean stopped;	/* TRUE: stop buffer thread ASAP */
 static gboolean eop;		/* TRUE: wait until buffer is empty then sync() */
 
-#ifdef HAVE_OSS			/* avoid 'defined but not used' compiler warning */
-static plugin_config_t default_op_config = DEFAULT_OP_CONFIG;
-#endif
 static plugin_config_t the_op_config = DEFAULT_OP_CONFIG;
        OutputPlugin          *the_op = NULL;
        gint                 the_rate = 44100;
--- a/src/crossfade/crossfade.h	Thu May 07 14:11:51 2009 +0200
+++ b/src/crossfade/crossfade.h	Thu May 07 15:31:32 2009 +0200
@@ -24,9 +24,7 @@
 #ifndef _CROSSFADE_H_
 #define _CROSSFADE_H_
 
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
+#include "config.h"
 
 #if !defined(HAVE_GLIB_THREADS)
 #  include <pthread.h>
@@ -38,6 +36,7 @@
 #include <audacious/auddrct.h>
 #include <audacious/configdb.h>
 #include <audacious/util.h>
+#include <audacious/i18n.h>
 
 #include "debug.h"
 
--- a/src/crossfade/interface-2.0.c	Thu May 07 14:11:51 2009 +0200
+++ b/src/crossfade/interface-2.0.c	Thu May 07 15:31:32 2009 +0200
@@ -1905,49 +1905,6 @@
 }
 
 GtkWidget*
-create_about_win (void)
-{
-  GtkWidget *about_win;
-  GtkWidget *about_vbox;
-  GtkWidget *about_label;
-  GtkWidget *about_actionarea;
-  GtkWidget *about_ok;
-
-  about_win = gtk_dialog_new ();
-  gtk_window_set_title (GTK_WINDOW (about_win), "About XMMS Crossfade Plugin");
-  gtk_window_set_type_hint (GTK_WINDOW (about_win), GDK_WINDOW_TYPE_HINT_DIALOG);
-
-  about_vbox = GTK_DIALOG (about_win)->vbox;
-  gtk_widget_show (about_vbox);
-
-  about_label = gtk_label_new ("dummy");
-  gtk_widget_show (about_label);
-  gtk_box_pack_start (GTK_BOX (about_vbox), about_label, FALSE, FALSE, 0);
-  gtk_label_set_justify (GTK_LABEL (about_label), GTK_JUSTIFY_CENTER);
-
-  about_actionarea = GTK_DIALOG (about_win)->action_area;
-  gtk_widget_show (about_actionarea);
-  gtk_button_box_set_layout (GTK_BUTTON_BOX (about_actionarea), GTK_BUTTONBOX_END);
-
-  about_ok = gtk_button_new_with_mnemonic ("OK");
-  gtk_widget_show (about_ok);
-  gtk_dialog_add_action_widget (GTK_DIALOG (about_win), about_ok, 0);
-
-  g_signal_connect_swapped ((gpointer) about_ok, "clicked",
-                            G_CALLBACK (gtk_widget_destroy),
-                            GTK_OBJECT (about_win));
-
-  /* Store pointers to all widgets, for use by lookup_widget(). */
-  GLADE_HOOKUP_OBJECT_NO_REF (about_win, about_win, "about_win");
-  GLADE_HOOKUP_OBJECT_NO_REF (about_win, about_vbox, "about_vbox");
-  GLADE_HOOKUP_OBJECT (about_win, about_label, "about_label");
-  GLADE_HOOKUP_OBJECT_NO_REF (about_win, about_actionarea, "about_actionarea");
-  GLADE_HOOKUP_OBJECT (about_win, about_ok, "about_ok");
-
-  return about_win;
-}
-
-GtkWidget*
 create_help_win (void)
 {
   GtkWidget *help_win;