diff --git a/MainDisplay.cpp b/MainDisplay.cpp index 6bcf80f..c483b8f 100644 --- a/MainDisplay.cpp +++ b/MainDisplay.cpp @@ -169,10 +169,29 @@ MainDisplay::SetupPushButtons (void) m_eject = new Button (this, Skin::BTN_EJECT_0, Skin::BTN_EJECT_1); m_eject->move(136, 89); - connect (m_eject, SIGNAL(clicked()), xmmsh, SLOT(fileOpen())); + connect (m_eject, SIGNAL(clicked()), this, SLOT(fileOpen())); } +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 eae213d..50c192c 100644 --- a/MainDisplay.h +++ b/MainDisplay.h @@ -49,6 +49,7 @@ 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/XMMSHandler.cpp b/XMMSHandler.cpp index 149fc01..bdcbaf9 100644 --- a/XMMSHandler.cpp +++ b/XMMSHandler.cpp @@ -66,26 +66,6 @@ XMMSHandler::connect (const char *path) return true; } -void -XMMSHandler::fileOpen (void) -{ - QStringList files = - QFileDialog::getOpenFileNames (NULL, - "Select files to play", - QDir::homePath(), - "Music (*.mp3 *.ogg *.flac *.wav *.mpc *.mp4)"); - - if (files.count() > 0) { - playlistClear (); - } - - for (int i = 0; i < files.count(); i++) { - playlistAddURL ("file://" + files.value(i)); - } - -} - - void XMMSHandler::medialib_entry_changed (XMMSResultValue *res) diff --git a/XMMSHandler.h b/XMMSHandler.h index 61435e4..830e72c 100644 --- a/XMMSHandler.h +++ b/XMMSHandler.h @@ -42,7 +42,6 @@ class XMMSHandler : public QObject, public sigc::trackable { public slots: void setPlaytime (); - void fileOpen (void); void play () { delete m_xmmsc->playback_start (); } void stop () { delete m_xmmsc->playback_stop (); }