Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistwidgetgui.cpp') (more/less context) (ignore whitespace changes)
-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 fec91ea..33fe188 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | |||
@@ -8,187 +8,187 @@ | |||
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 | 34 | ||
35 | #include <qtoolbar.h> | 35 | #include <qtoolbar.h> |
36 | #include <qpe/qpeapplication.h> | 36 | #include <qpe/qpeapplication.h> |
37 | 37 | ||
38 | #include <qlayout.h> | 38 | #include <qlayout.h> |
39 | #include <qmenubar.h> | 39 | #include <qmenubar.h> |
40 | 40 | ||
41 | #include "playlistselection.h" | 41 | #include "playlistselection.h" |
42 | #include "playlistwidget.h" | 42 | #include "playlistwidget.h" |
43 | #include "mediaplayerstate.h" | 43 | #include "mediaplayerstate.h" |
44 | #include "inputDialog.h" | 44 | #include "inputDialog.h" |
45 | #include "playlistfileview.h" | 45 | #include "playlistfileview.h" |
46 | 46 | ||
47 | #include "mediaplayerstate.h" | 47 | #include "mediaplayerstate.h" |
48 | 48 | ||
49 | PlayListWidgetGui::PlayListWidgetGui(QWidget* parent, const char* name ) | 49 | PlayListWidgetGui::PlayListWidgetGui(QWidget* parent, const char* name ) |
50 | : QMainWindow( parent, name ) { | 50 | : QMainWindow( parent, name ) { |
51 | 51 | ||
52 | d = new PlayListWidgetPrivate; | 52 | d = new PlayListWidgetPrivate; |
53 | d->setDocumentUsed = FALSE; | 53 | d->setDocumentUsed = FALSE; |
54 | 54 | ||
55 | setBackgroundMode( PaletteButton ); | 55 | setBackgroundMode( PaletteButton ); |
56 | setToolBarsMovable( FALSE ); | 56 | setToolBarsMovable( FALSE ); |
57 | 57 | ||
58 | // Create Toolbar | 58 | // Create Toolbar |
59 | QToolBar *toolbar = new QToolBar( this ); | 59 | QToolBar *toolbar = new QToolBar( this ); |
60 | toolbar->setHorizontalStretchable( TRUE ); | 60 | toolbar->setHorizontalStretchable( TRUE ); |
61 | 61 | ||
62 | // Create Menubar | 62 | // Create Menubar |
63 | QMenuBar *menu = new QMenuBar( toolbar ); | 63 | QMenuBar *menu = new QMenuBar( toolbar ); |
64 | menu->setMargin( 0 ); | 64 | menu->setMargin( 0 ); |
65 | 65 | ||
66 | bar = new QToolBar( this ); | 66 | bar = new QToolBar( this ); |
67 | bar->setLabel( tr( "Play Operations" ) ); | 67 | bar->setLabel( tr( "Play Operations" ) ); |
68 | 68 | ||
69 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet( "trash" ), "", bar, "close" ); | 69 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet( "trash" ), "", bar, "close" ); |
70 | tbDeletePlaylist->setFlat( TRUE ); | 70 | tbDeletePlaylist->setFlat( TRUE ); |
71 | tbDeletePlaylist->setFixedSize( 20, 20 ); | 71 | tbDeletePlaylist->setFixedSize( 20, 20 ); |
72 | 72 | ||
73 | tbDeletePlaylist->hide(); | 73 | tbDeletePlaylist->hide(); |
74 | 74 | ||
75 | pmPlayList = new QPopupMenu( this ); | 75 | pmPlayList = new QPopupMenu( this ); |
76 | menu->insertItem( tr( "File" ), pmPlayList ); | 76 | menu->insertItem( tr( "File" ), pmPlayList ); |
77 | 77 | ||
78 | pmView = new QPopupMenu( this ); | 78 | pmView = new QPopupMenu( this ); |
79 | menu->insertItem( tr( "View" ), pmView ); | 79 | menu->insertItem( tr( "View" ), pmView ); |
80 | pmView->isCheckable(); | 80 | pmView->isCheckable(); |
81 | 81 | ||
82 | skinsMenu = new QPopupMenu( this ); | 82 | skinsMenu = new QPopupMenu( this ); |
83 | pmView->insertItem( tr( "Skins" ), skinsMenu ); | 83 | pmView->insertItem( tr( "Skins" ), skinsMenu ); |
84 | skinsMenu->isCheckable(); | 84 | skinsMenu->isCheckable(); |
85 | 85 | ||
86 | gammaMenu = new QPopupMenu( this ); | 86 | gammaMenu = new QPopupMenu( this ); |
87 | pmView->insertItem( tr( "Gamma (Video)" ), gammaMenu ); | 87 | pmView->insertItem( tr( "Gamma (Video)" ), gammaMenu ); |
88 | 88 | ||
89 | gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); | 89 | gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); |
90 | gammaSlider->setRange( -40, 40 ); | 90 | gammaSlider->setRange( -40, 40 ); |
91 | gammaSlider->setTickmarks( QSlider::Left ); | 91 | gammaSlider->setTickmarks( QSlider::Left ); |
92 | gammaSlider->setTickInterval( 20 ); | 92 | gammaSlider->setTickInterval( 20 ); |
93 | gammaSlider->setFocusPolicy( QWidget::StrongFocus ); | 93 | gammaSlider->setFocusPolicy( QWidget::StrongFocus ); |
94 | gammaSlider->setValue( 0 ); | 94 | gammaSlider->setValue( 0 ); |
95 | gammaSlider->setMinimumHeight( 50 ); | 95 | gammaSlider->setMinimumHeight( 50 ); |
96 | 96 | ||
97 | gammaLCD = new QLCDNumber( 3, gammaMenu ); | 97 | gammaLCD = new QLCDNumber( 3, gammaMenu ); |
98 | gammaLCD-> setFrameShape ( QFrame::NoFrame ); | 98 | gammaLCD-> setFrameShape ( QFrame::NoFrame ); |
99 | gammaLCD-> setSegmentStyle ( QLCDNumber::Flat ); | 99 | gammaLCD-> setSegmentStyle ( QLCDNumber::Flat ); |
100 | 100 | ||
101 | gammaMenu->insertItem( gammaSlider ); | 101 | gammaMenu->insertItem( gammaSlider ); |
102 | gammaMenu->insertItem( gammaLCD ); | 102 | gammaMenu->insertItem( gammaLCD ); |
103 | 103 | ||
104 | connect( gammaSlider, SIGNAL( valueChanged( int ) ), gammaLCD, SLOT( display( int ) ) ); | 104 | connect( gammaSlider, SIGNAL( valueChanged(int) ), gammaLCD, SLOT( display(int) ) ); |
105 | 105 | ||
106 | vbox5 = new QVBox( this ); | 106 | vbox5 = new QVBox( this ); |
107 | QVBox *vbox4 = new QVBox( vbox5 ); | 107 | QVBox *vbox4 = new QVBox( vbox5 ); |
108 | QHBox *hbox6 = new QHBox( vbox4 ); | 108 | QHBox *hbox6 = new QHBox( vbox4 ); |
109 | 109 | ||
110 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); | 110 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); |
111 | 111 | ||
112 | playListTab = new QWidget( tabWidget, "PlayListTab" ); | 112 | playListTab = new QWidget( tabWidget, "PlayListTab" ); |
113 | tabWidget->insertTab( playListTab, "Playlist"); | 113 | tabWidget->insertTab( playListTab, "Playlist"); |
114 | 114 | ||
115 | QGridLayout *Playout = new QGridLayout( playListTab ); | 115 | QGridLayout *Playout = new QGridLayout( playListTab ); |
116 | Playout->setSpacing( 2); | 116 | Playout->setSpacing( 2); |
117 | Playout->setMargin( 2); | 117 | Playout->setMargin( 2); |
118 | 118 | ||
119 | // Add the playlist area | 119 | // Add the playlist area |
120 | QVBox *vbox3 = new QVBox( playListTab ); | 120 | QVBox *vbox3 = new QVBox( playListTab ); |
121 | d->playListFrame = vbox3; | 121 | d->playListFrame = vbox3; |
122 | 122 | ||
123 | QHBox *hbox2 = new QHBox( vbox3 ); | 123 | QHBox *hbox2 = new QHBox( vbox3 ); |
124 | d->selectedFiles = new PlayListSelection( hbox2 ); | 124 | d->selectedFiles = new PlayListSelection( hbox2 ); |
125 | 125 | ||
126 | vbox1 = new QVBox( hbox2 ); | 126 | vbox1 = new QVBox( hbox2 ); |
127 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(), QPEApplication::RightOnHold ); | 127 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(), QPEApplication::RightOnHold ); |
128 | QVBox *stretch1 = new QVBox( vbox1 ); // add stretch | 128 | QVBox *stretch1 = new QVBox( vbox1 ); // add stretch |
129 | 129 | ||
130 | Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); | 130 | Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); |
131 | 131 | ||
132 | QWidget *aTab; | 132 | QWidget *aTab; |
133 | aTab = new QWidget( tabWidget, "aTab" ); | 133 | aTab = new QWidget( tabWidget, "aTab" ); |
134 | 134 | ||
135 | QGridLayout *Alayout = new QGridLayout( aTab ); | 135 | QGridLayout *Alayout = new QGridLayout( aTab ); |
136 | Alayout->setSpacing( 2 ); | 136 | Alayout->setSpacing( 2 ); |
137 | Alayout->setMargin( 2 ); | 137 | Alayout->setMargin( 2 ); |
138 | // no m3u's here please | 138 | // no m3u's here please |
139 | audioView = new PlayListFileView( "audio/mpeg;audio/x-wav;application/ogg", "opieplayer2/musicfile", aTab, "Audioview" ); | 139 | audioView = new PlayListFileView( "audio/mpeg;audio/x-wav;application/ogg", "opieplayer2/musicfile", aTab, "Audioview" ); |
140 | Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); | 140 | Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); |
141 | tabWidget->insertTab( aTab, tr( "Audio" ) ); | 141 | tabWidget->insertTab( aTab, tr( "Audio" ) ); |
142 | 142 | ||
143 | QPEApplication::setStylusOperation( audioView->viewport(), QPEApplication::RightOnHold ); | 143 | QPEApplication::setStylusOperation( audioView->viewport(), QPEApplication::RightOnHold ); |
144 | 144 | ||
145 | QWidget *vTab; | 145 | QWidget *vTab; |
146 | vTab = new QWidget( tabWidget, "vTab" ); | 146 | vTab = new QWidget( tabWidget, "vTab" ); |
147 | 147 | ||
148 | QGridLayout *Vlayout = new QGridLayout( vTab ); | 148 | QGridLayout *Vlayout = new QGridLayout( vTab ); |
149 | Vlayout->setSpacing( 2 ); | 149 | Vlayout->setSpacing( 2 ); |
150 | Vlayout->setMargin( 2 ); | 150 | Vlayout->setMargin( 2 ); |
151 | videoView = new PlayListFileView( "video/*", "opieplayer2/videofile", vTab, "Videoview" ); | 151 | videoView = new PlayListFileView( "video/*", "opieplayer2/videofile", vTab, "Videoview" ); |
152 | Vlayout->addMultiCellWidget( videoView, 0, 0, 0, 1 ); | 152 | Vlayout->addMultiCellWidget( videoView, 0, 0, 0, 1 ); |
153 | 153 | ||
154 | QPEApplication::setStylusOperation( videoView->viewport(), QPEApplication::RightOnHold ); | 154 | QPEApplication::setStylusOperation( videoView->viewport(), QPEApplication::RightOnHold ); |
155 | 155 | ||
156 | tabWidget->insertTab( vTab, tr( "Video" ) ); | 156 | tabWidget->insertTab( vTab, tr( "Video" ) ); |
157 | 157 | ||
158 | //playlists list | 158 | //playlists list |
159 | QWidget *LTab; | 159 | QWidget *LTab; |
160 | LTab = new QWidget( tabWidget, "LTab" ); | 160 | LTab = new QWidget( tabWidget, "LTab" ); |
161 | QGridLayout *Llayout = new QGridLayout( LTab ); | 161 | QGridLayout *Llayout = new QGridLayout( LTab ); |
162 | Llayout->setSpacing( 2 ); | 162 | Llayout->setSpacing( 2 ); |
163 | Llayout->setMargin( 2 ); | 163 | Llayout->setMargin( 2 ); |
164 | 164 | ||
165 | playLists = new FileSelector( "playlist/plain;audio/x-mpegurl", LTab, "fileselector" , FALSE, FALSE ); | 165 | playLists = new FileSelector( "playlist/plain;audio/x-mpegurl", LTab, "fileselector" , FALSE, FALSE ); |
166 | Llayout->addMultiCellWidget( playLists, 0, 0, 0, 1 ); | 166 | Llayout->addMultiCellWidget( playLists, 0, 0, 0, 1 ); |
167 | 167 | ||
168 | tabWidget->insertTab( LTab, tr( "Lists" ) ); | 168 | tabWidget->insertTab( LTab, tr( "Lists" ) ); |
169 | 169 | ||
170 | setCentralWidget( vbox5 ); | 170 | setCentralWidget( vbox5 ); |
171 | } | 171 | } |
172 | 172 | ||
173 | 173 | ||
174 | 174 | ||
175 | PlayListWidgetGui::~PlayListWidgetGui() { | 175 | PlayListWidgetGui::~PlayListWidgetGui() { |
176 | } | 176 | } |
177 | 177 | ||
178 | void PlayListWidgetGui::setView( char view ) { | 178 | void PlayListWidgetGui::setView( char view ) { |
179 | if ( view == 'l' ) | 179 | if ( view == 'l' ) |
180 | showMaximized(); | 180 | showMaximized(); |
181 | else | 181 | else |
182 | hide(); | 182 | hide(); |
183 | } | 183 | } |
184 | 184 | ||
185 | 185 | ||
186 | void PlayListWidgetGui::setActiveWindow() { | 186 | void PlayListWidgetGui::setActiveWindow() { |
187 | // qDebug("SETTING active window"); | 187 | // qDebug("SETTING active window"); |
188 | // When we get raised we need to ensure that it switches views | 188 | // When we get raised we need to ensure that it switches views |
189 | MediaPlayerState::DisplayType origDisplayType = mediaPlayerState->displayType(); | 189 | MediaPlayerState::DisplayType origDisplayType = mediaPlayerState->displayType(); |
190 | mediaPlayerState->setDisplayType( MediaPlayerState::MediaSelection ); // invalidate | 190 | mediaPlayerState->setDisplayType( MediaPlayerState::MediaSelection ); // invalidate |
191 | mediaPlayerState->setDisplayType( origDisplayType ); // now switch back | 191 | mediaPlayerState->setDisplayType( origDisplayType ); // now switch back |
192 | } | 192 | } |
193 | 193 | ||
194 | 194 | ||