summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-02 14:12:57 (UTC)
committer simon <simon>2002-12-02 14:12:57 (UTC)
commit6a1400bdf754df18a1f20bd50ab5e5e4b0fd5a86 (patch) (unidiff)
treed245c2d8dff55f422ed779c6c8ebeefb0ab10ac6
parentcc1324d2def09e55e5a688fa3e2d33924f7f5ef9 (diff)
downloadopie-6a1400bdf754df18a1f20bd50ab5e5e4b0fd5a86.zip
opie-6a1400bdf754df18a1f20bd50ab5e5e4b0fd5a86.tar.gz
opie-6a1400bdf754df18a1f20bd50ab5e5e4b0fd5a86.tar.bz2
- added a currentTab method that returns an enum containing the current tab
type in a verbose manner (AudioFiles, VideoFiles, CurrentPlayList, etc.), as a future replacment for whichList() which just returns an integer
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp12
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.h3
2 files changed, 15 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index d1506db..9918eeb 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -52,6 +52,7 @@
52 52
53//only needed for the random play 53//only needed for the random play
54#include <stdlib.h> 54#include <stdlib.h>
55#include <assert.h>
55 56
56#include "audiowidget.h" 57#include "audiowidget.h"
57#include "videowidget.h" 58#include "videowidget.h"
@@ -1145,6 +1146,17 @@ int PlayListWidget::whichList() {
1145 return tabWidget->currentPageIndex(); 1146 return tabWidget->currentPageIndex();
1146} 1147}
1147 1148
1149PlayListWidget::TabType PlayListWidget::currentTab() const
1150{
1151 static const TabType indexToTabType[ NumTabTypes ] =
1152 { CurrentPlaylist, AudioFiles, VideoFiles, PlayLists };
1153
1154 int index = tabWidget->currentPageIndex();
1155 assert( index < NumTabTypes && index >= 0 );
1156
1157 return indexToTabType[ index ];
1158}
1159
1148QString PlayListWidget::currentFileListPathName() { 1160QString PlayListWidget::currentFileListPathName() {
1149 switch (whichList()) { 1161 switch (whichList()) {
1150 case 1: 1162 case 1:
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h
index b2c389e..05d53a4 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.h
+++ b/noncore/multimedia/opieplayer2/playlistwidget.h
@@ -55,6 +55,8 @@ class QLabel;
55class PlayListWidget : public PlayListWidgetGui { 55class PlayListWidget : public PlayListWidgetGui {
56 Q_OBJECT 56 Q_OBJECT
57public: 57public:
58 enum TabType { CurrentPlayList, AudioFiles, VideoFiles, PlayLists, NumTabTypes = 4 };
59
58 PlayListWidget( QWidget* parent=0, const char* name=0, WFlags fl=0 ); 60 PlayListWidget( QWidget* parent=0, const char* name=0, WFlags fl=0 );
59 ~PlayListWidget(); 61 ~PlayListWidget();
60 DocLnkSet files; 62 DocLnkSet files;
@@ -67,6 +69,7 @@ public:
67 void useSelectedDocument(); 69 void useSelectedDocument();
68 int selected; 70 int selected;
69 int whichList(); 71 int whichList();
72 TabType currentTab() const;
70 73
71public slots: 74public slots:
72 bool first(); 75 bool first();