diff --git a/Display.cpp b/Display.cpp index 3aca0c3..956f449 100644 --- a/Display.cpp +++ b/Display.cpp @@ -1,6 +1,8 @@ #include "MainWindow.h" #include "Display.h" +#include + SkinDisplay::SkinDisplay (QWidget *parent) : QWidget(parent) { Skin *skin = Skin::getInstance (); @@ -52,3 +54,23 @@ SkinDisplay::paintEvent (QPaintEvent *event) paint.eraseRect(rect()); paint.end(); } + +void +SkinDisplay::fileOpen (void) +{ + XMMSHandler *xmmsh = XMMSHandler::getInstance(); + QStringList files; + + files = QFileDialog::getOpenFileNames (NULL, "Select files to play", + QDir::homePath(), + "Music (*.mp3 *.ogg *.flac *.wav *.mpc *.mp4)"); + + if (files.count() > 0) { + xmmsh->playlistClear (); + } + + for (int i = 0; i < files.count(); i++) { + xmmsh->playlistAddURL ("file://" + files.value(i)); + } +} + diff --git a/Display.h b/Display.h index 9904e14..4e5f785 100644 --- a/Display.h +++ b/Display.h @@ -21,6 +21,7 @@ class SkinDisplay : public QWidget public slots: virtual void setPixmaps(Skin *skin); + void fileOpen (void); protected: void mousePressEvent (QMouseEvent *); diff --git a/MainDisplay.cpp b/MainDisplay.cpp index c483b8f..82c4533 100644 --- a/MainDisplay.cpp +++ b/MainDisplay.cpp @@ -173,25 +173,6 @@ MainDisplay::SetupPushButtons (void) } -void -MainDisplay::fileOpen (void) -{ - XMMSHandler *xmmsh = XMMSHandler::getInstance(); - QStringList files; - - files = QFileDialog::getOpenFileNames (NULL, "Select files to play", - QDir::homePath(), - "Music (*.mp3 *.ogg *.flac *.wav *.mpc *.mp4)"); - - if (files.count() > 0) { - xmmsh->playlistClear (); - } - - for (int i = 0; i < files.count(); i++) { - xmmsh->playlistAddURL ("file://" + files.value(i)); - } -} - MainDisplay::~MainDisplay (void) { } diff --git a/MainDisplay.h b/MainDisplay.h index 50c192c..eae213d 100644 --- a/MainDisplay.h +++ b/MainDisplay.h @@ -49,7 +49,6 @@ class MainDisplay : public SkinDisplay void setStatus (uint status); void setPlaytime (uint time); void setMediainfo (QHash); - void fileOpen (void); protected: void SetupPushButtons (void); diff --git a/Medialib.cpp b/Medialib.cpp index 0dd42a3..69c51b1 100644 --- a/Medialib.cpp +++ b/Medialib.cpp @@ -61,7 +61,7 @@ MedialibWindow::MedialibWindow (QWidget *parent) : QMainWindow (parent) connect (m_http, SIGNAL (requestFinished (int, bool)), this, SLOT (httpDone (int, bool))); connect (m_http, SIGNAL (requestStarted (int)), this, - SLOT (httpDone (int))); + SLOT (httpStarted (int))); /*** artist ***/ m_artist = new MediaArtistList (this, "artist"); diff --git a/ShadedDisplay.cpp b/ShadedDisplay.cpp index 695ba04..19e2d94 100644 --- a/ShadedDisplay.cpp +++ b/ShadedDisplay.cpp @@ -49,7 +49,7 @@ ShadedDisplay::ShadedDisplay (QWidget *parent) : SkinDisplay (parent) m_eject = new Button (this); m_eject->move(216, 4); m_eject->resize (9, 7); - connect (m_eject, SIGNAL(clicked()), xmmsh, SLOT(fileOpen())); + connect (m_eject, SIGNAL(clicked()), this, SLOT(fileOpen())); connect (xmmsh, SIGNAL(playbackStatusChanged(uint)), this, SLOT(setStatus(uint))); diff --git a/Slider.cpp b/Slider.cpp index a0a4b41..93521dc 100644 --- a/Slider.cpp +++ b/Slider.cpp @@ -75,8 +75,6 @@ BarButton::mouseMoveEvent (QMouseEvent *event) Slider::Slider (QWidget *parent, uint bg, uint bnormal, uint bpressed, bool vertical) : PixWidget (parent) { - XMMSHandler *xmmsh = XMMSHandler::getInstance (); - m_bg = bg; m_vertical = vertical; @@ -88,9 +86,6 @@ Slider::Slider (QWidget *parent, uint bg, uint bnormal, uint bpressed, bool vert m_button = new BarButton (this, bnormal, bpressed); m_button->move (0, 0); - connect (m_button, SIGNAL(clicked ()), - xmmsh, SLOT (setPlaytime ())); - if (m_vertical) { m_pix = size().width()-m_button->size().width(); } else { diff --git a/promoe.pro b/promoe.pro index 3297b0c..ed9c35c 100644 --- a/promoe.pro +++ b/promoe.pro @@ -63,10 +63,10 @@ QMAKE_LFLAGS += -L$$[QT_INSTALL_PLUGINS]/imageformats CONFIG += link_pkgconfig -QMAKE_CXXFLAGS += -g -;CONFIG += debug warn_on +;QMAKE_CXXFLAGS += -g +CONFIG += debug warn_on QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-parameter PKGCONFIG += xmms2-client xmms2-client-cpp sigc++-2.0 -CONFIG += avahi +;CONFIG += avahi