Diffstat (limited to 'noncore/applets/pcmcia/configdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/applets/pcmcia/configdialog.cpp | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/noncore/applets/pcmcia/configdialog.cpp b/noncore/applets/pcmcia/configdialog.cpp new file mode 100644 index 0000000..c08926e --- a/dev/null +++ b/noncore/applets/pcmcia/configdialog.cpp | |||
@@ -0,0 +1,73 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | =. (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de> | ||
4 | .=l. | ||
5 | .>+-= | ||
6 | _;:, .> :=|. This program is free software; you can | ||
7 | .> <`_, > . <= redistribute it and/or modify it under | ||
8 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
9 | .="- .-=="i, .._ License as published by the Free Software | ||
10 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
11 | ._= =} : or (at your option) any later version. | ||
12 | .%`+i> _;_. | ||
13 | .i_,=:_. -<s. This program is distributed in the hope that | ||
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
15 | : .. .:, . . . without even the implied warranty of | ||
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
18 | ..}^=.= = ; Library General Public License for more | ||
19 | ++= -. .` .: details. | ||
20 | : = ...= . :.=- | ||
21 | -. .:....=;==+<; You should have received a copy of the GNU | ||
22 | -_. . . )=. = Library General Public License along with | ||
23 | -- :-=` this library; see the file COPYING.LIB. | ||
24 | If not, write to the Free Software Foundation, | ||
25 | Inc., 59 Temple Place - Suite 330, | ||
26 | Boston, MA 02111-1307, USA. | ||
27 | |||
28 | */ | ||
29 | |||
30 | #include "configdialog.h" | ||
31 | |||
32 | /* OPIE */ | ||
33 | #include <opie2/oconfig.h> | ||
34 | #include <opie2/odebug.h> | ||
35 | using namespace Opie::Core; | ||
36 | |||
37 | /* QT */ | ||
38 | #include <qcombobox.h> | ||
39 | |||
40 | ConfigDialog::ConfigDialog( const QString& cardname, QWidget* parent ) | ||
41 | :ConfigDialogBase( parent, "pcmcia config dialog", true ) | ||
42 | { | ||
43 | setCaption( tr( "Configure %1" ).arg( cardname ) ); | ||
44 | |||
45 | OConfig cfg( "PCMCIA" ); | ||
46 | cfg.setGroup( "Global" ); | ||
47 | int nCards = cfg.readNumEntry( "nCards", 0 ); | ||
48 | QString insert; | ||
49 | |||
50 | for ( int i = 0; i < nCards; ++i ) | ||
51 | { | ||
52 | QString cardSection = QString( "Card_%1" ).arg( i ); | ||
53 | cfg.setGroup( cardSection ); | ||
54 | QString name = cfg.readEntry( "name" ); | ||
55 | odebug << "comparing card '" << cardname << "' with known card '" << name << "'" << oendl; | ||
56 | if ( cardname == name ) | ||
57 | { | ||
58 | insert = cfg.readEntry( "insert" ); | ||
59 | break; | ||
60 | } | ||
61 | } | ||
62 | odebug << "preferred action for card '" << cardname << "' seems to be '" << insert << "'" << oendl; | ||
63 | |||
64 | if ( !insert.isEmpty() ) | ||
65 | { | ||
66 | for ( int i; i < cbAction->count(); ++i ) | ||
67 | if ( cbAction->text( i ) == insert ) cbAction->setCurrentItem( i ); | ||
68 | } | ||
69 | } | ||
70 | |||
71 | ConfigDialog::~ConfigDialog() | ||
72 | { | ||
73 | } | ||