-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index de36551..1a0c7ca 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -66,129 +66,129 @@ extern MediaPlayerState *mediaPlayerState; | |||
66 | class PlayListWidgetPrivate { | 66 | class PlayListWidgetPrivate { |
67 | public: | 67 | public: |
68 | QToolButton *tbPlay, *tbFull, *tbLoop, *tbScale, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove; | 68 | QToolButton *tbPlay, *tbFull, *tbLoop, *tbScale, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove; |
69 | QFrame *playListFrame; | 69 | QFrame *playListFrame; |
70 | FileSelector *files; | 70 | FileSelector *files; |
71 | PlayListSelection *selectedFiles; | 71 | PlayListSelection *selectedFiles; |
72 | bool setDocumentUsed; | 72 | bool setDocumentUsed; |
73 | DocLnk *current; | 73 | DocLnk *current; |
74 | }; | 74 | }; |
75 | 75 | ||
76 | 76 | ||
77 | class ToolButton : public QToolButton { | 77 | class ToolButton : public QToolButton { |
78 | public: | 78 | public: |
79 | ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) | 79 | ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) |
80 | : QToolButton( parent, name ) { | 80 | : QToolButton( parent, name ) { |
81 | setTextLabel( name ); | 81 | setTextLabel( name ); |
82 | setPixmap( Resource::loadPixmap( icon ) ); | 82 | setPixmap( Resource::loadPixmap( icon ) ); |
83 | setAutoRaise( TRUE ); | 83 | setAutoRaise( TRUE ); |
84 | setFocusPolicy( QWidget::NoFocus ); | 84 | setFocusPolicy( QWidget::NoFocus ); |
85 | setToggleButton( t ); | 85 | setToggleButton( t ); |
86 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); | 86 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); |
87 | QPEMenuToolFocusManager::manager()->addWidget( this ); | 87 | QPEMenuToolFocusManager::manager()->addWidget( this ); |
88 | } | 88 | } |
89 | }; | 89 | }; |
90 | 90 | ||
91 | 91 | ||
92 | class MenuItem : public QAction { | 92 | class MenuItem : public QAction { |
93 | public: | 93 | public: |
94 | MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot ) | 94 | MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot ) |
95 | : QAction( text, QString::null, 0, 0 ) { | 95 | : QAction( text, QString::null, 0, 0 ) { |
96 | connect( this, SIGNAL( activated() ), handler, slot ); | 96 | connect( this, SIGNAL( activated() ), handler, slot ); |
97 | addTo( parent ); | 97 | addTo( parent ); |
98 | } | 98 | } |
99 | }; | 99 | }; |
100 | 100 | ||
101 | 101 | ||
102 | PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | 102 | PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) |
103 | : QMainWindow( parent, name, fl ) { | 103 | : QMainWindow( parent, name, fl ) { |
104 | 104 | ||
105 | d = new PlayListWidgetPrivate; | 105 | d = new PlayListWidgetPrivate; |
106 | d->setDocumentUsed = FALSE; | 106 | d->setDocumentUsed = FALSE; |
107 | d->current = NULL; | 107 | d->current = NULL; |
108 | // menuTimer = new QTimer( this ,"menu timer"), | 108 | // menuTimer = new QTimer( this ,"menu timer"), |
109 | // connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) ); | 109 | // connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) ); |
110 | 110 | ||
111 | setBackgroundMode( PaletteButton ); | 111 | setBackgroundMode( PaletteButton ); |
112 | 112 | ||
113 | setCaption( tr("OpiePlayer") ); | 113 | setCaption( tr("OpiePlayer") ); |
114 | setIcon( Resource::loadPixmap( "MPEGPlayer" ) ); | 114 | setIcon( Resource::loadPixmap( "MPEGPlayer" ) ); |
115 | 115 | ||
116 | setToolBarsMovable( FALSE ); | 116 | setToolBarsMovable( FALSE ); |
117 | 117 | ||
118 | // Create Toolbar | 118 | // Create Toolbar |
119 | QPEToolBar *toolbar = new QPEToolBar( this ); | 119 | QPEToolBar *toolbar = new QPEToolBar( this ); |
120 | toolbar->setHorizontalStretchable( TRUE ); | 120 | toolbar->setHorizontalStretchable( TRUE ); |
121 | 121 | ||
122 | // Create Menubar | 122 | // Create Menubar |
123 | QPEMenuBar *menu = new QPEMenuBar( toolbar ); | 123 | QPEMenuBar *menu = new QPEMenuBar( toolbar ); |
124 | menu->setMargin( 0 ); | 124 | menu->setMargin( 0 ); |
125 | 125 | ||
126 | QPEToolBar *bar = new QPEToolBar( this ); | 126 | QPEToolBar *bar = new QPEToolBar( this ); |
127 | bar->setLabel( tr( "Play Operations" ) ); | 127 | bar->setLabel( tr( "Play Operations" ) ); |
128 | // d->tbPlayCurList = new ToolButton( bar, tr( "play List" ), "mpegplayer/play_current_list", | 128 | // d->tbPlayCurList = new ToolButton( bar, tr( "play List" ), "mpegplayer/play_current_list", |
129 | // this , SLOT( addSelected()) ); | 129 | // this , SLOT( addSelected()) ); |
130 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet("close"),"",bar,"close"); | 130 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet("trash"),"",bar,"close"); |
131 | tbDeletePlaylist->setFlat(TRUE); | 131 | tbDeletePlaylist->setFlat(TRUE); |
132 | tbDeletePlaylist->setFixedSize(20,20); | 132 | tbDeletePlaylist->setFixedSize(20,20); |
133 | connect(tbDeletePlaylist,(SIGNAL(released())),SLOT( deletePlaylist())); | 133 | connect(tbDeletePlaylist,(SIGNAL(released())),SLOT( deletePlaylist())); |
134 | 134 | ||
135 | d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "mpegplayer/add_to_playlist", | 135 | d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "mpegplayer/add_to_playlist", |
136 | this , SLOT(addSelected()) ); | 136 | this , SLOT(addSelected()) ); |
137 | d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "mpegplayer/remove_from_playlist", | 137 | d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "mpegplayer/remove_from_playlist", |
138 | this , SLOT(removeSelected()) ); | 138 | this , SLOT(removeSelected()) ); |
139 | // d->tbPlay = new ToolButton( bar, tr( "Play" ), "mpegplayer/play", /*this */mediaPlayerState , SLOT(setPlaying(bool) /* btnPlay() */), TRUE ); | 139 | // d->tbPlay = new ToolButton( bar, tr( "Play" ), "mpegplayer/play", /*this */mediaPlayerState , SLOT(setPlaying(bool) /* btnPlay() */), TRUE ); |
140 | d->tbPlay = new ToolButton( bar, tr( "Play" ), "mpegplayer/play", | 140 | d->tbPlay = new ToolButton( bar, tr( "Play" ), "mpegplayer/play", |
141 | this , SLOT( btnPlay(bool) ), TRUE ); | 141 | this , SLOT( btnPlay(bool) ), TRUE ); |
142 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"mpegplayer/shuffle", | 142 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"mpegplayer/shuffle", |
143 | mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); | 143 | mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); |
144 | d->tbLoop = new ToolButton( bar, tr( "Loop" ),"mpegplayer/loop", | 144 | d->tbLoop = new ToolButton( bar, tr( "Loop" ),"mpegplayer/loop", |
145 | mediaPlayerState, SLOT(setLooping(bool)), TRUE ); | 145 | mediaPlayerState, SLOT(setLooping(bool)), TRUE ); |
146 | tbDeletePlaylist->hide(); | 146 | tbDeletePlaylist->hide(); |
147 | 147 | ||
148 | QPopupMenu *pmPlayList = new QPopupMenu( this ); | 148 | QPopupMenu *pmPlayList = new QPopupMenu( this ); |
149 | menu->insertItem( tr( "File" ), pmPlayList ); | 149 | menu->insertItem( tr( "File" ), pmPlayList ); |
150 | new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); | 150 | new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); |
151 | new MenuItem( pmPlayList, tr( "Add all audio files" ), this, SLOT( addAllMusicToList() ) ); | 151 | new MenuItem( pmPlayList, tr( "Add all audio files" ), this, SLOT( addAllMusicToList() ) ); |
152 | new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) ); | 152 | new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) ); |
153 | new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) ); | 153 | new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) ); |
154 | new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) ); | 154 | new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) ); |
155 | // new MenuItem( pmPlayList, tr( "Load PlayList" ), this, SLOT( loadList() ) ); | 155 | // new MenuItem( pmPlayList, tr( "Load PlayList" ), this, SLOT( loadList() ) ); |
156 | 156 | ||
157 | QPopupMenu *pmView = new QPopupMenu( this ); | 157 | QPopupMenu *pmView = new QPopupMenu( this ); |
158 | menu->insertItem( tr( "View" ), pmView ); | 158 | menu->insertItem( tr( "View" ), pmView ); |
159 | 159 | ||
160 | fullScreenButton = new QAction(tr("Full Screen"), Resource::loadPixmap("fullscreen"), QString::null, 0, this, 0); | 160 | fullScreenButton = new QAction(tr("Full Screen"), Resource::loadPixmap("fullscreen"), QString::null, 0, this, 0); |
161 | connect( fullScreenButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleFullscreen()) ); | 161 | connect( fullScreenButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleFullscreen()) ); |
162 | fullScreenButton->addTo(pmView); | 162 | fullScreenButton->addTo(pmView); |
163 | scaleButton = new QAction(tr("Scale"), Resource::loadPixmap("mpegplayer/scale"), QString::null, 0, this, 0); | 163 | scaleButton = new QAction(tr("Scale"), Resource::loadPixmap("mpegplayer/scale"), QString::null, 0, this, 0); |
164 | connect( scaleButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleScaled()) ); | 164 | connect( scaleButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleScaled()) ); |
165 | scaleButton->addTo(pmView); | 165 | scaleButton->addTo(pmView); |
166 | 166 | ||
167 | QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); | 167 | QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); |
168 | QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); | 168 | QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); |
169 | 169 | ||
170 | QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton ); | 170 | QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton ); |
171 | 171 | ||
172 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); | 172 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); |
173 | tabWidget->setTabShape(QTabWidget::Triangular); | 173 | tabWidget->setTabShape(QTabWidget::Triangular); |
174 | 174 | ||
175 | QWidget *pTab; | 175 | QWidget *pTab; |
176 | pTab = new QWidget( tabWidget, "pTab" ); | 176 | pTab = new QWidget( tabWidget, "pTab" ); |
177 | playlistView = new QListView( pTab, "Videoview" ); | 177 | playlistView = new QListView( pTab, "Videoview" ); |
178 | playlistView->setMinimumSize(236,260); | 178 | playlistView->setMinimumSize(236,260); |
179 | tabWidget->insertTab( pTab,"Playlist"); | 179 | tabWidget->insertTab( pTab,"Playlist"); |
180 | 180 | ||
181 | // Add the playlist area | 181 | // Add the playlist area |
182 | 182 | ||
183 | QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton ); | 183 | QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton ); |
184 | d->playListFrame = vbox3; | 184 | d->playListFrame = vbox3; |
185 | d->playListFrame ->setMinimumSize(235,260); | 185 | d->playListFrame ->setMinimumSize(235,260); |
186 | 186 | ||
187 | QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton ); | 187 | QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton ); |
188 | 188 | ||
189 | d->selectedFiles = new PlayListSelection( hbox2); | 189 | d->selectedFiles = new PlayListSelection( hbox2); |
190 | QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton ); | 190 | QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton ); |
191 | 191 | ||
192 | QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch | 192 | QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch |
193 | new ToolButton( vbox1, tr( "Move Up" ), "mpegplayer/up", d->selectedFiles, SLOT(moveSelectedUp()) ); | 193 | new ToolButton( vbox1, tr( "Move Up" ), "mpegplayer/up", d->selectedFiles, SLOT(moveSelectedUp()) ); |
194 | new ToolButton( vbox1, tr( "Remove" ), "mpegplayer/cut", d->selectedFiles, SLOT(removeSelected()) ); | 194 | new ToolButton( vbox1, tr( "Remove" ), "mpegplayer/cut", d->selectedFiles, SLOT(removeSelected()) ); |