changeset 2793:14a58e80ecfe

merge
author mf0102 <0102@gmx.at>
date Wed, 09 Jul 2008 22:25:31 +0200
parents 04c38b7a6079
children f3e242d1855b
files src/skins/plugin.c src/skins/skins_cfg.c src/skins/skins_cfg.h src/skins/ui_main.c src/skins/ui_main.h src/skins/ui_playlist.c
diffstat 6 files changed, 12 insertions(+), 70 deletions(-) [+]
line wrap: on
line diff
--- a/src/skins/plugin.c	Wed Jul 09 21:53:42 2008 +0200
+++ b/src/skins/plugin.c	Wed Jul 09 22:25:31 2008 +0200
@@ -36,7 +36,8 @@
     .id = "skinned",
     .desc = "Audacious Skinned GUI",
     .init = skins_init,
-    .fini = skins_cleanup
+    .fini = skins_cleanup,
+    .conf = skins_configure
 };
 
 SIMPLE_INTERFACE_PLUGIN("skinned", &skins_gp);
@@ -85,6 +86,8 @@
     init_skins(config.skin);
     mainwin_setup_menus();
 
+    aud_hook_call("create prefswin", NULL);
+
     if (config.player_visible) mainwin_real_show();
     if (config.equalizer_visible) equalizerwin_show(TRUE);
     if (config.playlist_visible) playlistwin_show();
--- a/src/skins/skins_cfg.c	Wed Jul 09 21:53:42 2008 +0200
+++ b/src/skins/skins_cfg.c	Wed Jul 09 22:25:31 2008 +0200
@@ -547,7 +547,7 @@
     }
 }
 
-void skins_configure(void) {
+GtkWidget* skins_configure(void) {
     GtkWidget *appearance_page_vbox;
     GtkWidget *vbox37;
     GtkWidget *vbox38;
@@ -561,21 +561,7 @@
     GtkWidget *alignment95;
     GtkWidget *skin_view_scrolled_window;
 
-    if (cfg_win != NULL) {
-        gtk_window_present(GTK_WINDOW(cfg_win));
-        return;
-    }
-
-    cfg_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-    gtk_window_set_type_hint(GTK_WINDOW(cfg_win), GDK_WINDOW_TYPE_HINT_DIALOG);
-    gtk_window_set_title(GTK_WINDOW(cfg_win), _("Audacious Skinned GUI Configuration"));
-    gtk_container_set_border_width(GTK_CONTAINER(cfg_win), 10);
-    g_signal_connect(G_OBJECT(cfg_win), "destroy" ,
-                     G_CALLBACK(gtk_widget_destroyed), &cfg_win);
-    gtk_widget_set_size_request(cfg_win, 500, -1);
-
     appearance_page_vbox = gtk_vbox_new (FALSE, 0);
-    gtk_container_add(GTK_CONTAINER(cfg_win), appearance_page_vbox);
 
     vbox37 = gtk_vbox_new (FALSE, 0);
     gtk_box_pack_start (GTK_BOX (appearance_page_vbox), vbox37, TRUE, TRUE, 0);
@@ -658,5 +644,5 @@
 
     gtk_window_present(GTK_WINDOW(cfg_win));
 
-    return;
+    return appearance_page_vbox;
 }
--- a/src/skins/skins_cfg.h	Wed Jul 09 21:53:42 2008 +0200
+++ b/src/skins/skins_cfg.h	Wed Jul 09 22:25:31 2008 +0200
@@ -22,6 +22,7 @@
 #define SKINS_CFG_H
 
 #include <glib.h>
+#include <gtk/gtk.h>
 
 #define MAINWIN_DEFAULT_POS_X    20
 #define MAINWIN_DEFAULT_POS_Y    20
@@ -86,6 +87,6 @@
 void skins_cfg_load();
 void skins_cfg_save();
 
-void skins_configure(void);
+GtkWidget* skins_configure(void);
 
 #endif
--- a/src/skins/ui_main.c	Wed Jul 09 21:53:42 2008 +0200
+++ b/src/skins/ui_main.c	Wed Jul 09 22:25:31 2008 +0200
@@ -68,7 +68,6 @@
 #include "ui_dock.h"
 #include "ui_main_evlisteners.h"
 #include "ui_skinselector.h"
-#include "ui_urlopener.h"
 #include "util.h"
 #include "visualization.h"
 #endif
@@ -1073,30 +1072,6 @@
 }
 
 static void
