author | llornkcor <llornkcor> | 2002-08-10 17:41:15 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-08-10 17:41:15 (UTC) |
commit | b488752cf2149443dcebcc8f7ad21c1ba47070fa (patch) (unidiff) | |
tree | 461adc8345f14d495466e5082f36651a844bde67 /noncore/multimedia/opieplayer2/playlistwidget.cpp | |
parent | fb46a101bab9348ebfb68094b7c6cf54e56ea774 (diff) | |
download | opie-b488752cf2149443dcebcc8f7ad21c1ba47070fa.zip opie-b488752cf2149443dcebcc8f7ad21c1ba47070fa.tar.gz opie-b488752cf2149443dcebcc8f7ad21c1ba47070fa.tar.bz2 |
added skins to videowidget, fixed fullscreen menu. Still needs work on buttonmask.
Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index b43d9f7..65458e7 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -7,12 +7,13 @@ | |||
7 | #include <qpe/fileselector.h> | 7 | #include <qpe/fileselector.h> |
8 | #include <qpe/qpeapplication.h> | 8 | #include <qpe/qpeapplication.h> |
9 | #include <qpe/lnkproperties.h> | 9 | #include <qpe/lnkproperties.h> |
10 | #include <qpe/storage.h> | 10 | #include <qpe/storage.h> |
11 | 11 | ||
12 | #include <qpe/applnk.h> | 12 | #include <qpe/applnk.h> |
13 | #include <qpopupmenu.h> | ||
13 | #include <qpe/config.h> | 14 | #include <qpe/config.h> |
14 | #include <qpe/global.h> | 15 | #include <qpe/global.h> |
15 | #include <qpe/resource.h> | 16 | #include <qpe/resource.h> |
16 | #include <qaction.h> | 17 | #include <qaction.h> |
17 | #include <qcursor.h> | 18 | #include <qcursor.h> |
18 | #include <qimage.h> | 19 | #include <qimage.h> |
@@ -155,19 +156,25 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
155 | pmPlayList->insertSeparator(-1); | 156 | pmPlayList->insertSeparator(-1); |
156 | new MenuItem( pmPlayList, tr( "Open File or URL" ), this,SLOT( openFile() ) ); | 157 | new MenuItem( pmPlayList, tr( "Open File or URL" ), this,SLOT( openFile() ) ); |
157 | pmPlayList->insertSeparator(-1); | 158 | pmPlayList->insertSeparator(-1); |
158 | new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), this,SLOT( scanForAudio() ) ); | 159 | new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), this,SLOT( scanForAudio() ) ); |
159 | new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), this,SLOT( scanForVideo() ) ); | 160 | new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), this,SLOT( scanForVideo() ) ); |
160 | 161 | ||
161 | QPopupMenu *pmView = new QPopupMenu( this ); | 162 | |
163 | pmView = new QPopupMenu( this ); | ||
162 | menu->insertItem( tr( "View" ), pmView ); | 164 | menu->insertItem( tr( "View" ), pmView ); |
165 | pmView->isCheckable(); | ||
166 | |||
167 | pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), this, SLOT( toggleFull() ) ); | ||
163 | 168 | ||
164 | fullScreenButton = new QAction(tr("Full Screen"), Resource::loadPixmap("fullscreen"), QString::null, 0, this, 0); | 169 | Config cfg( "OpiePlayer" ); |
165 | fullScreenButton->addTo(pmView); | 170 | bool b= cfg.readBoolEntry("FullScreen", 0); |
166 | scaleButton = new QAction(tr("Scale"), Resource::loadPixmap("opieplayer/scale"), QString::null, 0, this, 0); | 171 | mediaPlayerState->setFullscreen( b ); |
167 | //scaleButton->addTo(pmView); | 172 | pmView->setItemChecked( -16, b ); |
173 | |||
174 | pmView->insertItem( Resource::loadPixmap("opieplayer/scale") , tr( "Scale"), this, SLOT(toggleScaled() ) ); | ||
168 | 175 | ||
169 | QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); | 176 | QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); |
170 | QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); | 177 | QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); |
171 | 178 | ||
172 | QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton ); | 179 | QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton ); |
173 | 180 | ||
@@ -239,14 +246,17 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
239 | LTab = new QWidget( tabWidget, "LTab" ); | 246 | LTab = new QWidget( tabWidget, "LTab" ); |
240 | playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy | 247 | playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy |
241 | playLists->setMinimumSize(233,260); | 248 | playLists->setMinimumSize(233,260); |
242 | tabWidget->insertTab(LTab,tr("Lists")); | 249 | tabWidget->insertTab(LTab,tr("Lists")); |
243 | 250 | ||
244 | connect(tbDeletePlaylist,(SIGNAL(released())),SLOT( deletePlaylist())); | 251 | connect(tbDeletePlaylist,(SIGNAL(released())),SLOT( deletePlaylist())); |
245 | connect( fullScreenButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleFullscreen()) ); | 252 | |
246 | connect( scaleButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleScaled()) ); | 253 | connect( pmView, SIGNAL( activated(int)), this, SLOT( pmViewActivated(int) ) ); |
254 | |||
255 | // connect( scaleButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleScaled() ) ); | ||
256 | |||
247 | connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 257 | connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
248 | this,SLOT( playlistViewPressed(int, QListViewItem *, const QPoint&, int)) ); | 258 | this,SLOT( playlistViewPressed(int, QListViewItem *, const QPoint&, int)) ); |
249 | connect( audioView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 259 | connect( audioView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
250 | this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); | 260 | this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); |
251 | connect( audioView, SIGNAL( returnPressed( QListViewItem *)), | 261 | connect( audioView, SIGNAL( returnPressed( QListViewItem *)), |
252 | this,SLOT( playIt( QListViewItem *)) ); | 262 | this,SLOT( playIt( QListViewItem *)) ); |
@@ -263,13 +273,12 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
263 | connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) ); | 273 | connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) ); |
264 | connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), this, SLOT( setPlaylist( bool ) ) ); | 274 | connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), this, SLOT( setPlaylist( bool ) ) ); |
265 | connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) ); | 275 | connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) ); |
266 | 276 | ||
267 | setCentralWidget( vbox5 ); | 277 | setCentralWidget( vbox5 ); |
268 | 278 | ||
269 | Config cfg( "OpiePlayer" ); | ||
270 | readConfig( cfg ); | 279 | readConfig( cfg ); |
271 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); | 280 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); |
272 | loadList(DocLnk( currentPlaylist)); | 281 | loadList(DocLnk( currentPlaylist)); |
273 | setCaption(tr("OpiePlayer: ")+ currentPlaylist ); | 282 | setCaption(tr("OpiePlayer: ")+ currentPlaylist ); |
274 | 283 | ||
275 | initializeStates(); | 284 | initializeStates(); |
@@ -1206,6 +1215,22 @@ void PlayListWidget::readPls(const QString &filename) { | |||
1206 | } | 1215 | } |
1207 | } | 1216 | } |
1208 | i++; | 1217 | i++; |
1209 | } | 1218 | } |
1210 | } | 1219 | } |
1211 | 1220 | ||
1221 | void PlayListWidget::pmViewActivated(int index) { | ||
1222 | qDebug("%d", index); | ||
1223 | switch(index) { | ||
1224 | case -16: | ||
1225 | { | ||
1226 | |||
1227 | mediaPlayerState->toggleFullscreen(); | ||
1228 | bool b=mediaPlayerState->fullscreen(); | ||
1229 | pmView->setItemChecked( index,b); | ||
1230 | Config cfg( "OpiePlayer" ); | ||
1231 | cfg.writeEntry("FullScreen", b); | ||
1232 | |||
1233 | } | ||
1234 | break; | ||
1235 | }; | ||
1236 | } | ||