Diffstat (limited to 'noncore/multimedia/opieplayer2/inputDialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/inputDialog.cpp | 67 |
1 files changed, 36 insertions, 31 deletions
diff --git a/noncore/multimedia/opieplayer2/inputDialog.cpp b/noncore/multimedia/opieplayer2/inputDialog.cpp index 2c4be1b..ebde9c6 100644 --- a/noncore/multimedia/opieplayer2/inputDialog.cpp +++ b/noncore/multimedia/opieplayer2/inputDialog.cpp | |||
@@ -1,9 +1,40 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (c) 2002,2003 Max Reiss <harlekin@handhelds.org> | ||
5 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> | ||
6 | =. | ||
7 | .=l. | ||
8 | .>+-= | ||
9 | _;:, .> :=|. This program is free software; you can | ||
10 | .> <`_, > . <= redistribute it and/or modify it under | ||
11 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | ||
12 | .="- .-=="i, .._ License as published by the Free Software | ||
13 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
14 | ._= =} : or (at your option) any later version. | ||
15 | .%`+i> _;_. | ||
16 | .i_,=:_. -<s. This program is distributed in the hope that | ||
17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
18 | : .. .:, . . . without even the implied warranty of | ||
19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
21 | ..}^=.= = ; General Public License for more | ||
22 | ++= -. .` .: details. | ||
23 | : = ...= . :.=- | ||
24 | -. .:....=;==+<; You should have received a copy of the GNU | ||
25 | -_. . . )=. = General Public License along with | ||
26 | -- :-=` this library; see the file COPYING.LIB. | ||
27 | If not, write to the Free Software Foundation, | ||
28 | Inc., 59 Temple Place - Suite 330, | ||
29 | Boston, MA 02111-1307, USA. | ||
30 | |||
31 | */ | ||
32 | |||
33 | |||
1 | #include "inputDialog.h" | 34 | #include "inputDialog.h" |
2 | 35 | ||
3 | #include <qpe/resource.h> | 36 | #include <qpe/resource.h> |
4 | #include <qpe/qpeapplication.h> | 37 | #include <qpe/qpeapplication.h> |
5 | #include <qpe/config.h> | ||
6 | #include <opie/ofiledialog.h> | ||
7 | 38 | ||
8 | #include <qfileinfo.h> | 39 | #include <qfileinfo.h> |
9 | #include <qlineedit.h> | 40 | #include <qlineedit.h> |
@@ -22,9 +53,9 @@ InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags | |||
22 | setCaption( tr( name ) ); | 53 | setCaption( tr( name ) ); |
23 | 54 | ||
24 | QPushButton *browserButton; | 55 | QPushButton *browserButton; |
25 | browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); | 56 | //browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); |
26 | browserButton->setGeometry( QRect( 205, 10, 22, 22)); | 57 | //browserButton->setGeometry( QRect( 205, 10, 22, 22)); |
27 | connect( browserButton, SIGNAL(released()),this,SLOT(browse())); | 58 | //connect( browserButton, SIGNAL(released()),this,SLOT(browse())); |
28 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); | 59 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); |
29 | LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); | 60 | LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); |
30 | LineEdit1->setFocus(); | 61 | LineEdit1->setFocus(); |
@@ -41,29 +72,3 @@ QString InputDialog::text() const { | |||
41 | InputDialog::~InputDialog() { | 72 | InputDialog::~InputDialog() { |
42 | } | 73 | } |
43 | 74 | ||
44 | void InputDialog::browse() { | ||
45 | Config cfg( "OpiePlayer" ); | ||
46 | cfg.setGroup("Dialog"); | ||
47 | MimeTypes types; | ||
48 | QStringList audio, video, all; | ||
49 | audio << "audio/*"; | ||
50 | audio << "playlist/plain"; | ||
51 | audio << "audio/x-mpegurl"; | ||
52 | |||
53 | video << "video/*"; | ||
54 | video << "playlist/plain"; | ||
55 | |||
56 | all += audio; | ||
57 | all += video; | ||
58 | types.insert("All Media Files", all ); | ||
59 | types.insert("Audio", audio ); | ||
60 | types.insert("Video", video ); | ||
61 | |||
62 | QString str = OFileDialog::getOpenFileName( 1, | ||
63 | cfg.readEntry("LastDirectory",QPEApplication::documentDir()),"", | ||
64 | types, 0 ); | ||
65 | if(str.left(2) == "//") str=str.right(str.length()-1); | ||
66 | LineEdit1->setText(str); | ||
67 | cfg.writeEntry("LastDirectory" ,QFileInfo(str).dirPath()); | ||
68 | } | ||
69 | |||