summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/playlistwidget.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp41
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
@@ -9,8 +9,9 @@
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>
@@ -157,15 +158,21 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
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() ) );
168
169 Config cfg( "OpiePlayer" );
170 bool b= cfg.readBoolEntry("FullScreen", 0);
171 mediaPlayerState->setFullscreen( b );
172 pmView->setItemChecked( -16, b );
163 173
164 fullScreenButton = new QAction(tr("Full Screen"), Resource::loadPixmap("fullscreen"), QString::null, 0, this, 0); 174 pmView->insertItem( Resource::loadPixmap("opieplayer/scale") , tr( "Scale"), this, SLOT(toggleScaled() ) );
165 fullScreenButton->addTo(pmView);
166 scaleButton = new QAction(tr("Scale"), Resource::loadPixmap("opieplayer/scale"), QString::null, 0, this, 0);
167 //scaleButton->addTo(pmView);
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
@@ -241,10 +248,13 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
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()) ); 253connect( 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)) );
@@ -265,9 +275,8 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
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 );
@@ -1208,4 +1217,20 @@ void PlayListWidget::readPls(const QString &filename) {
1208 i++; 1217 i++;
1209 } 1218 }
1210} 1219}
1211 1220
1221void PlayListWidget::pmViewActivated(int index) {
1222qDebug("%d", index);
1223switch(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}