author | drw <drw> | 2005-06-15 19:44:04 (UTC) |
---|---|---|
committer | drw <drw> | 2005-06-15 19:44:04 (UTC) |
commit | 1cc97c3b70f59b90dc4bf032a14198dc8bd07f2e (patch) (side-by-side diff) | |
tree | cb873e7e3f7330368b857d8fe69826d6a9e4e68a /core/multimedia/opieplayer/playlistwidget.cpp | |
parent | dfad70bb3964d6f7142660ea4349d4af0349b46d (diff) | |
download | opie-1cc97c3b70f59b90dc4bf032a14198dc8bd07f2e.zip opie-1cc97c3b70f59b90dc4bf032a14198dc8bd07f2e.tar.gz opie-1cc97c3b70f59b90dc4bf032a14198dc8bd07f2e.tar.bz2 |
Resource -> OResource and fix doc headers
Diffstat (limited to 'core/multimedia/opieplayer/playlistwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index db2bf1b..c0a0029 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp @@ -19,27 +19,29 @@ **********************************************************************/ // code added by L. J. Potter Sat 03-02-2002 06:17:54 #define QTOPIA_INTERNAL_FSLP #include "playlistselection.h" #include "playlistwidget.h" #include "mediaplayerstate.h" #include "inputDialog.h" #include "audiowidget.h" #include "videowidget.h" /* OPIE */ +#include <qpe/qpeapplication.h> #include <qpe/qpemenubar.h> #include <qpe/lnkproperties.h> #include <opie2/odebug.h> +#include <opie2/oresource.h> /* QT */ #include <qtoolbar.h> #include <qaction.h> #include <qlayout.h> #include <qmessagebox.h> //#include <qtimer.h> /* STD */ #include <stdlib.h> #include <unistd.h> @@ -79,26 +81,27 @@ public: FileSelector *files; PlayListSelection *selectedFiles; bool setDocumentUsed; DocLnk *current; }; class ToolButton : public QToolButton { public: ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) : QToolButton( parent, name ) { setTextLabel( name ); - setPixmap( Resource::loadPixmap( icon ) ); + setPixmap( Opie::Core::OResource::loadPixmap( icon, Opie::Core::OResource::SmallIcon ) ); setAutoRaise( TRUE ); + setUsesBigPixmap( qApp->desktop()->size().width() > 330 ); setFocusPolicy( QWidget::NoFocus ); setToggleButton( t ); connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); QPEMenuToolFocusManager::manager()->addWidget( this ); } }; class MenuItem : public QAction { public: MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot ) : QAction( text, QString::null, 0, 0 ) { @@ -118,41 +121,41 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) insanityBool=FALSE; audioScan = FALSE; videoScan = FALSE; // menuTimer = new QTimer( this ,"menu timer"), // connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) ); channel = new QCopChannel( "QPE/Application/opieplayer", this ); connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), this, SLOT( qcopReceive(const QCString&,const QByteArray&)) ); setBackgroundMode( PaletteButton ); setCaption( tr("OpiePlayer") ); - setIcon( Resource::loadPixmap( "opieplayer/MPEGPlayer" ) ); + setIcon( Opie::Core::OResource::loadPixmap( "opieplayer/MPEGPlayer", Opie::Core::OResource::SmallIcon ) ); setToolBarsMovable( FALSE ); // Create Toolbar QToolBar *toolbar = new QToolBar( this ); toolbar->setHorizontalStretchable( TRUE ); // Create Menubar QMenuBar *menu = new QMenuBar( toolbar ); menu->setMargin( 0 ); QToolBar *bar = new QToolBar( this ); bar->setLabel( tr( "Play Operations" ) ); // d->tbPlayCurList = new ToolButton( bar, tr( "play List" ), "opieplayer/play_current_list", // this , SLOT( addSelected()) ); - tbDeletePlaylist = new QPushButton( Resource::loadIconSet("trash"),"",bar,"close"); + tbDeletePlaylist = new QPushButton( Opie::Core::OResource::loadPixmap("trash", Opie::Core::OResource::SmallIcon),"",bar,"close"); tbDeletePlaylist->setFlat(TRUE); tbDeletePlaylist->setFixedSize(20,20); d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "opieplayer/add_to_playlist", this , SLOT(addSelected()) ); d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "opieplayer/remove_from_playlist", this , SLOT(removeSelected()) ); // d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer/play", /*this */mediaPlayerState , SLOT(setPlaying(bool)/*btnPlay()*/), TRUE ); d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer/play", this , SLOT( btnPlay(bool) ), TRUE ); d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer/shuffle", @@ -168,27 +171,29 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) ); new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) ); pmPlayList->insertSeparator(-1); new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) ); new MenuItem( pmPlayList, tr( "Open File or URL" ), this,SLOT( openFile() ) ); pmPlayList->insertSeparator(-1); new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), this,SLOT( scanForAudio() ) ); new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), this,SLOT( scanForVideo() ) ); QPopupMenu *pmView = new QPopupMenu( this ); menu->insertItem( tr( "View" ), pmView ); - fullScreenButton = new QAction(tr("Full Screen"), Resource::loadPixmap("fullscreen"), QString::null, 0, this, 0); + fullScreenButton = new QAction(tr("Full Screen"), Opie::Core::OResource::loadPixmap("fullscreen", Opie::Core::OResource::SmallIcon), + QString::null, 0, this, 0); fullScreenButton->addTo(pmView); - scaleButton = new QAction(tr("Scale"), Resource::loadPixmap("opieplayer/scale"), QString::null, 0, this, 0); + scaleButton = new QAction(tr("Scale"), Opie::Core::OResource::loadPixmap("opieplayer/scale", Opie::Core::OResource::SmallIcon), + QString::null, 0, this, 0); scaleButton->addTo(pmView); skinsMenu = new QPopupMenu( this ); menu->insertItem( tr( "Skins" ), skinsMenu ); skinsMenu->isCheckable(); connect( skinsMenu, SIGNAL( activated(int) ) , this, SLOT( skinsMenuActivated(int) ) ); populateSkinsMenu(); QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); @@ -992,25 +997,25 @@ void PlayListWidget::populateAudioView() { } QListViewItem * newItem; if ( QFile( dit.current()->file()).exists() || dit.current()->file().left(4) == "http" ) { long size; if( dit.current()->file().left(4) == "http" ) size=0; else size = QFile( dit.current()->file() ).size(); // odebug << dit.current()->name() << oendl; newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number(size ), storage, dit.current()->file()); - newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/musicfile" )); + newItem->setPixmap(0, Opie::Core::OResource::loadPixmap( "opieplayer/musicfile", Opie::Core::OResource::SmallIcon )); } } } void PlayListWidget::populateVideoView() { videoView->clear(); StorageInfo storageInfo; const QList<FileSystem> &fs = storageInfo.fileSystems(); if(!videoScan ) scanForVideo(); @@ -1021,25 +1026,25 @@ void PlayListWidget::populateVideoView() { for ( ; Vdit.current(); ++Vdit ) { for( ; it.current(); ++it ){ const QString name = (*it)->name(); const QString path = (*it)->path(); if( Vdit.current()->file().find(path) != -1 ) storage=name; } QListViewItem * newItem; if ( QFile( Vdit.current()->file()).exists() ) { newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), QString::number( QFile( Vdit.current()->file() ).size() ), storage, Vdit.current()->file()); - newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/videofile" )); + newItem->setPixmap(0, Opie::Core::OResource::loadPixmap( "opieplayer/videofile", Opie::Core::OResource::SmallIcon )); } } } void PlayListWidget::openFile() { QString filename, name; InputDialog *fileDlg; fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); fileDlg->exec(); if( fileDlg->result() == 1 ) { filename = fileDlg->text(); // odebug << "Selected filename is " + filename << oendl; |