author | llornkcor <llornkcor> | 2002-08-17 14:35:43 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-08-17 14:35:43 (UTC) |
commit | d9311a2086108b6880bcb17d7317c629068d5e6c (patch) (unidiff) | |
tree | b8ce0876c6842efaa09b070c9db5297d3e3737f4 | |
parent | 313a4f44a645a0b58855ac18cdbf7642fe93a753 (diff) | |
download | opie-d9311a2086108b6880bcb17d7317c629068d5e6c.zip opie-d9311a2086108b6880bcb17d7317c629068d5e6c.tar.gz opie-d9311a2086108b6880bcb17d7317c629068d5e6c.tar.bz2 |
changed to better layout
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 0cfd720..0c3ea74 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -159,108 +159,136 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
159 | pmView->setItemChecked( -16, b ); | 159 | pmView->setItemChecked( -16, b ); |
160 | 160 | ||
161 | // pmView->insertItem( Resource::loadPixmap("opieplayer/scale") , tr( "Scale"), mediaPlayerState, SLOT(toggleScaled() ) ); | 161 | // pmView->insertItem( Resource::loadPixmap("opieplayer/scale") , tr( "Scale"), mediaPlayerState, SLOT(toggleScaled() ) ); |
162 | 162 | ||
163 | pmView->insertSeparator(-1); | 163 | pmView->insertSeparator(-1); |
164 | 164 | ||
165 | skinsMenu = new QPopupMenu( this ); | 165 | skinsMenu = new QPopupMenu( this ); |
166 | pmView->insertItem( tr( "Skins" ), skinsMenu ); | 166 | pmView->insertItem( tr( "Skins" ), skinsMenu ); |
167 | skinsMenu->isCheckable(); | 167 | skinsMenu->isCheckable(); |
168 | populateSkinsMenu(); | 168 | populateSkinsMenu(); |
169 | 169 | ||
170 | QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); | 170 | QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); |
171 | QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); | 171 | QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); |
172 | 172 | ||
173 | QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton ); | 173 | QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton ); |
174 | 174 | ||
175 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); | 175 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); |
176 | // tabWidget->setTabShape(QTabWidget::Triangular); | 176 | // tabWidget->setTabShape(QTabWidget::Triangular); |
177 | 177 | ||
178 | QWidget *pTab; | 178 | QWidget *pTab; |
179 | pTab = new QWidget( tabWidget, "pTab" ); | 179 | pTab = new QWidget( tabWidget, "pTab" ); |
180 | tabWidget->insertTab( pTab,"Playlist"); | 180 | tabWidget->insertTab( pTab,"Playlist"); |
181 | 181 | ||
182 | 182 | ||
183 | QGridLayout *Playout = new QGridLayout( pTab ); | ||
184 | Playout->setSpacing( 2); | ||
185 | Playout->setMargin( 2); | ||
186 | |||
183 | // Add the playlist area | 187 | // Add the playlist area |
184 | 188 | ||
185 | QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton ); | 189 | QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton ); |
186 | d->playListFrame = vbox3; | 190 | d->playListFrame = vbox3; |
187 | d->playListFrame ->setMinimumSize(235,250); | ||
188 | 191 | ||
189 | QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton ); | 192 | QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton ); |
190 | 193 | ||
191 | d->selectedFiles = new PlayListSelection( hbox2); | 194 | d->selectedFiles = new PlayListSelection( hbox2); |
192 | QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton ); | 195 | QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton ); |
193 | 196 | ||
194 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold); | 197 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold); |
195 | 198 | ||
196 | QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch | 199 | QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch |
197 | new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", d->selectedFiles, SLOT(moveSelectedUp()) ); | 200 | new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", d->selectedFiles, SLOT(moveSelectedUp()) ); |
198 | new ToolButton( vbox1, tr( "Remove" ), "opieplayer2/cut", d->selectedFiles, SLOT(removeSelected()) ); | 201 | new ToolButton( vbox1, tr( "Remove" ), "opieplayer2/cut", d->selectedFiles, SLOT(removeSelected()) ); |
199 | new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down", d->selectedFiles, SLOT(moveSelectedDown()) ); | 202 | new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down", d->selectedFiles, SLOT(moveSelectedDown()) ); |
200 | QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch | 203 | QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch |
201 | 204 | ||
205 | |||
206 | Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); | ||
207 | |||
202 | QWidget *aTab; | 208 | QWidget *aTab; |
203 | aTab = new QWidget( tabWidget, "aTab" ); | 209 | aTab = new QWidget( tabWidget, "aTab" ); |
210 | |||
211 | QGridLayout *Alayout = new QGridLayout( aTab ); | ||
212 | Alayout->setSpacing( 2); | ||
213 | Alayout->setMargin( 2); | ||
214 | |||
204 | audioView = new QListView( aTab, "Audioview" ); | 215 | audioView = new QListView( aTab, "Audioview" ); |
205 | audioView->setMinimumSize(233,250); | ||
206 | audioView->addColumn( tr("Title"),140); | 216 | audioView->addColumn( tr("Title"),140); |
207 | audioView->addColumn(tr("Size"), -1); | 217 | audioView->addColumn(tr("Size"), -1); |
208 | audioView->addColumn(tr("Media"),-1); | 218 | audioView->addColumn(tr("Media"),-1); |
209 | audioView->setColumnAlignment(1, Qt::AlignRight); | 219 | audioView->setColumnAlignment(1, Qt::AlignRight); |
210 | audioView->setColumnAlignment(2, Qt::AlignRight); | 220 | audioView->setColumnAlignment(2, Qt::AlignRight); |
211 | audioView->setAllColumnsShowFocus(TRUE); | 221 | audioView->setAllColumnsShowFocus(TRUE); |
212 | 222 | ||
213 | audioView->setMultiSelection( TRUE ); | 223 | audioView->setMultiSelection( TRUE ); |
214 | audioView->setSelectionMode( QListView::Extended); | 224 | audioView->setSelectionMode( QListView::Extended); |
215 | 225 | ||
226 | Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); | ||
227 | |||
216 | tabWidget->insertTab(aTab,tr("Audio")); | 228 | tabWidget->insertTab(aTab,tr("Audio")); |
217 | 229 | ||
218 | QPEApplication::setStylusOperation( audioView->viewport(),QPEApplication::RightOnHold); | 230 | QPEApplication::setStylusOperation( audioView->viewport(),QPEApplication::RightOnHold); |
219 | 231 | ||
220 | QWidget *vTab; | 232 | QWidget *vTab; |
221 | vTab = new QWidget( tabWidget, "vTab" ); | 233 | vTab = new QWidget( tabWidget, "vTab" ); |
234 | |||
235 | QGridLayout *Vlayout = new QGridLayout( vTab ); | ||
236 | Vlayout->setSpacing( 2); | ||
237 | Vlayout->setMargin( 2); | ||
238 | |||
222 | videoView = new QListView( vTab, "Videoview" ); | 239 | videoView = new QListView( vTab, "Videoview" ); |
223 | videoView->setMinimumSize(233,250); | ||
224 | 240 | ||
225 | videoView->addColumn(tr("Title"),140); | 241 | videoView->addColumn(tr("Title"),140); |
226 | videoView->addColumn(tr("Size"),-1); | 242 | videoView->addColumn(tr("Size"),-1); |
227 | videoView->addColumn(tr("Media"),-1); | 243 | videoView->addColumn(tr("Media"),-1); |
228 | videoView->setColumnAlignment(1, Qt::AlignRight); | 244 | videoView->setColumnAlignment(1, Qt::AlignRight); |
229 | videoView->setColumnAlignment(2, Qt::AlignRight); | 245 | videoView->setColumnAlignment(2, Qt::AlignRight); |
230 | videoView->setAllColumnsShowFocus(TRUE); | 246 | videoView->setAllColumnsShowFocus(TRUE); |
231 | videoView->setMultiSelection( TRUE ); | 247 | videoView->setMultiSelection( TRUE ); |
232 | videoView->setSelectionMode( QListView::Extended); | 248 | videoView->setSelectionMode( QListView::Extended); |
233 | 249 | ||
250 | // d->playListFrame->setMaximumSize(235,240); | ||
251 | // audioView->setMaximumSize(233,240); | ||
252 | // videoView->setMaximumSize(233,240); | ||
253 | |||
254 | Vlayout->addMultiCellWidget( videoView, 0, 0, 0, 1 ); | ||
255 | |||
234 | QPEApplication::setStylusOperation( videoView->viewport(),QPEApplication::RightOnHold); | 256 | QPEApplication::setStylusOperation( videoView->viewport(),QPEApplication::RightOnHold); |
235 | 257 | ||
236 | tabWidget->insertTab( vTab,tr("Video")); | 258 | tabWidget->insertTab( vTab,tr("Video")); |
237 | 259 | ||
238 | //playlists list | 260 | //playlists list |
239 | QWidget *LTab; | 261 | QWidget *LTab; |
240 | LTab = new QWidget( tabWidget, "LTab" ); | 262 | LTab = new QWidget( tabWidget, "LTab" ); |
263 | QGridLayout *Llayout = new QGridLayout( LTab ); | ||
264 | Llayout->setSpacing( 2); | ||
265 | Llayout->setMargin( 2); | ||
266 | |||
241 | playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy | 267 | playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy |
242 | playLists->setMinimumSize(233,260); | 268 | // playLists->setMinimumSize(233,260); |
269 | Llayout->addMultiCellWidget( playLists, 0, 0, 0, 1 ); | ||
270 | |||
243 | tabWidget->insertTab(LTab,tr("Lists")); | 271 | tabWidget->insertTab(LTab,tr("Lists")); |
244 | 272 | ||
245 | connect(tbDeletePlaylist,(SIGNAL(released())),SLOT( deletePlaylist())); | 273 | connect(tbDeletePlaylist,(SIGNAL(released())),SLOT( deletePlaylist())); |
246 | 274 | ||
247 | connect( pmView, SIGNAL( activated(int)), this, SLOT( pmViewActivated(int) ) ); | 275 | connect( pmView, SIGNAL( activated(int)), this, SLOT( pmViewActivated(int) ) ); |
248 | 276 | ||
249 | connect( skinsMenu, SIGNAL( activated(int)), this, SLOT(skinsMenuActivated(int) ) ); | 277 | connect( skinsMenu, SIGNAL( activated(int)), this, SLOT(skinsMenuActivated(int) ) ); |
250 | 278 | ||
251 | // connect( scaleButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleScaled() ) ); | 279 | // connect( scaleButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleScaled() ) ); |
252 | 280 | ||
253 | connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 281 | connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
254 | this,SLOT( playlistViewPressed(int, QListViewItem *, const QPoint&, int)) ); | 282 | this,SLOT( playlistViewPressed(int, QListViewItem *, const QPoint&, int)) ); |
255 | connect( audioView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 283 | connect( audioView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
256 | this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); | 284 | this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); |
257 | connect( audioView, SIGNAL( returnPressed( QListViewItem *)), | 285 | connect( audioView, SIGNAL( returnPressed( QListViewItem *)), |
258 | this,SLOT( playIt( QListViewItem *)) ); | 286 | this,SLOT( playIt( QListViewItem *)) ); |
259 | connect( audioView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); | 287 | connect( audioView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); |
260 | connect( videoView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 288 | connect( videoView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
261 | this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); | 289 | this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); |
262 | connect( videoView, SIGNAL( returnPressed( QListViewItem *)), | 290 | connect( videoView, SIGNAL( returnPressed( QListViewItem *)), |
263 | this,SLOT( playIt( QListViewItem *)) ); | 291 | this,SLOT( playIt( QListViewItem *)) ); |
264 | connect( videoView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); | 292 | connect( videoView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); |
265 | connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( loadList( const DocLnk & ) ) ); | 293 | connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( loadList( const DocLnk & ) ) ); |
266 | connect( tabWidget, SIGNAL (currentChanged(QWidget*)),this,SLOT(tabChanged(QWidget*))); | 294 | connect( tabWidget, SIGNAL (currentChanged(QWidget*)),this,SLOT(tabChanged(QWidget*))); |
@@ -655,50 +683,49 @@ void PlayListWidget::addSelected() { | |||
655 | // iterate through all items of the listview | 683 | // iterate through all items of the listview |
656 | for ( ; it.current(); ++it ) { | 684 | for ( ; it.current(); ++it ) { |
657 | if ( it.current()->isSelected() ) { | 685 | if ( it.current()->isSelected() ) { |
658 | QListIterator<DocLnk> dit( vFiles.children() ); | 686 | QListIterator<DocLnk> dit( vFiles.children() ); |
659 | for ( ; dit.current(); ++dit ) { | 687 | for ( ; dit.current(); ++dit ) { |
660 | if( dit.current()->name() == it.current()->text(0) ) { | 688 | if( dit.current()->name() == it.current()->text(0) ) { |
661 | if(QFileInfo( dit.current()->file()).exists()) | 689 | if(QFileInfo( dit.current()->file()).exists()) |
662 | d->selectedFiles->addToSelection( **dit ); | 690 | d->selectedFiles->addToSelection( **dit ); |
663 | } | 691 | } |
664 | } | 692 | } |
665 | videoView->setSelected( it.current(),FALSE); | 693 | videoView->setSelected( it.current(),FALSE); |
666 | } | 694 | } |
667 | } | 695 | } |
668 | tabWidget->setCurrentPage(0); | 696 | tabWidget->setCurrentPage(0); |
669 | } | 697 | } |
670 | break; | 698 | break; |
671 | }; | 699 | }; |
672 | } | 700 | } |
673 | 701 | ||
674 | void PlayListWidget::removeSelected() { | 702 | void PlayListWidget::removeSelected() { |
675 | d->selectedFiles->removeSelected( ); | 703 | d->selectedFiles->removeSelected( ); |
676 | } | 704 | } |
677 | 705 | ||
678 | void PlayListWidget::playIt( QListViewItem *it) { | 706 | void PlayListWidget::playIt( QListViewItem *it) { |
679 | // if(it==NULL) return; | 707 | if(!it) return; |
680 | qDebug("playIt"); | ||
681 | mediaPlayerState->setPlaying(FALSE); | 708 | mediaPlayerState->setPlaying(FALSE); |
682 | mediaPlayerState->setPlaying(TRUE); | 709 | mediaPlayerState->setPlaying(TRUE); |
683 | d->selectedFiles->unSelect(); | 710 | d->selectedFiles->unSelect(); |
684 | } | 711 | } |
685 | 712 | ||
686 | void PlayListWidget::addToSelection( QListViewItem *it) { | 713 | void PlayListWidget::addToSelection( QListViewItem *it) { |
687 | d->setDocumentUsed = FALSE; | 714 | d->setDocumentUsed = FALSE; |
688 | 715 | ||
689 | if(it) { | 716 | if(it) { |
690 | switch (tabWidget->currentPageIndex()) { | 717 | switch (tabWidget->currentPageIndex()) { |
691 | case 1: { | 718 | case 1: { |
692 | QListIterator<DocLnk> dit( files.children() ); | 719 | QListIterator<DocLnk> dit( files.children() ); |
693 | for ( ; dit.current(); ++dit ) { | 720 | for ( ; dit.current(); ++dit ) { |
694 | if( dit.current()->name() == it->text(0)) { | 721 | if( dit.current()->name() == it->text(0)) { |
695 | if(QFileInfo( dit.current()->file()).exists()) | 722 | if(QFileInfo( dit.current()->file()).exists()) |
696 | d->selectedFiles->addToSelection( **dit ); | 723 | d->selectedFiles->addToSelection( **dit ); |
697 | } | 724 | } |
698 | } | 725 | } |
699 | } | 726 | } |
700 | break; | 727 | break; |
701 | case 2: { | 728 | case 2: { |
702 | QListIterator<DocLnk> dit( vFiles.children() ); | 729 | QListIterator<DocLnk> dit( vFiles.children() ); |
703 | for ( ; dit.current(); ++dit ) { | 730 | for ( ; dit.current(); ++dit ) { |
704 | if( dit.current()->name() == it->text(0)) { | 731 | if( dit.current()->name() == it->text(0)) { |