summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index ec5500f..7a79be1 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -1,164 +1,165 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20// code added by L. J. Potter Sat 03-02-2002 06:17:54 20// code added by L. J. Potter Sat 03-02-2002 06:17:54
21#define QTOPIA_INTERNAL_FSLP 21#define QTOPIA_INTERNAL_FSLP
22#include <qpe/qcopenvelope_qws.h> 22#include <qpe/qcopenvelope_qws.h>
23 23
24#include <qpe/qpemenubar.h> 24#include <qpe/qpemenubar.h>
25#include <qpe/qpetoolbar.h> 25#include <qpe/qpetoolbar.h>
26#include <qpe/fileselector.h> 26#include <qpe/fileselector.h>
27#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
28#include <qpe/lnkproperties.h> 28#include <qpe/lnkproperties.h>
29#include <qpe/storage.h> 29#include <qpe/storage.h>
30 30
31#include <qpe/applnk.h> 31#include <qpe/applnk.h>
32#include <qpe/config.h> 32#include <qpe/config.h>
33#include <qpe/global.h> 33#include <qpe/global.h>
34#include <qpe/resource.h> 34#include <qpe/resource.h>
35 35
36#include <qaction.h> 36#include <qaction.h>
37#include <qcursor.h>
37#include <qimage.h> 38#include <qimage.h>
38#include <qfile.h> 39#include <qfile.h>
39#include <qdir.h> 40#include <qdir.h>
40#include <qlayout.h> 41#include <qlayout.h>
41#include <qlabel.h> 42#include <qlabel.h>
42#include <qlist.h> 43#include <qlist.h>
43#include <qlistbox.h> 44#include <qlistbox.h>
44#include <qmainwindow.h> 45#include <qmainwindow.h>
45#include <qmessagebox.h> 46#include <qmessagebox.h>
46#include <qtoolbutton.h> 47#include <qtoolbutton.h>
47#include <qtabwidget.h> 48#include <qtabwidget.h>
48#include <qlistview.h> 49#include <qlistview.h>
49#include <qpoint.h> 50#include <qpoint.h>
50#include <qlineedit.h> 51#include <qlineedit.h>
51#include <qpushbutton.h> 52#include <qpushbutton.h>
52#include <qregexp.h> 53#include <qregexp.h>
53#include <qtextstream.h> 54#include <qtextstream.h>
54 55
55//#include <qtimer.h> 56//#include <qtimer.h>
56 57
57#include "playlistselection.h" 58#include "playlistselection.h"
58#include "playlistwidget.h" 59#include "playlistwidget.h"
59#include "mediaplayerstate.h" 60#include "mediaplayerstate.h"
60 61
61#include "inputDialog.h" 62#include "inputDialog.h"
62 63
63#include <stdlib.h> 64#include <stdlib.h>
64#include "audiowidget.h" 65#include "audiowidget.h"
65#include "videowidget.h" 66#include "videowidget.h"
66 67
67#include <unistd.h> 68#include <unistd.h>
68#include <sys/file.h> 69#include <sys/file.h>
69#include <sys/ioctl.h> 70#include <sys/ioctl.h>
70#include <sys/soundcard.h> 71#include <sys/soundcard.h>
71 72
72// for setBacklight() 73// for setBacklight()
73#include <linux/fb.h> 74#include <linux/fb.h>
74#include <sys/types.h> 75#include <sys/types.h>
75#include <sys/stat.h> 76#include <sys/stat.h>
76#include <stdlib.h> 77#include <stdlib.h>
77 78
78#define BUTTONS_ON_TOOLBAR 79#define BUTTONS_ON_TOOLBAR
79#define SIDE_BUTTONS 80#define SIDE_BUTTONS
80#define CAN_SAVE_LOAD_PLAYLISTS 81#define CAN_SAVE_LOAD_PLAYLISTS
81 82
82extern AudioWidget *audioUI; 83extern AudioWidget *audioUI;
83extern VideoWidget *videoUI; 84extern VideoWidget *videoUI;
84extern MediaPlayerState *mediaPlayerState; 85extern MediaPlayerState *mediaPlayerState;
85 86
86// class myFileSelector { 87// class myFileSelector {
87 88
88// }; 89// };
89class PlayListWidgetPrivate { 90class PlayListWidgetPrivate {
90public: 91public:
91 QToolButton *tbPlay, *tbFull, *tbLoop, *tbScale, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove; 92 QToolButton *tbPlay, *tbFull, *tbLoop, *tbScale, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove;
92 QFrame *playListFrame; 93 QFrame *playListFrame;
93 FileSelector *files; 94 FileSelector *files;
94 PlayListSelection *selectedFiles; 95 PlayListSelection *selectedFiles;
95 bool setDocumentUsed; 96 bool setDocumentUsed;
96 DocLnk *current; 97 DocLnk *current;
97}; 98};
98 99
99 100
100class ToolButton : public QToolButton { 101class ToolButton : public QToolButton {
101public: 102public:
102 ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) 103 ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE )
103 : QToolButton( parent, name ) { 104 : QToolButton( parent, name ) {
104 setTextLabel( name ); 105 setTextLabel( name );
105 setPixmap( Resource::loadPixmap( icon ) ); 106 setPixmap( Resource::loadPixmap( icon ) );
106 setAutoRaise( TRUE ); 107 setAutoRaise( TRUE );
107 setFocusPolicy( QWidget::NoFocus ); 108 setFocusPolicy( QWidget::NoFocus );
108 setToggleButton( t ); 109 setToggleButton( t );
109 connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); 110 connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot );
110 QPEMenuToolFocusManager::manager()->addWidget( this ); 111 QPEMenuToolFocusManager::manager()->addWidget( this );
111 } 112 }
112}; 113};
113 114
114 115
115class MenuItem : public QAction { 116class MenuItem : public QAction {
116public: 117public:
117 MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot ) 118 MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot )
118 : QAction( text, QString::null, 0, 0 ) { 119 : QAction( text, QString::null, 0, 0 ) {
119 connect( this, SIGNAL( activated() ), handler, slot ); 120 connect( this, SIGNAL( activated() ), handler, slot );
120 addTo( parent ); 121 addTo( parent );
121 } 122 }
122}; 123};
123 124
124 125
125PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) 126PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
126 : QMainWindow( parent, name, fl ) { 127 : QMainWindow( parent, name, fl ) {
127 128
128 d = new PlayListWidgetPrivate; 129 d = new PlayListWidgetPrivate;
129 d->setDocumentUsed = FALSE; 130 d->setDocumentUsed = FALSE;
130 d->current = NULL; 131 d->current = NULL;
131 fromSetDocument = FALSE; 132 fromSetDocument = FALSE;
132 insanityBool=FALSE; 133 insanityBool=FALSE;
133// menuTimer = new QTimer( this ,"menu timer"), 134// menuTimer = new QTimer( this ,"menu timer"),
134// connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) ); 135// connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) );
135 136
136 setBackgroundMode( PaletteButton ); 137 setBackgroundMode( PaletteButton );
137 138
138 setCaption( tr("OpiePlayer") ); 139 setCaption( tr("OpiePlayer") );
139 setIcon( Resource::loadPixmap( "opieplayer/MPEGPlayer" ) ); 140 setIcon( Resource::loadPixmap( "opieplayer/MPEGPlayer" ) );
140 141
141 setToolBarsMovable( FALSE ); 142 setToolBarsMovable( FALSE );
142 143
143 // Create Toolbar 144 // Create Toolbar
144 QPEToolBar *toolbar = new QPEToolBar( this ); 145 QPEToolBar *toolbar = new QPEToolBar( this );
145 toolbar->setHorizontalStretchable( TRUE ); 146 toolbar->setHorizontalStretchable( TRUE );
146 147
147 // Create Menubar 148 // Create Menubar
148 QPEMenuBar *menu = new QPEMenuBar( toolbar ); 149 QPEMenuBar *menu = new QPEMenuBar( toolbar );
149 menu->setMargin( 0 ); 150 menu->setMargin( 0 );
150 151
151 QPEToolBar *bar = new QPEToolBar( this ); 152 QPEToolBar *bar = new QPEToolBar( this );
152 bar->setLabel( tr( "Play Operations" ) ); 153 bar->setLabel( tr( "Play Operations" ) );
153// d->tbPlayCurList = new ToolButton( bar, tr( "play List" ), "opieplayer/play_current_list", 154// d->tbPlayCurList = new ToolButton( bar, tr( "play List" ), "opieplayer/play_current_list",
154// this , SLOT( addSelected()) ); 155// this , SLOT( addSelected()) );
155 tbDeletePlaylist = new QPushButton( Resource::loadIconSet("trash"),"",bar,"close"); 156 tbDeletePlaylist = new QPushButton( Resource::loadIconSet("trash"),"",bar,"close");
156 tbDeletePlaylist->setFlat(TRUE); 157 tbDeletePlaylist->setFlat(TRUE);
157 tbDeletePlaylist->setFixedSize(20,20); 158 tbDeletePlaylist->setFixedSize(20,20);
158 connect(tbDeletePlaylist,(SIGNAL(released())),SLOT( deletePlaylist())); 159 connect(tbDeletePlaylist,(SIGNAL(released())),SLOT( deletePlaylist()));
159 160
160 d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "opieplayer/add_to_playlist", 161 d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "opieplayer/add_to_playlist",
161 this , SLOT(addSelected()) ); 162 this , SLOT(addSelected()) );
162 d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "opieplayer/remove_from_playlist", 163 d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "opieplayer/remove_from_playlist",
163 this , SLOT(removeSelected()) ); 164 this , SLOT(removeSelected()) );
164// d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer/play", /*this */mediaPlayerState , SLOT(setPlaying(bool) /* btnPlay() */), TRUE ); 165// d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer/play", /*this */mediaPlayerState , SLOT(setPlaying(bool) /* btnPlay() */), TRUE );