author | llornkcor <llornkcor> | 2002-09-21 02:29:11 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-09-21 02:29:11 (UTC) |
commit | 56d434ffe69337186941eba1b5b5dee16da537d7 (patch) (unidiff) | |
tree | f37ed44e3abb1c0ec77de80b9b4582fe214fbec7 | |
parent | a9131dc457602352acac91e31dcca51d37361eba (diff) | |
download | opie-56d434ffe69337186941eba1b5b5dee16da537d7.zip opie-56d434ffe69337186941eba1b5b5dee16da537d7.tar.gz opie-56d434ffe69337186941eba1b5b5dee16da537d7.tar.bz2 |
fix playlist mimetype
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp index f073102..ce472f1 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | |||
@@ -8,221 +8,221 @@ | |||
8 | .=l. | 8 | .=l. |
9 | .>+-= | 9 | .>+-= |
10 | _;:, .> :=|. This program is free software; you can | 10 | _;:, .> :=|. This program is free software; you can |
11 | .> <`_, > . <= redistribute it and/or modify it under | 11 | .> <`_, > . <= redistribute it and/or modify it under |
12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
13 | .="- .-=="i, .._ License as published by the Free Software | 13 | .="- .-=="i, .._ License as published by the Free Software |
14 | - . .-<_> .<> Foundation; either version 2 of the License, | 14 | - . .-<_> .<> Foundation; either version 2 of the License, |
15 | ._= =} : or (at your option) any later version. | 15 | ._= =} : or (at your option) any later version. |
16 | .%`+i> _;_. | 16 | .%`+i> _;_. |
17 | .i_,=:_. -<s. This program is distributed in the hope that | 17 | .i_,=:_. -<s. This program is distributed in the hope that |
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
19 | : .. .:, . . . without even the implied warranty of | 19 | : .. .:, . . . without even the implied warranty of |
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; General Public License for more | 22 | ..}^=.= = ; General Public License for more |
23 | ++= -. .` .: details. | 23 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 24 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 25 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = General Public License along with | 26 | -_. . . )=. = General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 27 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <qpe/qpemenubar.h> | 34 | #include <qpe/qpemenubar.h> |
35 | #include <qpe/qpetoolbar.h> | 35 | #include <qpe/qpetoolbar.h> |
36 | #include <qpe/fileselector.h> | 36 | #include <qpe/fileselector.h> |
37 | #include <qpe/qpeapplication.h> | 37 | #include <qpe/qpeapplication.h> |
38 | #include <qpe/storage.h> | 38 | #include <qpe/storage.h> |
39 | #include <qpe/mimetype.h> | 39 | #include <qpe/mimetype.h> |
40 | #include <qpe/config.h> | 40 | #include <qpe/config.h> |
41 | #include <qpe/global.h> | 41 | #include <qpe/global.h> |
42 | #include <qpe/resource.h> | 42 | #include <qpe/resource.h> |
43 | 43 | ||
44 | #include <qpopupmenu.h> | 44 | #include <qpopupmenu.h> |
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" ), gammaMenu ); | 103 | pmView->insertItem( tr( "Gamma" ), gammaMenu ); |
104 | gammaMenu->setMinimumHeight( 50 ); | 104 | gammaMenu->setMinimumHeight( 50 ); |
105 | 105 | ||
106 | gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); | 106 | gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); |
107 | gammaSlider->setRange( -100, 100 ); | 107 | gammaSlider->setRange( -100, 100 ); |
108 | gammaSlider->setTickmarks( QSlider::Left ); | 108 | gammaSlider->setTickmarks( QSlider::Left ); |
109 | gammaSlider->setTickInterval( 20 ); | 109 | gammaSlider->setTickInterval( 20 ); |
110 | gammaSlider->setFocusPolicy( QWidget::NoFocus ); | 110 | gammaSlider->setFocusPolicy( QWidget::NoFocus ); |
111 | gammaSlider->setValue( 0 ); | 111 | gammaSlider->setValue( 0 ); |
112 | gammaSlider->setMinimumHeight( 50 ); | 112 | gammaSlider->setMinimumHeight( 50 ); |
113 | 113 | ||
114 | gammaLCD = new QLCDNumber( 3, gammaMenu ); | 114 | gammaLCD = new QLCDNumber( 3, gammaMenu ); |
115 | 115 | ||
116 | gammaMenu->insertItem( gammaSlider ); | 116 | gammaMenu->insertItem( gammaSlider ); |
117 | gammaMenu->insertItem( gammaLCD ); | 117 | gammaMenu->insertItem( gammaLCD ); |
118 | 118 | ||
119 | connect( gammaSlider, SIGNAL( valueChanged( int ) ), gammaLCD, SLOT( display( int ) ) ); | 119 | connect( gammaSlider, SIGNAL( valueChanged( int ) ), gammaLCD, SLOT( display( int ) ) ); |
120 | 120 | ||
121 | vbox5 = new QVBox( this ); | 121 | vbox5 = new QVBox( this ); |
122 | QVBox *vbox4 = new QVBox( vbox5 ); | 122 | QVBox *vbox4 = new QVBox( vbox5 ); |
123 | QHBox *hbox6 = new QHBox( vbox4 ); | 123 | QHBox *hbox6 = new QHBox( vbox4 ); |
124 | 124 | ||
125 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); | 125 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); |
126 | 126 | ||
127 | QWidget *pTab; | 127 | QWidget *pTab; |
128 | pTab = new QWidget( tabWidget, "pTab" ); | 128 | pTab = new QWidget( tabWidget, "pTab" ); |
129 | tabWidget->insertTab( pTab, "Playlist"); | 129 | tabWidget->insertTab( pTab, "Playlist"); |
130 | 130 | ||
131 | QGridLayout *Playout = new QGridLayout( pTab ); | 131 | QGridLayout *Playout = new QGridLayout( pTab ); |
132 | Playout->setSpacing( 2); | 132 | Playout->setSpacing( 2); |
133 | Playout->setMargin( 2); | 133 | Playout->setMargin( 2); |
134 | 134 | ||
135 | // Add the playlist area | 135 | // Add the playlist area |
136 | QVBox *vbox3 = new QVBox( pTab ); | 136 | QVBox *vbox3 = new QVBox( pTab ); |
137 | d->playListFrame = vbox3; | 137 | d->playListFrame = vbox3; |
138 | 138 | ||
139 | QHBox *hbox2 = new QHBox( vbox3 ); | 139 | QHBox *hbox2 = new QHBox( vbox3 ); |
140 | d->selectedFiles = new PlayListSelection( hbox2 ); | 140 | d->selectedFiles = new PlayListSelection( hbox2 ); |
141 | 141 | ||
142 | vbox1 = new QVBox( hbox2 ); | 142 | vbox1 = new QVBox( hbox2 ); |
143 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(), QPEApplication::RightOnHold ); | 143 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(), QPEApplication::RightOnHold ); |
144 | QVBox *stretch1 = new QVBox( vbox1 ); // add stretch | 144 | QVBox *stretch1 = new QVBox( vbox1 ); // add stretch |
145 | 145 | ||
146 | Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); | 146 | Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); |
147 | 147 | ||
148 | QWidget *aTab; | 148 | QWidget *aTab; |
149 | aTab = new QWidget( tabWidget, "aTab" ); | 149 | aTab = new QWidget( tabWidget, "aTab" ); |
150 | 150 | ||
151 | QGridLayout *Alayout = new QGridLayout( aTab ); | 151 | QGridLayout *Alayout = new QGridLayout( aTab ); |
152 | Alayout->setSpacing( 2 ); | 152 | Alayout->setSpacing( 2 ); |
153 | Alayout->setMargin( 2 ); | 153 | Alayout->setMargin( 2 ); |
154 | audioView = new QListView( aTab, "Audioview" ); | 154 | audioView = new QListView( aTab, "Audioview" ); |
155 | audioView->addColumn( tr( "Title" ), 140 ); | 155 | audioView->addColumn( tr( "Title" ), 140 ); |
156 | audioView->addColumn( tr( "Size" ), -1 ); | 156 | audioView->addColumn( tr( "Size" ), -1 ); |
157 | audioView->addColumn( tr( "Media" ), -1 ); | 157 | audioView->addColumn( tr( "Media" ), -1 ); |
158 | audioView->addColumn( tr( "Path" ), 0 ); | 158 | audioView->addColumn( tr( "Path" ), 0 ); |
159 | audioView->setColumnAlignment( 1, Qt::AlignRight ); | 159 | audioView->setColumnAlignment( 1, Qt::AlignRight ); |
160 | audioView->setColumnAlignment( 2, Qt::AlignRight ); | 160 | audioView->setColumnAlignment( 2, Qt::AlignRight ); |
161 | audioView->setAllColumnsShowFocus( TRUE ); | 161 | audioView->setAllColumnsShowFocus( TRUE ); |
162 | audioView->setSorting( 0, TRUE ); | 162 | audioView->setSorting( 0, TRUE ); |
163 | audioView->setMultiSelection( TRUE ); | 163 | audioView->setMultiSelection( TRUE ); |
164 | audioView->setSelectionMode( QListView::Extended ); | 164 | audioView->setSelectionMode( QListView::Extended ); |
165 | Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); | 165 | Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); |
166 | tabWidget->insertTab( aTab, tr( "Audio" ) ); | 166 | tabWidget->insertTab( aTab, tr( "Audio" ) ); |
167 | 167 | ||
168 | QPEApplication::setStylusOperation( audioView->viewport(), QPEApplication::RightOnHold ); | 168 | QPEApplication::setStylusOperation( audioView->viewport(), QPEApplication::RightOnHold ); |
169 | 169 | ||
170 | QWidget *vTab; | 170 | QWidget *vTab; |
171 | vTab = new QWidget( tabWidget, "vTab" ); | 171 | vTab = new QWidget( tabWidget, "vTab" ); |
172 | 172 | ||
173 | QGridLayout *Vlayout = new QGridLayout( vTab ); | 173 | QGridLayout *Vlayout = new QGridLayout( vTab ); |
174 | Vlayout->setSpacing( 2 ); | 174 | Vlayout->setSpacing( 2 ); |
175 | Vlayout->setMargin( 2 ); | 175 | Vlayout->setMargin( 2 ); |
176 | videoView = new QListView( vTab, "Videoview" ); | 176 | videoView = new QListView( vTab, "Videoview" ); |
177 | videoView->addColumn( tr( "Title" ), 140); | 177 | videoView->addColumn( tr( "Title" ), 140); |
178 | videoView->addColumn( tr( "Size" ), -1 ); | 178 | videoView->addColumn( tr( "Size" ), -1 ); |
179 | videoView->addColumn(tr( "Media" ), -1 ); | 179 | videoView->addColumn(tr( "Media" ), -1 ); |
180 | videoView->addColumn(tr( "Path" ), 0 ); | 180 | videoView->addColumn(tr( "Path" ), 0 ); |
181 | videoView->setColumnAlignment( 1, Qt::AlignRight ); | 181 | videoView->setColumnAlignment( 1, Qt::AlignRight ); |
182 | videoView->setColumnAlignment( 2, Qt::AlignRight ); | 182 | videoView->setColumnAlignment( 2, Qt::AlignRight ); |
183 | videoView->setAllColumnsShowFocus( TRUE ); | 183 | videoView->setAllColumnsShowFocus( TRUE ); |
184 | videoView->setSorting( 0, TRUE ); | 184 | videoView->setSorting( 0, TRUE ); |
185 | videoView->setMultiSelection( TRUE ); | 185 | videoView->setMultiSelection( TRUE ); |
186 | videoView->setSelectionMode( QListView::Extended ); | 186 | videoView->setSelectionMode( QListView::Extended ); |
187 | Vlayout->addMultiCellWidget( videoView, 0, 0, 0, 1 ); | 187 | Vlayout->addMultiCellWidget( videoView, 0, 0, 0, 1 ); |
188 | 188 | ||
189 | QPEApplication::setStylusOperation( videoView->viewport(), QPEApplication::RightOnHold ); | 189 | QPEApplication::setStylusOperation( videoView->viewport(), QPEApplication::RightOnHold ); |
190 | 190 | ||
191 | tabWidget->insertTab( vTab, tr( "Video" ) ); | 191 | tabWidget->insertTab( vTab, tr( "Video" ) ); |
192 | 192 | ||
193 | //playlists list | 193 | //playlists list |
194 | QWidget *LTab; | 194 | QWidget *LTab; |
195 | LTab = new QWidget( tabWidget, "LTab" ); | 195 | LTab = new QWidget( tabWidget, "LTab" ); |
196 | QGridLayout *Llayout = new QGridLayout( LTab ); | 196 | QGridLayout *Llayout = new QGridLayout( LTab ); |
197 | Llayout->setSpacing( 2 ); | 197 | Llayout->setSpacing( 2 ); |
198 | Llayout->setMargin( 2 ); | 198 | Llayout->setMargin( 2 ); |
199 | 199 | ||
200 | playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE ); //buggy | 200 | playLists = new FileSelector( "playlist/plain;audio/x-mpegurl", LTab, "fileselector" , FALSE, FALSE ); |
201 | Llayout->addMultiCellWidget( playLists, 0, 0, 0, 1 ); | 201 | Llayout->addMultiCellWidget( playLists, 0, 0, 0, 1 ); |
202 | 202 | ||
203 | tabWidget->insertTab( LTab, tr( "Lists" ) ); | 203 | tabWidget->insertTab( LTab, tr( "Lists" ) ); |
204 | 204 | ||
205 | setCentralWidget( vbox5 ); | 205 | setCentralWidget( vbox5 ); |
206 | } | 206 | } |
207 | 207 | ||
208 | 208 | ||
209 | 209 | ||
210 | PlayListWidgetGui::~PlayListWidgetGui() { | 210 | PlayListWidgetGui::~PlayListWidgetGui() { |
211 | } | 211 | } |
212 | 212 | ||
213 | void PlayListWidgetGui::setView( char view ) { | 213 | void PlayListWidgetGui::setView( char view ) { |
214 | if ( view == 'l' ) | 214 | if ( view == 'l' ) |
215 | showMaximized(); | 215 | showMaximized(); |
216 | else | 216 | else |
217 | hide(); | 217 | hide(); |
218 | } | 218 | } |
219 | 219 | ||
220 | 220 | ||
221 | void PlayListWidgetGui::setActiveWindow() { | 221 | void PlayListWidgetGui::setActiveWindow() { |
222 | // qDebug("SETTING active window"); | 222 | // qDebug("SETTING active window"); |
223 | // When we get raised we need to ensure that it switches views | 223 | // When we get raised we need to ensure that it switches views |
224 | char origView = mediaPlayerState->view(); | 224 | char origView = mediaPlayerState->view(); |
225 | mediaPlayerState->setView( 'l' ); // invalidate | 225 | mediaPlayerState->setView( 'l' ); // invalidate |
226 | mediaPlayerState->setView( origView ); // now switch back | 226 | mediaPlayerState->setView( origView ); // now switch back |
227 | } | 227 | } |
228 | 228 | ||