-on_add_url_add_clicked(GtkWidget * widget,
-                       GtkWidget * entry)
-{
-    const gchar *text = gtk_entry_get_text(GTK_ENTRY(entry));
-    if (text && *text)
-        aud_playlist_add_url(aud_playlist_get_active(), text);
-}
-
-static void
-on_add_url_ok_clicked(GtkWidget * widget,
-                      GtkWidget * entry)
-{
-    Playlist *playlist = aud_playlist_get_active();
-
-    const gchar *text = gtk_entry_get_text(GTK_ENTRY(entry));
-    if (text && *text)
-    {
-        aud_playlist_clear(playlist);
-        aud_playlist_add_url(playlist, text);
-        audacious_drct_initiate();
-    }
-}
-
-static void
 on_visibility_warning_toggle(GtkToggleButton *tbt, gpointer unused)
 {
     config.warn_about_win_visibility = !gtk_toggle_button_get_active(tbt);
@@ -1220,28 +1195,6 @@
     g_free(theme);
 }
 
-void
-mainwin_show_add_url_window(void)
-{
-#if 0
-    static GtkWidget *url_window = NULL;
-
-    if (!url_window) {
-        url_window =
-            util_add_url_dialog_new(_("Enter location to play:"),
-                                    G_CALLBACK(on_add_url_ok_clicked),
-                                    G_CALLBACK(on_add_url_add_clicked));
-        gtk_window_set_transient_for(GTK_WINDOW(url_window),
-                                     GTK_WINDOW(mainwin));
-        g_signal_connect(url_window, "destroy",
-                         G_CALLBACK(gtk_widget_destroyed),
-                         &url_window);
-    }
-
-    gtk_window_present(GTK_WINDOW(url_window));
-#endif
-}
-
 static void
 check_set( GtkActionGroup * action_group ,
            const gchar * action_name ,
@@ -1749,7 +1702,7 @@
             break;
         }
         case MAINWIN_GENERAL_PLAYLOCATION:
-            mainwin_show_add_url_window();
+            action_play_location();
             break;
         case MAINWIN_GENERAL_FILEINFO:
             aud_playlist_fileinfo_current(playlist);
@@ -2756,7 +2709,7 @@
 void
 action_play_location( void )
 {
-    mainwin_show_add_url_window();
+    aud_hook_call("urlopener show", NULL);
 }
 
 void
--- a/src/skins/ui_main.h	Wed Jul 09 21:53:42 2008 +0200
+++ b/src/skins/ui_main.h	Wed Jul 09 22:25:31 2008 +0200
@@ -155,7 +155,6 @@
 void mainwin_repeat_pushed(gboolean toggled);
 void mainwin_disable_seekbar(void);
 void mainwin_set_title(const gchar * text);
-void mainwin_show_add_url_window(void);
 void mainwin_minimize_cb(void);
 void mainwin_general_menu_callback(gpointer cb_data,
                                    guint action,
--- a/src/skins/ui_playlist.c	Wed Jul 09 21:53:42 2008 +0200
+++ b/src/skins/ui_playlist.c	Wed Jul 09 22:25:31 2008 +0200
@@ -1201,7 +1201,7 @@
         break;
     case GDK_Insert:
         if (event->state & GDK_MOD1_MASK)
-            mainwin_show_add_url_window();
+            action_playlist_add_url();
         else
             playlistwin_show_filebrowser();
         break;
@@ -1802,7 +1802,7 @@
 void
 action_playlist_add_url(void)
 {
-    mainwin_show_add_url_window();
+    aud_hook_call("urlopener show", NULL);
 }
 
 void