summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/playlistwidget.cpp
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/playlistwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp35
1 files changed, 26 insertions, 9 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index 8b295b0..bffda38 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -158,24 +158,25 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
158 toolbar->setHorizontalStretchable( TRUE ); 158 toolbar->setHorizontalStretchable( TRUE );
159 159
160 // Create Menubar 160 // Create Menubar
161 QPEMenuBar *menu = new QPEMenuBar( toolbar ); 161 QPEMenuBar *menu = new QPEMenuBar( toolbar );
162 menu->setMargin( 0 ); 162 menu->setMargin( 0 );
163 163
164 QPEToolBar *bar = new QPEToolBar( this ); 164 QPEToolBar *bar = new QPEToolBar( this );
165 bar->setLabel( tr( "Play Operations" ) ); 165 bar->setLabel( tr( "Play Operations" ) );
166// d->tbPlayCurList = new ToolButton( bar, tr( "play List" ), "opieplayer/play_current_list", 166// d->tbPlayCurList = new ToolButton( bar, tr( "play List" ), "opieplayer/play_current_list",
167// this , SLOT( addSelected()) ); 167// this , SLOT( addSelected()) );
168 tbDeletePlaylist = new QPushButton( Resource::loadIconSet("trash"),"",bar,"close"); 168 tbDeletePlaylist = new QPushButton( Resource::loadIconSet("trash"),"",bar,"close");
169 tbDeletePlaylist->setFlat(TRUE); 169 tbDeletePlaylist->setFlat(TRUE);
170
170 tbDeletePlaylist->setFixedSize(20,20); 171 tbDeletePlaylist->setFixedSize(20,20);
171 172
172 d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "opieplayer/add_to_playlist", 173 d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "opieplayer/add_to_playlist",
173 this , SLOT(addSelected()) ); 174 this , SLOT(addSelected()) );
174 d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "opieplayer/remove_from_playlist", 175 d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "opieplayer/remove_from_playlist",
175 this , SLOT(removeSelected()) ); 176 this , SLOT(removeSelected()) );
176// d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer/play", /*this */mediaPlayerState , SLOT(setPlaying(bool) /* btnPlay() */), TRUE ); 177// d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer/play", /*this */mediaPlayerState , SLOT(setPlaying(bool) /* btnPlay() */), TRUE );
177 d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer/play", 178 d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer/play",
178 this , SLOT( btnPlay(bool) ), TRUE ); 179 this , SLOT( btnPlay(bool) ), TRUE );
179 d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer/shuffle", 180 d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer/shuffle",
180 mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); 181 mediaPlayerState, SLOT(setShuffled(bool)), TRUE );
181 d->tbLoop = new ToolButton( bar, tr( "Loop" ),"opieplayer/loop", 182 d->tbLoop = new ToolButton( bar, tr( "Loop" ),"opieplayer/loop",
@@ -218,92 +219,112 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
218 219
219 tabWidget = new QTabWidget( hbox6, "tabWidget" ); 220 tabWidget = new QTabWidget( hbox6, "tabWidget" );
220// tabWidget->setTabShape(QTabWidget::Triangular); 221// tabWidget->setTabShape(QTabWidget::Triangular);
221 222
222 QWidget *pTab; 223 QWidget *pTab;
223 pTab = new QWidget( tabWidget, "pTab" ); 224 pTab = new QWidget( tabWidget, "pTab" );
224// playlistView = new QListView( pTab, "playlistview" ); 225// playlistView = new QListView( pTab, "playlistview" );
225// playlistView->setMinimumSize(236,260); 226// playlistView->setMinimumSize(236,260);
226 tabWidget->insertTab( pTab,"Playlist"); 227 tabWidget->insertTab( pTab,"Playlist");
227 228
228 229
229 // Add the playlist area 230 // Add the playlist area
230 231
231 QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton ); 232 QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton );
232 d->playListFrame = vbox3; 233 d->playListFrame = vbox3;
233 d->playListFrame ->setMinimumSize(235,260); 234
235 QGridLayout *layoutF = new QGridLayout( pTab );
236 layoutF->setSpacing( 2);
237 layoutF->setMargin( 2);
238 layoutF->addMultiCellWidget( d->playListFrame , 0, 0, 0, 1 );
239// d->playListFrame ->setMinimumSize(235,260);
234 240
235 QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton ); 241 QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton );
236 242
237 d->selectedFiles = new PlayListSelection( hbox2); 243 d->selectedFiles = new PlayListSelection( hbox2);
238 QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton ); 244 QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton );
239 245
240 QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold); 246 QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold);
241 247
242 248
243 249
244 QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch 250 QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch
245 new ToolButton( vbox1, tr( "Move Up" ), "opieplayer/up", d->selectedFiles, SLOT(moveSelectedUp()) ); 251 new ToolButton( vbox1, tr( "Move Up" ), "opieplayer/up", d->selectedFiles, SLOT(moveSelectedUp()) );
246 new ToolButton( vbox1, tr( "Remove" ), "opieplayer/cut", d->selectedFiles, SLOT(removeSelected()) ); 252 new ToolButton( vbox1, tr( "Remove" ), "opieplayer/cut", d->selectedFiles, SLOT(removeSelected()) );
247 new ToolButton( vbox1, tr( "Move Down" ), "opieplayer/down", d->selectedFiles, SLOT(moveSelectedDown()) ); 253 new ToolButton( vbox1, tr( "Move Down" ), "opieplayer/down", d->selectedFiles, SLOT(moveSelectedDown()) );
248 QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch 254 QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch
249 255
250 QWidget *aTab; 256 QWidget *aTab;
251 aTab = new QWidget( tabWidget, "aTab" ); 257 aTab = new QWidget( tabWidget, "aTab" );
252 audioView = new QListView( aTab, "Audioview" ); 258 audioView = new QListView( aTab, "Audioview" );
253 audioView->setMinimumSize(233,260); 259
260 QGridLayout *layoutA = new QGridLayout( aTab );
261 layoutA->setSpacing( 2);
262 layoutA->setMargin( 2);
263 layoutA->addMultiCellWidget( audioView, 0, 0, 0, 1 );
264
254 audioView->addColumn( tr("Title"),140); 265 audioView->addColumn( tr("Title"),140);
255 audioView->addColumn(tr("Size"), -1); 266 audioView->addColumn(tr("Size"), -1);
256 audioView->addColumn(tr("Media"),-1); 267 audioView->addColumn(tr("Media"),-1);
257 audioView->addColumn( tr( "Path" ), 0 ); 268 audioView->addColumn( tr( "Path" ), 0 );
258 269
259 audioView->setColumnAlignment(1, Qt::AlignRight); 270 audioView->setColumnAlignment(1, Qt::AlignRight);
260 audioView->setColumnAlignment(2, Qt::AlignRight); 271 audioView->setColumnAlignment(2, Qt::AlignRight);
261 audioView->setAllColumnsShowFocus(TRUE); 272 audioView->setAllColumnsShowFocus(TRUE);
262 273
263 audioView->setMultiSelection( TRUE ); 274 audioView->setMultiSelection( TRUE );
264 audioView->setSelectionMode( QListView::Extended); 275 audioView->setSelectionMode( QListView::Extended);
265 audioView->setSorting( 3, TRUE ); 276 audioView->setSorting( 3, TRUE );
266 277
267 tabWidget->insertTab(aTab,tr("Audio")); 278 tabWidget->insertTab(aTab,tr("Audio"));
268 279
269 QPEApplication::setStylusOperation( audioView->viewport(),QPEApplication::RightOnHold); 280 QPEApplication::setStylusOperation( audioView->viewport(),QPEApplication::RightOnHold);
270 281
271// audioView 282// audioView
272// populateAudioView(); 283// populateAudioView();
273// videowidget 284// videowidget
274 285
275 QWidget *vTab; 286 QWidget *vTab;
276 vTab = new QWidget( tabWidget, "vTab" ); 287 vTab = new QWidget( tabWidget, "vTab" );
277 videoView = new QListView( vTab, "Videoview" ); 288 videoView = new QListView( vTab, "Videoview" );
278 videoView->setMinimumSize(233,260); 289
290 QGridLayout *layoutV = new QGridLayout( vTab );
291 layoutV->setSpacing( 2);
292 layoutV->setMargin( 2);
293 layoutV->addMultiCellWidget( videoView, 0, 0, 0, 1 );
279 294
280 videoView->addColumn(tr("Title"),140); 295 videoView->addColumn(tr("Title"),140);
281 videoView->addColumn(tr("Size"),-1); 296 videoView->addColumn(tr("Size"),-1);
282 videoView->addColumn(tr("Media"),-1); 297 videoView->addColumn(tr("Media"),-1);
283 videoView->addColumn(tr( "Path" ), 0 ); 298 videoView->addColumn(tr( "Path" ), 0 );
284 videoView->setColumnAlignment(1, Qt::AlignRight); 299 videoView->setColumnAlignment(1, Qt::AlignRight);
285 videoView->setColumnAlignment(2, Qt::AlignRight); 300 videoView->setColumnAlignment(2, Qt::AlignRight);
286 videoView->setAllColumnsShowFocus(TRUE); 301 videoView->setAllColumnsShowFocus(TRUE);
287 videoView->setMultiSelection( TRUE ); 302 videoView->setMultiSelection( TRUE );
288 videoView->setSelectionMode( QListView::Extended); 303 videoView->setSelectionMode( QListView::Extended);
289 304
290 QPEApplication::setStylusOperation( videoView->viewport(),QPEApplication::RightOnHold); 305 QPEApplication::setStylusOperation( videoView->viewport(),QPEApplication::RightOnHold);
291 306
292 tabWidget->insertTab( vTab,tr("Video")); 307 tabWidget->insertTab( vTab,tr("Video"));
293 308
294 QWidget *LTab; 309 QWidget *LTab;
295 LTab = new QWidget( tabWidget, "LTab" ); 310 LTab = new QWidget( tabWidget, "LTab" );
296 playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy 311 playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy
297 playLists->setMinimumSize(233,260); 312
313 QGridLayout *layoutL = new QGridLayout( LTab );
314 layoutL->setSpacing( 2);
315 layoutL->setMargin( 2);
316 layoutL->addMultiCellWidget( playLists, 0, 0, 0, 1 );
317// playLists->setMinimumSize(233,260);
318
298 tabWidget->insertTab(LTab,tr("Lists")); 319 tabWidget->insertTab(LTab,tr("Lists"));
299 320
300 connect(tbDeletePlaylist,(SIGNAL(released())),SLOT( deletePlaylist())); 321 connect(tbDeletePlaylist,(SIGNAL(released())),SLOT( deletePlaylist()));
301 connect( fullScreenButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleFullscreen()) ); 322 connect( fullScreenButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleFullscreen()) );
302 connect( scaleButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleScaled()) ); 323 connect( scaleButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleScaled()) );
303 324
304 connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 325 connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
305 this,SLOT( playlistViewPressed(int, QListViewItem *, const QPoint&, int)) ); 326 this,SLOT( playlistViewPressed(int, QListViewItem *, const QPoint&, int)) );
306 327
307 328
308///audioView 329///audioView
309 connect( audioView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 330 connect( audioView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
@@ -312,35 +333,31 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
312 connect( audioView, SIGNAL( returnPressed( QListViewItem *)), 333 connect( audioView, SIGNAL( returnPressed( QListViewItem *)),
313 this,SLOT( playIt( QListViewItem *)) ); 334 this,SLOT( playIt( QListViewItem *)) );
314 connect( audioView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); 335 connect( audioView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) );
315 336
316 337
317//videoView 338//videoView
318 connect( videoView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 339 connect( videoView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
319 this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); 340 this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) );
320 connect( videoView, SIGNAL( returnPressed( QListViewItem *)), 341 connect( videoView, SIGNAL( returnPressed( QListViewItem *)),
321 this,SLOT( playIt( QListViewItem *)) ); 342 this,SLOT( playIt( QListViewItem *)) );
322 connect( videoView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); 343 connect( videoView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) );
323 344
324
325//playlists 345//playlists
326 connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( loadList( const DocLnk & ) ) ); 346 connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( loadList( const DocLnk & ) ) );
327 347
328
329 connect( tabWidget, SIGNAL (currentChanged(QWidget*)),this,SLOT(tabChanged(QWidget*))); 348 connect( tabWidget, SIGNAL (currentChanged(QWidget*)),this,SLOT(tabChanged(QWidget*)));
330 349
331 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), d->tbPlay, SLOT( setOn( bool ) ) ); 350 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), d->tbPlay, SLOT( setOn( bool ) ) );
332 351
333
334
335 connect( mediaPlayerState, SIGNAL( loopingToggled( bool ) ), d->tbLoop, SLOT( setOn( bool ) ) ); 352 connect( mediaPlayerState, SIGNAL( loopingToggled( bool ) ), d->tbLoop, SLOT( setOn( bool ) ) );
336 connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) ); 353 connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) );
337 connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), this, SLOT( setPlaylist( bool ) ) ); 354 connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), this, SLOT( setPlaylist( bool ) ) );
338 355
339 connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) ); 356 connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) );
340 357
341 setCentralWidget( vbox5 ); 358 setCentralWidget( vbox5 );
342 359
343 Config cfg( "OpiePlayer" ); 360 Config cfg( "OpiePlayer" );
344 readConfig( cfg ); 361 readConfig( cfg );
345 QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default"); 362 QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default");
346 loadList(DocLnk( currentPlaylist)); 363 loadList(DocLnk( currentPlaylist));