Diffstat (limited to 'core/multimedia/opieplayer/playlistwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 4e1543e..269aed8 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp @@ -30,25 +30,25 @@ #include <qimage.h> #include <qfile.h> #include <qlayout.h> #include <qlabel.h> #include <qlist.h> #include <qlistbox.h> #include <qmainwindow.h> #include <qmessagebox.h> #include <qtoolbutton.h> #include <qtabwidget.h> #include <qlistview.h> #include <qpoint.h> -#include <qtimer.h> +//#include <qtimer.h> #include "playlistselection.h" #include "playlistwidget.h" #include "mediaplayerstate.h" #include <stdlib.h> #define BUTTONS_ON_TOOLBAR #define SIDE_BUTTONS #define CAN_SAVE_LOAD_PLAYLISTS extern MediaPlayerState *mediaPlayerState; @@ -89,26 +89,26 @@ public: connect( this, SIGNAL( activated() ), handler, slot ); addTo( parent ); } }; PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) : QMainWindow( parent, name, fl ) { d = new PlayListWidgetPrivate; d->setDocumentUsed = FALSE; d->current = NULL; - menuTimer = new QTimer( this ,"menu timer"), - connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) ); +// menuTimer = new QTimer( this ,"menu timer"), +// connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) ); setBackgroundMode( PaletteButton ); setCaption( tr("OpiePlayer") ); setIcon( Resource::loadPixmap( "MPEGPlayer" ) ); setToolBarsMovable( FALSE ); // Create Toolbar QPEToolBar *toolbar = new QPEToolBar( this ); toolbar->setHorizontalStretchable( TRUE ); @@ -195,55 +195,60 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) audioView->addColumn("Size", 45); audioView->addColumn("Media",35); audioView->setColumnAlignment(1, Qt::AlignRight); audioView->setColumnAlignment(2, Qt::AlignRight); tabWidget->insertTab(aTab,"Audio"); // audioView Global::findDocuments(&files, "audio/*"); QListIterator<DocLnk> dit( files.children() ); QString storage; for ( ; dit.current(); ++dit ) { QListViewItem * newItem; if(dit.current()->file().find("/mnt/cf") != -1 ) storage="CF"; + else if(dit.current()->file().find("/mnt/hda") != -1 ) storage="CF"; else if(dit.current()->file().find("/mnt/card") != -1 ) storage="SD"; else storage="RAM"; - + if ( QFile( dit.current()->file()).exists() ) { newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number( QFile( dit.current()->file()).size() ), storage); newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/musicfile" )); } + } // videowidget QWidget *vTab; vTab = new QWidget( tabWidget, "vTab" ); videoView = new QListView( vTab, "Videoview" ); videoView->setMinimumSize(233,260); videoView->addColumn("Title",150); videoView->addColumn("Size",45); videoView->addColumn("Media",35); videoView->setColumnAlignment(1, Qt::AlignRight); videoView->setColumnAlignment(2, Qt::AlignRight); tabWidget->insertTab( vTab,"Video"); Global::findDocuments(&vFiles, "video/*"); QListIterator<DocLnk> Vdit( vFiles.children() ); for ( ; Vdit.current(); ++Vdit ) { if( Vdit.current()->file().find("/mnt/cf") != -1 ) storage="CF"; + else if( Vdit.current()->file().find("/mnt/hda") != -1 ) storage="CF"; else if( Vdit.current()->file().find("/mnt/card") != -1 ) storage="SD"; else storage="RAM"; QListViewItem * newItem; + if ( QFile( Vdit.current()->file()).exists() ) { newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), QString::number( QFile( Vdit.current()->file()).size() ), storage); newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/videofile" )); } + } // d->tbPlay = new ToolButton( vbox1, tr( "Play" ), "mpegplayer/play", mediaPlayerState, SLOT(setPlaying(bool)), TRUE ); // d->tbShuffle = new ToolButton( vbox1, tr( "Randomize" ), "mpegplayer/shuffle", mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); // add the library area // d->files->setBackgroundMode( PaletteButton ); // QVBox *vbox7 = new QVBox( hbox6 ); vbox7->setBackgroundMode( PaletteButton ); // #ifdef SIDE_BUTTONS // QVBox *stretch3 = new QVBox( vbox1 ); stretch3->setBackgroundMode( PaletteButton ); // add stretch @@ -654,40 +659,40 @@ void PlayListWidget::tabChanged(QWidget *widg) { d->tbAddToList->setEnabled(TRUE); } break; case 2: { d->tbRemoveFromList->setEnabled(FALSE); d->tbAddToList->setEnabled(TRUE); } break; }; } -void PlayListWidget::cancelMenuTimer() { - if( menuTimer->isActive() ) - menuTimer->stop(); -} +// void PlayListWidget::cancelMenuTimer() { +// if( menuTimer->isActive() ) +// menuTimer->stop(); +// } -void PlayListWidget::showFileMenu() { +// void PlayListWidget::showFileMenu() { -} +// } -void PlayListWidget::contentsMousePressEvent( QMouseEvent * e ) -{ -// QListView::contentsMousePressEvent( e ); - menuTimer->start( 750, TRUE ); -} +// void PlayListWidget::contentsMousePressEvent( QMouseEvent * e ) +// { +// // QListView::contentsMousePressEvent( e ); +// menuTimer->start( 750, TRUE ); +// } -void PlayListWidget::contentsMouseReleaseEvent( QMouseEvent * e ) -{ -// QListView::contentsMouseReleaseEvent( e ); - menuTimer->stop(); -} -// void PlayListWidget::setFullScreen() { +// void PlayListWidget::contentsMouseReleaseEvent( QMouseEvent * e ) +// { +// // QListView::contentsMouseReleaseEvent( e ); +// menuTimer->stop(); +// } +// // void PlayListWidget::setFullScreen() { // mediaPlayerState->toggleFullscreen( ); // } // void PlayListWidget::setScaled() { // mediaPlayerState->toggleScaled(); // } |