From 41becf578bfb2621ec53d9989ae113f243157f91 Mon Sep 17 00:00:00 2001 From: druid23 Date: Tue, 17 Aug 2010 02:10:59 +0100 Subject: [PATCH] Improved playlist and show event handling. modified: browsemainwindow.cpp modified: browsemainwindow.h modified: playermainwindow.cpp modified: playlistmainwindow.cpp modified: playlistmainwindow.h --- browsemainwindow.cpp | 3 +++ browsemainwindow.h | 1 + playermainwindow.cpp | 2 ++ playlistmainwindow.cpp | 5 +++-- playlistmainwindow.h | 1 + 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/browsemainwindow.cpp b/browsemainwindow.cpp index 8cb7875..90f09a7 100644 --- a/browsemainwindow.cpp +++ b/browsemainwindow.cpp @@ -58,6 +58,9 @@ BrowseMainWindow::BrowseMainWindow(QWidget *parent) : void BrowseMainWindow::init() // THIS METHOD IS CALLED WHEN CONFIG CHANGED... { mIp = AccountDialog::currentIp(); +} +void BrowseMainWindow::showCurrentDirectory() // THIS METHOD IS CALLED WHEN WINDOW IS OPENED... +{ browseDirectory(mCurrentDir); } diff --git a/browsemainwindow.h b/browsemainwindow.h index 163adb7..bc83ad8 100644 --- a/browsemainwindow.h +++ b/browsemainwindow.h @@ -43,6 +43,7 @@ public slots: void onListSelectionChanged(); void finished(QNetworkReply * reply); void readReady(); + void showCurrentDirectory(); protected slots: void parseXmlDirectory(); diff --git a/playermainwindow.cpp b/playermainwindow.cpp index 5df823d..791da6b 100644 --- a/playermainwindow.cpp +++ b/playermainwindow.cpp @@ -76,7 +76,9 @@ PlayerMainWindow::PlayerMainWindow(QWidget *parent) : connect(ui->actionConfiguration,SIGNAL(triggered()),this,SLOT(showConfig())); connect(ui->actionAbout,SIGNAL(triggered()),this,SLOT(showAbout())); connect(ui->playlistButton,SIGNAL(clicked()),mPlayListMainWindow,SLOT(show())); + connect(ui->playlistButton,SIGNAL(clicked()),mPlayListMainWindow,SLOT(showPlayList())); connect(ui->browseButton,SIGNAL(clicked()),mBrowserMainWindow,SLOT(show())); + connect(ui->browseButton,SIGNAL(clicked()),mBrowserMainWindow,SLOT(showCurrentDirectory())); connect(ui->playButton,SIGNAL(clicked()),this,SLOT(play())); connect(ui->stopButton,SIGNAL(clicked()),this,SLOT(stop())); diff --git a/playlistmainwindow.cpp b/playlistmainwindow.cpp index 7fec0ec..4af4b7a 100644 --- a/playlistmainwindow.cpp +++ b/playlistmainwindow.cpp @@ -68,9 +68,10 @@ PlayListMainWindow::PlayListMainWindow(QWidget *parent) : void PlayListMainWindow::init() // CALL WHEN CONFIG CHANGES { mIp = AccountDialog::currentIp(); +} +void PlayListMainWindow::showPlayList() // CALL WHEN SHOWN +{ requestPlayList(); - - } PlayListMainWindow::~PlayListMainWindow() diff --git a/playlistmainwindow.h b/playlistmainwindow.h index fdb5f51..6e87837 100644 --- a/playlistmainwindow.h +++ b/playlistmainwindow.h @@ -49,6 +49,7 @@ public slots: void onListSelectionChanged(); void finished(QNetworkReply * reply); void readReady(); + void showPlayList(); protected slots: void parseXmlPlayList(); -- 1.7.9.5