author | simon <simon> | 2002-12-03 16:53:41 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-03 16:53:41 (UTC) |
commit | b92f6e69e5c243363c0f285dcf1f0d47bbc2cc17 (patch) (unidiff) | |
tree | 6dd69ef8a0ce4079afe7ee3b23cedb13ad8d642c | |
parent | a06817e1b4d8db570b87873610efefb55b0ab429 (diff) | |
download | opie-b92f6e69e5c243363c0f285dcf1f0d47bbc2cc17.zip opie-b92f6e69e5c243363c0f285dcf1f0d47bbc2cc17.tar.gz opie-b92f6e69e5c243363c0f285dcf1f0d47bbc2cc17.tar.bz2 |
- starting to factor out the playlist file views into separate classes
-rw-r--r-- | noncore/multimedia/opieplayer2/opieplayer2.pro | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistfileview.cpp | 14 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistfileview.h | 16 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistview.cpp | 14 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistview.h | 16 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | 5 |
6 files changed, 65 insertions, 4 deletions
diff --git a/noncore/multimedia/opieplayer2/opieplayer2.pro b/noncore/multimedia/opieplayer2/opieplayer2.pro index dbc21b1..8d549b6 100644 --- a/noncore/multimedia/opieplayer2/opieplayer2.pro +++ b/noncore/multimedia/opieplayer2/opieplayer2.pro | |||
@@ -1,25 +1,25 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | #CONFIG = qt warn_on release | 2 | #CONFIG = qt warn_on release |
3 | CONFIG = qt warn_on debug | 3 | CONFIG = qt warn_on debug |
4 | DESTDIR = $(OPIEDIR)/bin | 4 | DESTDIR = $(OPIEDIR)/bin |
5 | HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h \ | 5 | HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h \ |
6 | videowidget.h audiowidget.h playlistwidget.h om3u.h mediaplayer.h inputDialog.h \ | 6 | videowidget.h audiowidget.h playlistwidget.h om3u.h mediaplayer.h inputDialog.h \ |
7 | frame.h lib.h xinevideowidget.h volumecontrol.h playlistwidgetgui.h\ | 7 | frame.h lib.h xinevideowidget.h volumecontrol.h playlistwidgetgui.h\ |
8 | alphablend.h yuv2rgb.h threadutil.h mediawidget.h | 8 | alphablend.h yuv2rgb.h threadutil.h mediawidget.h playlistview.h playlistfileview.h |
9 | SOURCES = main.cpp \ | 9 | SOURCES = main.cpp \ |
10 | playlistselection.cpp mediaplayerstate.cpp xinecontrol.cpp \ | 10 | playlistselection.cpp mediaplayerstate.cpp xinecontrol.cpp \ |
11 | videowidget.cpp audiowidget.cpp playlistwidget.cpp om3u.cpp mediaplayer.cpp inputDialog.cpp \ | 11 | videowidget.cpp audiowidget.cpp playlistwidget.cpp om3u.cpp mediaplayer.cpp inputDialog.cpp \ |
12 | frame.cpp lib.cpp nullvideo.c xinevideowidget.cpp volumecontrol.cpp \ | 12 | frame.cpp lib.cpp nullvideo.c xinevideowidget.cpp volumecontrol.cpp \ |
13 | playlistwidgetgui.cpp\ | 13 | playlistwidgetgui.cpp\ |
14 | alphablend.c yuv2rgb.c yuv2rgb_arm.c yuv2rgb_arm4l.S \ | 14 | alphablend.c yuv2rgb.c yuv2rgb_arm.c yuv2rgb_arm4l.S \ |
15 | threadutil.cpp mediawidget.cpp | 15 | threadutil.cpp mediawidget.cpp playlistview.cpp playlistfileview.cpp |
16 | TARGET = opieplayer2 | 16 | TARGET = opieplayer2 |
17 | INCLUDEPATH += $(OPIEDIR)/include | 17 | INCLUDEPATH += $(OPIEDIR)/include |
18 | DEPENDPATH += $(OPIEDIR)/include | 18 | DEPENDPATH += $(OPIEDIR)/include |
19 | LIBS += -lqpe -lpthread -lopie -lxine | 19 | LIBS += -lqpe -lpthread -lopie -lxine |
20 | MOC_DIR = qpeobj | 20 | MOC_DIR = qpeobj |
21 | OBJECTS_DIR = qpeobj | 21 | OBJECTS_DIR = qpeobj |
22 | 22 | ||
23 | #INCLUDEPATH += $(OPIEDIR)/include | 23 | #INCLUDEPATH += $(OPIEDIR)/include |
24 | #DEPENDPATH += $(OPIEDIR)/include | 24 | #DEPENDPATH += $(OPIEDIR)/include |
25 | 25 | ||
diff --git a/noncore/multimedia/opieplayer2/playlistfileview.cpp b/noncore/multimedia/opieplayer2/playlistfileview.cpp new file mode 100644 index 0000000..bdd38e0 --- a/dev/null +++ b/noncore/multimedia/opieplayer2/playlistfileview.cpp | |||
@@ -0,0 +1,14 @@ | |||
1 | |||
2 | #include "playlistfileview.h" | ||
3 | |||
4 | PlayListFileView::PlayListFileView( QWidget *parent, const char *name ) | ||
5 | : PlayListView( parent, name ) | ||
6 | { | ||
7 | } | ||
8 | |||
9 | PlayListFileView::~PlayListFileView() | ||
10 | { | ||
11 | } | ||
12 | |||
13 | /* vim: et sw=4 ts=4 | ||
14 | */ | ||
diff --git a/noncore/multimedia/opieplayer2/playlistfileview.h b/noncore/multimedia/opieplayer2/playlistfileview.h new file mode 100644 index 0000000..eef4bd1 --- a/dev/null +++ b/noncore/multimedia/opieplayer2/playlistfileview.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef PLAYLISTFILEVIEW_H | ||
2 | #define PLAYLISTFILEVIEW_H | ||
3 | |||
4 | #include "playlistview.h" | ||
5 | |||
6 | class PlayListFileView : public PlayListView | ||
7 | { | ||
8 | Q_OBJECT | ||
9 | public: | ||
10 | PlayListFileView( QWidget *parent, const char *name = 0 ); | ||
11 | virtual ~PlayListFileView(); | ||
12 | }; | ||
13 | |||
14 | #endif // PLAYLISTFILEVIEW_H | ||
15 | /* vim: et sw=4 ts=4 | ||
16 | */ | ||
diff --git a/noncore/multimedia/opieplayer2/playlistview.cpp b/noncore/multimedia/opieplayer2/playlistview.cpp new file mode 100644 index 0000000..ebe1492 --- a/dev/null +++ b/noncore/multimedia/opieplayer2/playlistview.cpp | |||
@@ -0,0 +1,14 @@ | |||
1 | |||
2 | #include "playlistview.h" | ||
3 | |||
4 | PlayListView::PlayListView( QWidget *parent, const char *name ) | ||
5 | : QListView( parent, name ) | ||
6 | { | ||
7 | } | ||
8 | |||
9 | PlayListView::~PlayListView() | ||
10 | { | ||
11 | } | ||
12 | |||
13 | /* vim: et sw=4 ts=4 | ||
14 | */ | ||
diff --git a/noncore/multimedia/opieplayer2/playlistview.h b/noncore/multimedia/opieplayer2/playlistview.h new file mode 100644 index 0000000..f1abb07 --- a/dev/null +++ b/noncore/multimedia/opieplayer2/playlistview.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef PLAYLISTVIEW_H | ||
2 | #define PLAYLISTVIEW_H | ||
3 | |||
4 | #include <qlistview.h> | ||
5 | |||
6 | class PlayListView : public QListView | ||
7 | { | ||
8 | Q_OBJECT | ||
9 | public: | ||
10 | PlayListView( QWidget *parent, const char *name ); | ||
11 | virtual ~PlayListView(); | ||
12 | }; | ||
13 | |||
14 | #endif // PLAYLISTVIEW_H | ||
15 | /* vim: et sw=4 ts=4 | ||
16 | */ | ||
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp index f47ddcc..de7b6d5 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | |||
@@ -1,226 +1,227 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> | 4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> |
5 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> | 5 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> |
6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | 6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> |
7 | =. | 7 | =. |
8 | .=l. | 8 | .=l. |
9 | .>+-= | 9 | .>+-= |
10 | _;:, .> :=|. This program is free software; you can | 10 | _;:, .> :=|. This program is free software; you can |
11 | .> <`_, > . <= redistribute it and/or modify it under | 11 | .> <`_, > . <= redistribute it and/or modify it under |
12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
13 | .="- .-=="i, .._ License as published by the Free Software | 13 | .="- .-=="i, .._ License as published by the Free Software |
14 | - . .-<_> .<> Foundation; either version 2 of the License, | 14 | - . .-<_> .<> Foundation; either version 2 of the License, |
15 | ._= =} : or (at your option) any later version. | 15 | ._= =} : or (at your option) any later version. |
16 | .%`+i> _;_. | 16 | .%`+i> _;_. |
17 | .i_,=:_. -<s. This program is distributed in the hope that | 17 | .i_,=:_. -<s. This program is distributed in the hope that |
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
19 | : .. .:, . . . without even the implied warranty of | 19 | : .. .:, . . . without even the implied warranty of |
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; General Public License for more | 22 | ..}^=.= = ; General Public License for more |
23 | ++= -. .` .: details. | 23 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 24 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 25 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = General Public License along with | 26 | -_. . . )=. = General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 27 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <qpe/qpemenubar.h> | 34 | #include <qpe/qpemenubar.h> |
35 | #include <qpe/qpetoolbar.h> | 35 | #include <qpe/qpetoolbar.h> |
36 | #include <qpe/fileselector.h> | 36 | #include <qpe/fileselector.h> |
37 | #include <qpe/qpeapplication.h> | 37 | #include <qpe/qpeapplication.h> |
38 | #include <qpe/storage.h> | 38 | #include <qpe/storage.h> |
39 | #include <qpe/mimetype.h> | 39 | #include <qpe/mimetype.h> |
40 | #include <qpe/config.h> | 40 | #include <qpe/config.h> |
41 | #include <qpe/global.h> | 41 | #include <qpe/global.h> |
42 | #include <qpe/resource.h> | 42 | #include <qpe/resource.h> |
43 | 43 | ||
44 | #include <qpopupmenu.h> | 44 | #include <qpopupmenu.h> |
45 | #include <qaction.h> | 45 | #include <qaction.h> |
46 | #include <qcursor.h> | 46 | #include <qcursor.h> |
47 | #include <qdir.h> | 47 | #include <qdir.h> |
48 | #include <qlayout.h> | 48 | #include <qlayout.h> |
49 | 49 | ||
50 | #include "playlistselection.h" | 50 | #include "playlistselection.h" |
51 | #include "playlistwidget.h" | 51 | #include "playlistwidget.h" |
52 | #include "mediaplayerstate.h" | 52 | #include "mediaplayerstate.h" |
53 | #include "inputDialog.h" | 53 | #include "inputDialog.h" |
54 | #include "playlistfileview.h" | ||
54 | 55 | ||
55 | //only needed for the random play | 56 | //only needed for the random play |
56 | #include <stdlib.h> | 57 | #include <stdlib.h> |
57 | 58 | ||
58 | #include "audiowidget.h" | 59 | #include "audiowidget.h" |
59 | #include "videowidget.h" | 60 | #include "videowidget.h" |
60 | #include "mediaplayerstate.h" | 61 | #include "mediaplayerstate.h" |
61 | 62 | ||
62 | PlayListWidgetGui::PlayListWidgetGui( MediaPlayerState &_mediaPlayerState, QWidget* parent, const char* name ) | 63 | PlayListWidgetGui::PlayListWidgetGui( MediaPlayerState &_mediaPlayerState, QWidget* parent, const char* name ) |
63 | : QMainWindow( parent, name ), mediaPlayerState( _mediaPlayerState ) { | 64 | : QMainWindow( parent, name ), mediaPlayerState( _mediaPlayerState ) { |
64 | 65 | ||
65 | d = new PlayListWidgetPrivate; | 66 | d = new PlayListWidgetPrivate; |
66 | d->setDocumentUsed = FALSE; | 67 | d->setDocumentUsed = FALSE; |
67 | 68 | ||
68 | setBackgroundMode( PaletteButton ); | 69 | setBackgroundMode( PaletteButton ); |
69 | setToolBarsMovable( FALSE ); | 70 | setToolBarsMovable( FALSE ); |
70 | 71 | ||
71 | // Create Toolbar | 72 | // Create Toolbar |
72 | QPEToolBar *toolbar = new QPEToolBar( this ); | 73 | QPEToolBar *toolbar = new QPEToolBar( this ); |
73 | toolbar->setHorizontalStretchable( TRUE ); | 74 | toolbar->setHorizontalStretchable( TRUE ); |
74 | 75 | ||
75 | // Create Menubar | 76 | // Create Menubar |
76 | QPEMenuBar *menu = new QPEMenuBar( toolbar ); | 77 | QPEMenuBar *menu = new QPEMenuBar( toolbar ); |
77 | menu->setMargin( 0 ); | 78 | menu->setMargin( 0 ); |
78 | 79 | ||
79 | bar = new QPEToolBar( this ); | 80 | bar = new QPEToolBar( this ); |
80 | bar->setLabel( tr( "Play Operations" ) ); | 81 | bar->setLabel( tr( "Play Operations" ) ); |
81 | 82 | ||
82 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet( "trash" ), "", bar, "close" ); | 83 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet( "trash" ), "", bar, "close" ); |
83 | tbDeletePlaylist->setFlat( TRUE ); | 84 | tbDeletePlaylist->setFlat( TRUE ); |
84 | tbDeletePlaylist->setFixedSize( 20, 20 ); | 85 | tbDeletePlaylist->setFixedSize( 20, 20 ); |
85 | 86 | ||
86 | tbDeletePlaylist->hide(); | 87 | tbDeletePlaylist->hide(); |
87 | 88 | ||
88 | pmPlayList = new QPopupMenu( this ); | 89 | pmPlayList = new QPopupMenu( this ); |
89 | menu->insertItem( tr( "File" ), pmPlayList ); | 90 | menu->insertItem( tr( "File" ), pmPlayList ); |
90 | 91 | ||
91 | pmView = new QPopupMenu( this ); | 92 | pmView = new QPopupMenu( this ); |
92 | menu->insertItem( tr( "View" ), pmView ); | 93 | menu->insertItem( tr( "View" ), pmView ); |
93 | pmView->isCheckable(); | 94 | pmView->isCheckable(); |
94 | 95 | ||
95 | skinsMenu = new QPopupMenu( this ); | 96 | skinsMenu = new QPopupMenu( this ); |
96 | pmView->insertItem( tr( "Skins" ), skinsMenu ); | 97 | pmView->insertItem( tr( "Skins" ), skinsMenu ); |
97 | skinsMenu->isCheckable(); | 98 | skinsMenu->isCheckable(); |
98 | 99 | ||
99 | gammaMenu = new QPopupMenu( this ); | 100 | gammaMenu = new QPopupMenu( this ); |
100 | pmView->insertItem( tr( "Gamma (Video)" ), gammaMenu ); | 101 | pmView->insertItem( tr( "Gamma (Video)" ), gammaMenu ); |
101 | 102 | ||
102 | gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); | 103 | gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); |
103 | gammaSlider->setRange( -40, 40 ); | 104 | gammaSlider->setRange( -40, 40 ); |
104 | gammaSlider->setTickmarks( QSlider::Left ); | 105 | gammaSlider->setTickmarks( QSlider::Left ); |
105 | gammaSlider->setTickInterval( 20 ); | 106 | gammaSlider->setTickInterval( 20 ); |
106 | gammaSlider->setFocusPolicy( QWidget::StrongFocus ); | 107 | gammaSlider->setFocusPolicy( QWidget::StrongFocus ); |
107 | gammaSlider->setValue( 0 ); | 108 | gammaSlider->setValue( 0 ); |
108 | gammaSlider->setMinimumHeight( 50 ); | 109 | gammaSlider->setMinimumHeight( 50 ); |
109 | 110 | ||
110 | gammaLCD = new QLCDNumber( 3, gammaMenu ); | 111 | gammaLCD = new QLCDNumber( 3, gammaMenu ); |
111 | gammaLCD-> setFrameShape ( QFrame::NoFrame ); | 112 | gammaLCD-> setFrameShape ( QFrame::NoFrame ); |
112 | gammaLCD-> setSegmentStyle ( QLCDNumber::Flat ); | 113 | gammaLCD-> setSegmentStyle ( QLCDNumber::Flat ); |
113 | 114 | ||
114 | gammaMenu->insertItem( gammaSlider ); | 115 | gammaMenu->insertItem( gammaSlider ); |
115 | gammaMenu->insertItem( gammaLCD ); | 116 | gammaMenu->insertItem( gammaLCD ); |
116 | 117 | ||
117 | connect( gammaSlider, SIGNAL( valueChanged( int ) ), gammaLCD, SLOT( display( int ) ) ); | 118 | connect( gammaSlider, SIGNAL( valueChanged( int ) ), gammaLCD, SLOT( display( int ) ) ); |
118 | 119 | ||
119 | vbox5 = new QVBox( this ); | 120 | vbox5 = new QVBox( this ); |
120 | QVBox *vbox4 = new QVBox( vbox5 ); | 121 | QVBox *vbox4 = new QVBox( vbox5 ); |
121 | QHBox *hbox6 = new QHBox( vbox4 ); | 122 | QHBox *hbox6 = new QHBox( vbox4 ); |
122 | 123 | ||
123 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); | 124 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); |
124 | 125 | ||
125 | QWidget *pTab; | 126 | QWidget *pTab; |
126 | pTab = new QWidget( tabWidget, "pTab" ); | 127 | pTab = new QWidget( tabWidget, "pTab" ); |
127 | tabWidget->insertTab( pTab, "Playlist"); | 128 | tabWidget->insertTab( pTab, "Playlist"); |
128 | 129 | ||
129 | QGridLayout *Playout = new QGridLayout( pTab ); | 130 | QGridLayout *Playout = new QGridLayout( pTab ); |
130 | Playout->setSpacing( 2); | 131 | Playout->setSpacing( 2); |
131 | Playout->setMargin( 2); | 132 | Playout->setMargin( 2); |
132 | 133 | ||
133 | // Add the playlist area | 134 | // Add the playlist area |
134 | QVBox *vbox3 = new QVBox( pTab ); | 135 | QVBox *vbox3 = new QVBox( pTab ); |
135 | d->playListFrame = vbox3; | 136 | d->playListFrame = vbox3; |
136 | 137 | ||
137 | QHBox *hbox2 = new QHBox( vbox3 ); | 138 | QHBox *hbox2 = new QHBox( vbox3 ); |
138 | d->selectedFiles = new PlayListSelection( hbox2 ); | 139 | d->selectedFiles = new PlayListSelection( hbox2 ); |
139 | 140 | ||
140 | vbox1 = new QVBox( hbox2 ); | 141 | vbox1 = new QVBox( hbox2 ); |
141 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(), QPEApplication::RightOnHold ); | 142 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(), QPEApplication::RightOnHold ); |
142 | QVBox *stretch1 = new QVBox( vbox1 ); // add stretch | 143 | QVBox *stretch1 = new QVBox( vbox1 ); // add stretch |
143 | 144 | ||
144 | Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); | 145 | Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); |
145 | 146 | ||
146 | QWidget *aTab; | 147 | QWidget *aTab; |
147 | aTab = new QWidget( tabWidget, "aTab" ); | 148 | aTab = new QWidget( tabWidget, "aTab" ); |
148 | 149 | ||
149 | QGridLayout *Alayout = new QGridLayout( aTab ); | 150 | QGridLayout *Alayout = new QGridLayout( aTab ); |
150 | Alayout->setSpacing( 2 ); | 151 | Alayout->setSpacing( 2 ); |
151 | Alayout->setMargin( 2 ); | 152 | Alayout->setMargin( 2 ); |
152 | audioView = new QListView( aTab, "Audioview" ); | 153 | audioView = new PlayListFileView( aTab, "Audioview" ); |
153 | audioView->addColumn( tr( "Title" ), 140 ); | 154 | audioView->addColumn( tr( "Title" ), 140 ); |
154 | audioView->addColumn( tr( "Size" ), -1 ); | 155 | audioView->addColumn( tr( "Size" ), -1 ); |
155 | audioView->addColumn( tr( "Media" ), 0 ); | 156 | audioView->addColumn( tr( "Media" ), 0 ); |
156 | audioView->addColumn( tr( "Path" ), -1 ); | 157 | audioView->addColumn( tr( "Path" ), -1 ); |
157 | audioView->setColumnAlignment( 1, Qt::AlignRight ); | 158 | audioView->setColumnAlignment( 1, Qt::AlignRight ); |
158 | audioView->setColumnAlignment( 2, Qt::AlignRight ); | 159 | audioView->setColumnAlignment( 2, Qt::AlignRight ); |
159 | audioView->setAllColumnsShowFocus( TRUE ); | 160 | audioView->setAllColumnsShowFocus( TRUE ); |
160 | audioView->setSorting( 3, TRUE ); | 161 | audioView->setSorting( 3, TRUE ); |
161 | audioView->setMultiSelection( TRUE ); | 162 | audioView->setMultiSelection( TRUE ); |
162 | audioView->setSelectionMode( QListView::Extended ); | 163 | audioView->setSelectionMode( QListView::Extended ); |
163 | Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); | 164 | Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); |
164 | tabWidget->insertTab( aTab, tr( "Audio" ) ); | 165 | tabWidget->insertTab( aTab, tr( "Audio" ) ); |
165 | 166 | ||
166 | QPEApplication::setStylusOperation( audioView->viewport(), QPEApplication::RightOnHold ); | 167 | QPEApplication::setStylusOperation( audioView->viewport(), QPEApplication::RightOnHold ); |
167 | 168 | ||
168 | QWidget *vTab; | 169 | QWidget *vTab; |
169 | vTab = new QWidget( tabWidget, "vTab" ); | 170 | vTab = new QWidget( tabWidget, "vTab" ); |
170 | 171 | ||
171 | QGridLayout *Vlayout = new QGridLayout( vTab ); | 172 | QGridLayout *Vlayout = new QGridLayout( vTab ); |
172 | Vlayout->setSpacing( 2 ); | 173 | Vlayout->setSpacing( 2 ); |
173 | Vlayout->setMargin( 2 ); | 174 | Vlayout->setMargin( 2 ); |
174 | videoView = new QListView( vTab, "Videoview" ); | 175 | videoView = new PlayListFileView( vTab, "Videoview" ); |
175 | videoView->addColumn( tr( "Title" ), 140); | 176 | videoView->addColumn( tr( "Title" ), 140); |
176 | videoView->addColumn( tr( "Size" ), -1 ); | 177 | videoView->addColumn( tr( "Size" ), -1 ); |
177 | videoView->addColumn(tr( "Media" ), 0 ); | 178 | videoView->addColumn(tr( "Media" ), 0 ); |
178 | videoView->addColumn(tr( "Path" ), -1 ); | 179 | videoView->addColumn(tr( "Path" ), -1 ); |
179 | videoView->setColumnAlignment( 1, Qt::AlignRight ); | 180 | videoView->setColumnAlignment( 1, Qt::AlignRight ); |
180 | videoView->setColumnAlignment( 2, Qt::AlignRight ); | 181 | videoView->setColumnAlignment( 2, Qt::AlignRight ); |
181 | videoView->setAllColumnsShowFocus( TRUE ); | 182 | videoView->setAllColumnsShowFocus( TRUE ); |
182 | videoView->setSorting( 3, TRUE ); | 183 | videoView->setSorting( 3, TRUE ); |
183 | videoView->setMultiSelection( TRUE ); | 184 | videoView->setMultiSelection( TRUE ); |
184 | videoView->setSelectionMode( QListView::Extended ); | 185 | videoView->setSelectionMode( QListView::Extended ); |
185 | Vlayout->addMultiCellWidget( videoView, 0, 0, 0, 1 ); | 186 | Vlayout->addMultiCellWidget( videoView, 0, 0, 0, 1 ); |
186 | 187 | ||
187 | QPEApplication::setStylusOperation( videoView->viewport(), QPEApplication::RightOnHold ); | 188 | QPEApplication::setStylusOperation( videoView->viewport(), QPEApplication::RightOnHold ); |
188 | 189 | ||
189 | tabWidget->insertTab( vTab, tr( "Video" ) ); | 190 | tabWidget->insertTab( vTab, tr( "Video" ) ); |
190 | 191 | ||
191 | //playlists list | 192 | //playlists list |
192 | QWidget *LTab; | 193 | QWidget *LTab; |
193 | LTab = new QWidget( tabWidget, "LTab" ); | 194 | LTab = new QWidget( tabWidget, "LTab" ); |
194 | QGridLayout *Llayout = new QGridLayout( LTab ); | 195 | QGridLayout *Llayout = new QGridLayout( LTab ); |
195 | Llayout->setSpacing( 2 ); | 196 | Llayout->setSpacing( 2 ); |
196 | Llayout->setMargin( 2 ); | 197 | Llayout->setMargin( 2 ); |
197 | 198 | ||
198 | playLists = new FileSelector( "playlist/plain;audio/x-mpegurl", LTab, "fileselector" , FALSE, FALSE ); | 199 | playLists = new FileSelector( "playlist/plain;audio/x-mpegurl", LTab, "fileselector" , FALSE, FALSE ); |
199 | Llayout->addMultiCellWidget( playLists, 0, 0, 0, 1 ); | 200 | Llayout->addMultiCellWidget( playLists, 0, 0, 0, 1 ); |
200 | 201 | ||
201 | tabWidget->insertTab( LTab, tr( "Lists" ) ); | 202 | tabWidget->insertTab( LTab, tr( "Lists" ) ); |
202 | 203 | ||
203 | setCentralWidget( vbox5 ); | 204 | setCentralWidget( vbox5 ); |
204 | } | 205 | } |
205 | 206 | ||
206 | 207 | ||
207 | 208 | ||
208 | PlayListWidgetGui::~PlayListWidgetGui() { | 209 | PlayListWidgetGui::~PlayListWidgetGui() { |
209 | } | 210 | } |
210 | 211 | ||
211 | void PlayListWidgetGui::setView( char view ) { | 212 | void PlayListWidgetGui::setView( char view ) { |
212 | if ( view == 'l' ) | 213 | if ( view == 'l' ) |
213 | showMaximized(); | 214 | showMaximized(); |
214 | else | 215 | else |
215 | hide(); | 216 | hide(); |
216 | } | 217 | } |
217 | 218 | ||
218 | 219 | ||
219 | void PlayListWidgetGui::setActiveWindow() { | 220 | void PlayListWidgetGui::setActiveWindow() { |
220 | // qDebug("SETTING active window"); | 221 | // qDebug("SETTING active window"); |
221 | // When we get raised we need to ensure that it switches views | 222 | // When we get raised we need to ensure that it switches views |
222 | MediaPlayerState::DisplayType origDisplayType = mediaPlayerState.displayType(); | 223 | MediaPlayerState::DisplayType origDisplayType = mediaPlayerState.displayType(); |
223 | mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection ); // invalidate | 224 | mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection ); // invalidate |
224 | mediaPlayerState.setDisplayType( origDisplayType ); // now switch back | 225 | mediaPlayerState.setDisplayType( origDisplayType ); // now switch back |
225 | } | 226 | } |
226 | 227 | ||