diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2009-11-27 15:09:06 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2009-11-27 15:09:06 +0100 |
commit | 35f1856773c731571e3133abb6abf9dc0b4c747a (patch) | |
tree | a4e72813b2f54b38fde0a88bf2c60ccacf12f5d0 | |
parent | abf19c9f66679f053f26d02157acbcdff7e9e2de (diff) |
Add search more button, and improve layout of
main interface
-rw-r--r-- | qtspotify.ui | 13 | ||||
-rw-r--r-- | qtspotifymain.cpp | 21 | ||||
-rw-r--r-- | 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 @@ <item row="0" column="0"> <widget class="QTabWidget" name="topLevelTabs"> <property name="currentIndex"> - <number>1</number> + <number>2</number> </property> <widget class="QWidget" name="tab"> <attribute name="title"> @@ -74,7 +74,14 @@ </layout> </widget> </item> - <item row="1" column="0"> + </layout> + </widget> + <widget class="QWidget" name="searches"> + <attribute name="title"> + <string>Searches</string> + </attribute> + <layout class="QGridLayout" name="gridLayout_7"> + <item row="0" column="0"> <widget class="QGroupBox" name="groupBox"> <property name="title"> <string>Searches</string> @@ -234,7 +241,7 @@ <x>0</x> <y>0</y> <width>340</width> - <height>24</height> + <height>20</height> </rect> </property> <widget class="QMenu" name="menu_File"> 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<QtPlaylist *>(); + 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(); |