-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp index 49356d3..5d9fb5d 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | |||
@@ -45,133 +45,135 @@ | |||
45 | #include <qaction.h> | 45 | #include <qaction.h> |
46 | #include <qcursor.h> | 46 | #include <qcursor.h> |
47 | #include <qdir.h> | 47 | #include <qdir.h> |
48 | #include <qlayout.h> | 48 | #include <qlayout.h> |
49 | 49 | ||
50 | #include "playlistselection.h" | 50 | #include "playlistselection.h" |
51 | #include "playlistwidget.h" | 51 | #include "playlistwidget.h" |
52 | #include "mediaplayerstate.h" | 52 | #include "mediaplayerstate.h" |
53 | #include "inputDialog.h" | 53 | #include "inputDialog.h" |
54 | 54 | ||
55 | //only needed for the random play | 55 | //only needed for the random play |
56 | #include <stdlib.h> | 56 | #include <stdlib.h> |
57 | 57 | ||
58 | #include "audiowidget.h" | 58 | #include "audiowidget.h" |
59 | #include "videowidget.h" | 59 | #include "videowidget.h" |
60 | #include "mediaplayerstate.h" | 60 | #include "mediaplayerstate.h" |
61 | 61 | ||
62 | extern MediaPlayerState *mediaPlayerState; | 62 | extern MediaPlayerState *mediaPlayerState; |
63 | 63 | ||
64 | PlayListWidgetGui::PlayListWidgetGui( QWidget* parent, const char* name, WFlags fl ) | 64 | PlayListWidgetGui::PlayListWidgetGui( QWidget* parent, const char* name, WFlags fl ) |
65 | : QMainWindow( parent, name, fl ) { | 65 | : QMainWindow( parent, name, fl ) { |
66 | 66 | ||
67 | d = new PlayListWidgetPrivate; | 67 | d = new PlayListWidgetPrivate; |
68 | d->setDocumentUsed = FALSE; | 68 | d->setDocumentUsed = FALSE; |
69 | d->current = NULL; | 69 | d->current = NULL; |
70 | 70 | ||
71 | setBackgroundMode( PaletteButton ); | 71 | setBackgroundMode( PaletteButton ); |
72 | setToolBarsMovable( FALSE ); | 72 | setToolBarsMovable( FALSE ); |
73 | 73 | ||
74 | // Create Toolbar | 74 | // Create Toolbar |
75 | QPEToolBar *toolbar = new QPEToolBar( this ); | 75 | QPEToolBar *toolbar = new QPEToolBar( this ); |
76 | toolbar->setHorizontalStretchable( TRUE ); | 76 | toolbar->setHorizontalStretchable( TRUE ); |
77 | 77 | ||
78 | // Create Menubar | 78 | // Create Menubar |
79 | QPEMenuBar *menu = new QPEMenuBar( toolbar ); | 79 | QPEMenuBar *menu = new QPEMenuBar( toolbar ); |
80 | menu->setMargin( 0 ); | 80 | menu->setMargin( 0 ); |
81 | 81 | ||
82 | bar = new QPEToolBar( this ); | 82 | bar = new QPEToolBar( this ); |
83 | bar->setLabel( tr( "Play Operations" ) ); | 83 | bar->setLabel( tr( "Play Operations" ) ); |
84 | 84 | ||
85 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet( "trash" ), "", bar, "close" ); | 85 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet( "trash" ), "", bar, "close" ); |
86 | tbDeletePlaylist->setFlat( TRUE ); | 86 | tbDeletePlaylist->setFlat( TRUE ); |
87 | tbDeletePlaylist->setFixedSize( 20, 20 ); | 87 | tbDeletePlaylist->setFixedSize( 20, 20 ); |
88 | 88 | ||
89 | tbDeletePlaylist->hide(); | 89 | tbDeletePlaylist->hide(); |
90 | 90 | ||
91 | pmPlayList = new QPopupMenu( this ); | 91 | pmPlayList = new QPopupMenu( this ); |
92 | menu->insertItem( tr( "File" ), pmPlayList ); | 92 | menu->insertItem( tr( "File" ), pmPlayList ); |
93 | 93 | ||
94 | pmView = new QPopupMenu( this ); | 94 | pmView = new QPopupMenu( this ); |
95 | menu->insertItem( tr( "View" ), pmView ); | 95 | menu->insertItem( tr( "View" ), pmView ); |
96 | pmView->isCheckable(); | 96 | pmView->isCheckable(); |
97 | 97 | ||
98 | skinsMenu = new QPopupMenu( this ); | 98 | skinsMenu = new QPopupMenu( this ); |
99 | pmView->insertItem( tr( "Skins" ), skinsMenu ); | 99 | pmView->insertItem( tr( "Skins" ), skinsMenu ); |
100 | skinsMenu->isCheckable(); | 100 | skinsMenu->isCheckable(); |
101 | 101 | ||
102 | gammaMenu = new QPopupMenu( this ); | 102 | gammaMenu = new QPopupMenu( this ); |
103 | pmView->insertItem( tr( "Gamma (Video)" ), gammaMenu ); | 103 | pmView->insertItem( tr( "Gamma (Video)" ), gammaMenu ); |
104 | 104 | ||
105 | gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); | 105 | gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); |
106 | gammaSlider->setRange( -40, 40 ); | 106 | gammaSlider->setRange( -40, 40 ); |
107 | gammaSlider->setTickmarks( QSlider::Left ); | 107 | gammaSlider->setTickmarks( QSlider::Left ); |
108 | gammaSlider->setTickInterval( 20 ); | 108 | gammaSlider->setTickInterval( 20 ); |
109 | //gammaSlider->setFocusPolicy( QWidget::NoFocus ); | 109 | gammaSlider->setFocusPolicy( QWidget::StrongFocus ); |
110 | gammaSlider->setValue( 0 ); | 110 | gammaSlider->setValue( 0 ); |
111 | gammaSlider->setMinimumHeight( 50 ); | 111 | gammaSlider->setMinimumHeight( 50 ); |
112 | 112 | ||
113 | gammaLCD = new QLCDNumber( 3, gammaMenu ); | 113 | gammaLCD = new QLCDNumber( 3, gammaMenu ); |
114 | gammaLCD-> setFrameShape ( QFrame::NoFrame ); | ||
115 | gammaLCD-> setSegmentStyle ( QLCDNumber::Flat ); | ||
114 | 116 | ||
115 | gammaMenu->insertItem( gammaSlider ); | 117 | gammaMenu->insertItem( gammaSlider ); |
116 | gammaMenu->insertItem( gammaLCD ); | 118 | gammaMenu->insertItem( gammaLCD ); |
117 | 119 | ||
118 | connect( gammaSlider, SIGNAL( valueChanged( int ) ), gammaLCD, SLOT( display( int ) ) ); | 120 | connect( gammaSlider, SIGNAL( valueChanged( int ) ), gammaLCD, SLOT( display( int ) ) ); |
119 | 121 | ||
120 | vbox5 = new QVBox( this ); | 122 | vbox5 = new QVBox( this ); |
121 | QVBox *vbox4 = new QVBox( vbox5 ); | 123 | QVBox *vbox4 = new QVBox( vbox5 ); |
122 | QHBox *hbox6 = new QHBox( vbox4 ); | 124 | QHBox *hbox6 = new QHBox( vbox4 ); |
123 | 125 | ||
124 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); | 126 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); |
125 | 127 | ||
126 | QWidget *pTab; | 128 | QWidget *pTab; |
127 | pTab = new QWidget( tabWidget, "pTab" ); | 129 | pTab = new QWidget( tabWidget, "pTab" ); |
128 | tabWidget->insertTab( pTab, "Playlist"); | 130 | tabWidget->insertTab( pTab, "Playlist"); |
129 | 131 | ||
130 | QGridLayout *Playout = new QGridLayout( pTab ); | 132 | QGridLayout *Playout = new QGridLayout( pTab ); |
131 | Playout->setSpacing( 2); | 133 | Playout->setSpacing( 2); |
132 | Playout->setMargin( 2); | 134 | Playout->setMargin( 2); |
133 | 135 | ||
134 | // Add the playlist area | 136 | // Add the playlist area |
135 | QVBox *vbox3 = new QVBox( pTab ); | 137 | QVBox *vbox3 = new QVBox( pTab ); |
136 | d->playListFrame = vbox3; | 138 | d->playListFrame = vbox3; |
137 | 139 | ||
138 | QHBox *hbox2 = new QHBox( vbox3 ); | 140 | QHBox *hbox2 = new QHBox( vbox3 ); |
139 | d->selectedFiles = new PlayListSelection( hbox2 ); | 141 | d->selectedFiles = new PlayListSelection( hbox2 ); |
140 | 142 | ||
141 | vbox1 = new QVBox( hbox2 ); | 143 | vbox1 = new QVBox( hbox2 ); |
142 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(), QPEApplication::RightOnHold ); | 144 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(), QPEApplication::RightOnHold ); |
143 | QVBox *stretch1 = new QVBox( vbox1 ); // add stretch | 145 | QVBox *stretch1 = new QVBox( vbox1 ); // add stretch |
144 | 146 | ||
145 | Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); | 147 | Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); |
146 | 148 | ||
147 | QWidget *aTab; | 149 | QWidget *aTab; |
148 | aTab = new QWidget( tabWidget, "aTab" ); | 150 | aTab = new QWidget( tabWidget, "aTab" ); |
149 | 151 | ||
150 | QGridLayout *Alayout = new QGridLayout( aTab ); | 152 | QGridLayout *Alayout = new QGridLayout( aTab ); |
151 | Alayout->setSpacing( 2 ); | 153 | Alayout->setSpacing( 2 ); |
152 | Alayout->setMargin( 2 ); | 154 | Alayout->setMargin( 2 ); |
153 | audioView = new QListView( aTab, "Audioview" ); | 155 | audioView = new QListView( aTab, "Audioview" ); |
154 | audioView->addColumn( tr( "Title" ), 140 ); | 156 | audioView->addColumn( tr( "Title" ), 140 ); |
155 | audioView->addColumn( tr( "Size" ), -1 ); | 157 | audioView->addColumn( tr( "Size" ), -1 ); |
156 | audioView->addColumn( tr( "Media" ), -1 ); | 158 | audioView->addColumn( tr( "Media" ), -1 ); |
157 | audioView->addColumn( tr( "Path" ), 0 ); | 159 | audioView->addColumn( tr( "Path" ), 0 ); |
158 | audioView->setColumnAlignment( 1, Qt::AlignRight ); | 160 | audioView->setColumnAlignment( 1, Qt::AlignRight ); |
159 | audioView->setColumnAlignment( 2, Qt::AlignRight ); | 161 | audioView->setColumnAlignment( 2, Qt::AlignRight ); |
160 | audioView->setAllColumnsShowFocus( TRUE ); | 162 | audioView->setAllColumnsShowFocus( TRUE ); |
161 | audioView->setSorting( 0, TRUE ); | 163 | audioView->setSorting( 0, TRUE ); |
162 | audioView->setMultiSelection( TRUE ); | 164 | audioView->setMultiSelection( TRUE ); |
163 | audioView->setSelectionMode( QListView::Extended ); | 165 | audioView->setSelectionMode( QListView::Extended ); |
164 | Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); | 166 | Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); |
165 | tabWidget->insertTab( aTab, tr( "Audio" ) ); | 167 | tabWidget->insertTab( aTab, tr( "Audio" ) ); |
166 | 168 | ||
167 | QPEApplication::setStylusOperation( audioView->viewport(), QPEApplication::RightOnHold ); | 169 | QPEApplication::setStylusOperation( audioView->viewport(), QPEApplication::RightOnHold ); |
168 | 170 | ||
169 | QWidget *vTab; | 171 | QWidget *vTab; |
170 | vTab = new QWidget( tabWidget, "vTab" ); | 172 | vTab = new QWidget( tabWidget, "vTab" ); |
171 | 173 | ||
172 | QGridLayout *Vlayout = new QGridLayout( vTab ); | 174 | QGridLayout *Vlayout = new QGridLayout( vTab ); |
173 | Vlayout->setSpacing( 2 ); | 175 | Vlayout->setSpacing( 2 ); |
174 | Vlayout->setMargin( 2 ); | 176 | Vlayout->setMargin( 2 ); |
175 | videoView = new QListView( vTab, "Videoview" ); | 177 | videoView = new QListView( vTab, "Videoview" ); |
176 | videoView->addColumn( tr( "Title" ), 140); | 178 | videoView->addColumn( tr( "Title" ), 140); |
177 | videoView->addColumn( tr( "Size" ), -1 ); | 179 | videoView->addColumn( tr( "Size" ), -1 ); |