From 35f1856773c731571e3133abb6abf9dc0b4c747a Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 27 Nov 2009 15:09:06 +0100 Subject: Add search more button, and improve layout of main interface --- qtspotify.ui | 13 ++++++++++--- qtspotifymain.cpp | 21 +++++++++++++++++++++ qtspotifymain.h | 2 ++ 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/qtspotify.ui b/qtspotify.ui index 7be2d8e..3145a4c 100644 --- a/qtspotify.ui +++ b/qtspotify.ui @@ -18,7 +18,7 @@ - 1 + 2 @@ -74,7 +74,14 @@ - + + + + + Searches + + + Searches @@ -234,7 +241,7 @@ 0 0 340 - 24 + 20 diff --git a/qtspotifymain.cpp b/qtspotifymain.cpp index 9b9186f..deb9546 100644 --- a/qtspotifymain.cpp +++ b/qtspotifymain.cpp @@ -136,10 +136,31 @@ void QtSpotifyMain::initUi() m_ui.coverArtLabel, SLOT(setPixmap(QPixmap))); connect(m_ui.actionSearch, SIGNAL(triggered()), this, SLOT(search())); + connect(m_ui.searchMoreButton, SIGNAL(clicked()), this, SLOT(searchMore())); connect(m_ui.skipSongButton, SIGNAL(clicked()), this, SLOT(skip())); connect(m_ui.previousButton, SIGNAL(clicked()), this, SLOT(previous())); connect(m_ui.playList, SIGNAL(doubleClicked(QModelIndex)), this, SIGNAL(playlistItemActivated())); + connect(m_ui.playList, SIGNAL(activated(QModelIndex)), + this, SLOT(playlistActivated(QModelIndex))); +} + +void QtSpotifyMain::playlistActivated(const QModelIndex &index) +{ + if (index.column() == 0) { // Artist + } else if (index.column() == 2) { // Album + } +} + +void QtSpotifyMain::searchMore() +{ + QModelIndex idx = m_ui.searchListView->currentIndex(); + QVariant variant = idx.data(Qt::UserRole); + QtPlaylist *pl = variant.value(); + if (pl != 0) { + pl->searchMore(); + emit searched(); + } } void QtSpotifyMain::skip() diff --git a/qtspotifymain.h b/qtspotifymain.h index 4078179..e2bdf1e 100644 --- a/qtspotifymain.h +++ b/qtspotifymain.h @@ -102,6 +102,8 @@ private slots: void search(); void skip(); void previous(); + void searchMore(); + void playlistActivated(const QModelIndex &index); signals: void loggedIn(); -- cgit v1.2.3