Diffstat (limited to 'noncore/settings/aqpkg/settingsimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/settingsimpl.cpp | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/noncore/settings/aqpkg/settingsimpl.cpp b/noncore/settings/aqpkg/settingsimpl.cpp index 9c8ec7a..7ffa1d6 100644 --- a/noncore/settings/aqpkg/settingsimpl.cpp +++ b/noncore/settings/aqpkg/settingsimpl.cpp | |||
@@ -1,50 +1,48 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | 3 | ||
4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> | 4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> |
5 | .=l. Dan Williams <drw@handhelds.org> | 5 | .=l. Dan Williams <drw@handhelds.org> |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This file is free software; you can | 7 | _;:, .> :=|. This file is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This file is distributed in the hope that | 14 | .i_,=:_. -<s. This file is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
19 | ..}^=.= = ; Public License for more details. | 19 | ..}^=.= = ; Public License for more details. |
20 | ++= -. .` .: | 20 | ++= -. .` .: |
21 | : = ...= . :.=- You should have received a copy of the GNU | 21 | : = ...= . :.=- You should have received a copy of the GNU |
22 | -. .:....=;==+<; General Public License along with this file; | 22 | -. .:....=;==+<; General Public License along with this file; |
23 | -_. . . )=. = see the file COPYING. If not, write to the | 23 | -_. . . )=. = see the file COPYING. If not, write to the |
24 | -- :-=` Free Software Foundation, Inc., | 24 | -- :-=` Free Software Foundation, Inc., |
25 | 59 Temple Place - Suite 330, | 25 | 59 Temple Place - Suite 330, |
26 | Boston, MA 02111-1307, USA. | 26 | Boston, MA 02111-1307, USA. |
27 | 27 | ||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "settingsimpl.h" | 30 | #include "settingsimpl.h" |
31 | #include "global.h" | 31 | #include "global.h" |
32 | 32 | ||
33 | /* OPIE */ | 33 | /* OPIE */ |
34 | #include <opie2/otabwidget.h> | 34 | #include <opie2/otabwidget.h> |
35 | #ifdef QWS | 35 | #include <opie2/oresource.h> |
36 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
37 | #include <qpe/resource.h> | ||
38 | #endif | ||
39 | #include <qpe/qpeapplication.h> | 37 | #include <qpe/qpeapplication.h> |
40 | 38 | ||
41 | /* QT */ | 39 | /* QT */ |
42 | #include <qcheckbox.h> | 40 | #include <qcheckbox.h> |
43 | #include <qgroupbox.h> | 41 | #include <qgroupbox.h> |
44 | #include <qlabel.h> | 42 | #include <qlabel.h> |
45 | #include <qlayout.h> | 43 | #include <qlayout.h> |
46 | #include <qlineedit.h> | 44 | #include <qlineedit.h> |
47 | #include <qlistbox.h> | 45 | #include <qlistbox.h> |
48 | #include <qpushbutton.h> | 46 | #include <qpushbutton.h> |
49 | 47 | ||
50 | using namespace Opie::Ui; | 48 | using namespace Opie::Ui; |
@@ -102,53 +100,54 @@ QWidget *SettingsImpl :: initServerTab() | |||
102 | QWidget *container = new QWidget( sv->viewport() ); | 100 | QWidget *container = new QWidget( sv->viewport() ); |
103 | sv->addChild( container ); | 101 | sv->addChild( container ); |
104 | 102 | ||
105 | QGridLayout *layout = new QGridLayout( container ); | 103 | QGridLayout *layout = new QGridLayout( container ); |
106 | layout->setSpacing( 2 ); | 104 | layout->setSpacing( 2 ); |
107 | layout->setMargin( 4 ); | 105 | layout->setMargin( 4 ); |
108 | 106 | ||
109 | servers = new QListBox( container ); | 107 | servers = new QListBox( container ); |
110 | servers->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); | 108 | servers->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); |
111 | connect( servers, SIGNAL( highlighted(int) ), this, SLOT( editServer(int) ) ); | 109 | connect( servers, SIGNAL( highlighted(int) ), this, SLOT( editServer(int) ) ); |
112 | layout->addMultiCellWidget( servers, 0, 0, 0, 1 ); | 110 | layout->addMultiCellWidget( servers, 0, 0, 0, 1 ); |
113 | 111 | ||
114 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); | 112 | QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ), |
113 | tr( "New" ), container ); | ||
115 | connect( btn, SIGNAL( clicked() ), this, SLOT( newServer() ) ); | 114 | connect( btn, SIGNAL( clicked() ), this, SLOT( newServer() ) ); |
116 | layout->addWidget( btn, 1, 0 ); | 115 | layout->addWidget( btn, 1, 0 ); |
117 | 116 | ||
118 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); | 117 | btn = new QPushButton( Opie::Core::OResource::loadPixmap( "trash", Opie::Core::OResource::SmallIcon ), tr( "Delete" ), container ); |
119 | connect( btn, SIGNAL( clicked() ), this, SLOT( removeServer() ) ); | 118 | connect( btn, SIGNAL( clicked() ), this, SLOT( removeServer() ) ); |
120 | layout->addWidget( btn, 1, 1 ); | 119 | layout->addWidget( btn, 1, 1 ); |
121 | 120 | ||
122 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container ); | 121 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container ); |
123 | grpbox->layout()->setSpacing( 2 ); | 122 | grpbox->layout()->setSpacing( 2 ); |
124 | grpbox->layout()->setMargin( 4 ); | 123 | grpbox->layout()->setMargin( 4 ); |
125 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); | 124 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); |
126 | 125 | ||
127 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); | 126 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); |
128 | 127 | ||
129 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); | 128 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); |
130 | grplayout->addWidget( label, 0, 0 ); | 129 | grplayout->addWidget( label, 0, 0 ); |
131 | servername = new QLineEdit( grpbox ); | 130 | servername = new QLineEdit( grpbox ); |
132 | grplayout->addWidget( servername, 0, 1 ); | 131 | grplayout->addWidget( servername, 0, 1 ); |
133 | 132 | ||
134 | label = new QLabel( tr( "Address:" ), grpbox ); | 133 | label = new QLabel( tr( "Address:" ), grpbox ); |
135 | grplayout->addWidget( label, 1, 0 ); | 134 | grplayout->addWidget( label, 1, 0 ); |
136 | serverurl = new QLineEdit( grpbox ); | 135 | serverurl = new QLineEdit( grpbox ); |
137 | grplayout->addWidget( serverurl, 1, 1 ); | 136 | grplayout->addWidget( serverurl, 1, 1 ); |
138 | 137 | ||
139 | active = new QCheckBox( tr( "Active Server" ), grpbox ); | 138 | active = new QCheckBox( tr( "Active Server" ), grpbox ); |
140 | grplayout->addMultiCellWidget( active, 2, 2, 0, 1 ); | 139 | grplayout->addMultiCellWidget( active, 2, 2, 0, 1 ); |
141 | 140 | ||
142 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); | 141 | btn = new QPushButton( Opie::Core::OResource::loadPixmap( "edit", Opie::Core::OResource::SmallIcon ), tr( "Update" ), grpbox ); |
143 | connect( btn, SIGNAL( clicked() ), this, SLOT( changeServerDetails() ) ); | 142 | connect( btn, SIGNAL( clicked() ), this, SLOT( changeServerDetails() ) ); |
144 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); | 143 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); |
145 | 144 | ||
146 | return control; | 145 | return control; |
147 | } | 146 | } |
148 | 147 | ||
149 | QWidget *SettingsImpl :: initDestinationTab() | 148 | QWidget *SettingsImpl :: initDestinationTab() |
150 | { | 149 | { |
151 | QWidget *control = new QWidget( this ); | 150 | QWidget *control = new QWidget( this ); |
152 | 151 | ||
153 | QVBoxLayout *vb = new QVBoxLayout( control ); | 152 | QVBoxLayout *vb = new QVBoxLayout( control ); |
154 | 153 | ||
@@ -160,53 +159,53 @@ QWidget *SettingsImpl :: initDestinationTab() | |||
160 | QWidget *container = new QWidget( sv->viewport() ); | 159 | QWidget *container = new QWidget( sv->viewport() ); |
161 | sv->addChild( container ); | 160 | sv->addChild( container ); |
162 | 161 | ||
163 | QGridLayout *layout = new QGridLayout( container ); | 162 | QGridLayout *layout = new QGridLayout( container ); |
164 | layout->setSpacing( 2 ); | 163 | layout->setSpacing( 2 ); |
165 | layout->setMargin( 4 ); | 164 | layout->setMargin( 4 ); |
166 | 165 | ||
167 | destinations = new QListBox( container ); | 166 | destinations = new QListBox( container ); |
168 | destinations->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); | 167 | destinations->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); |
169 | connect( destinations, SIGNAL( highlighted(int) ), this, SLOT( editDestination(int) ) ); | 168 | connect( destinations, SIGNAL( highlighted(int) ), this, SLOT( editDestination(int) ) ); |
170 | layout->addMultiCellWidget( destinations, 0, 0, 0, 1 ); | 169 | layout->addMultiCellWidget( destinations, 0, 0, 0, 1 ); |
171 | 170 | ||
172 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); | 171 | QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ), tr( "New" ), container ); |
173 | connect( btn, SIGNAL( clicked() ), this, SLOT( newDestination() ) ); | 172 | connect( btn, SIGNAL( clicked() ), this, SLOT( newDestination() ) ); |
174 | layout->addWidget( btn, 1, 0 ); | 173 | layout->addWidget( btn, 1, 0 ); |
175 | 174 | ||
176 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); | 175 | btn = new QPushButton( Opie::Core::OResource::loadPixmap( "trash", Opie::Core::OResource::SmallIcon ), tr( "Delete" ), container ); |
177 | connect( btn, SIGNAL( clicked() ), this, SLOT( removeDestination() ) ); | 176 | connect( btn, SIGNAL( clicked() ), this, SLOT( removeDestination() ) ); |
178 | layout->addWidget( btn, 1, 1 ); | 177 | layout->addWidget( btn, 1, 1 ); |
179 | 178 | ||
180 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Destination" ), container ); | 179 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Destination" ), container ); |
181 | grpbox->layout()->setSpacing( 2 ); | 180 | grpbox->layout()->setSpacing( 2 ); |
182 | grpbox->layout()->setMargin( 4 ); | 181 | grpbox->layout()->setMargin( 4 ); |
183 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); | 182 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); |
184 | 183 | ||
185 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); | 184 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); |
186 | 185 | ||
187 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); | 186 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); |
188 | grplayout->addWidget( label, 0, 0 ); | 187 | grplayout->addWidget( label, 0, 0 ); |
189 | destinationname = new QLineEdit( grpbox ); | 188 | destinationname = new QLineEdit( grpbox ); |
190 | grplayout->addWidget( destinationname, 0, 1 ); | 189 | grplayout->addWidget( destinationname, 0, 1 ); |
191 | 190 | ||
192 | label = new QLabel( tr( "Location:" ), grpbox ); | 191 | label = new QLabel( tr( "Location:" ), grpbox ); |
193 | grplayout->addWidget( label, 1, 0 ); | 192 | grplayout->addWidget( label, 1, 0 ); |
194 | destinationurl = new QLineEdit( grpbox ); | 193 | destinationurl = new QLineEdit( grpbox ); |
195 | grplayout->addWidget( destinationurl, 1, 1 ); | 194 | grplayout->addWidget( destinationurl, 1, 1 ); |
196 | 195 | ||
197 | linkToRoot = new QCheckBox( tr( "Link to root" ), grpbox ); | 196 | linkToRoot = new QCheckBox( tr( "Link to root" ), grpbox ); |
198 | grplayout->addMultiCellWidget( linkToRoot, 2, 2, 0, 1 ); | 197 | grplayout->addMultiCellWidget( linkToRoot, 2, 2, 0, 1 ); |
199 | 198 | ||
200 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); | 199 | btn = new QPushButton( Opie::Core::OResource::loadPixmap( "edit", Opie::Core::OResource::SmallIcon ), tr( "Update" ), grpbox ); |
201 | connect( btn, SIGNAL( clicked() ), this, SLOT( changeDestinationDetails() ) ); | 200 | connect( btn, SIGNAL( clicked() ), this, SLOT( changeDestinationDetails() ) ); |
202 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); | 201 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); |
203 | 202 | ||
204 | return control; | 203 | return control; |
205 | } | 204 | } |
206 | 205 | ||
207 | QWidget *SettingsImpl :: initProxyTab() | 206 | QWidget *SettingsImpl :: initProxyTab() |
208 | { | 207 | { |
209 | QWidget *control = new QWidget( this ); | 208 | QWidget *control = new QWidget( this ); |
210 | 209 | ||
211 | QVBoxLayout *vb = new QVBoxLayout( control ); | 210 | QVBoxLayout *vb = new QVBoxLayout( control ); |
212 | 211 | ||
@@ -243,25 +242,25 @@ QWidget *SettingsImpl :: initProxyTab() | |||
243 | grplayout->addWidget( chkFtpProxyEnabled ); | 242 | grplayout->addWidget( chkFtpProxyEnabled ); |
244 | 243 | ||
245 | QLabel *label = new QLabel( tr( "Username:" ), container ); | 244 | QLabel *label = new QLabel( tr( "Username:" ), container ); |
246 | layout->addWidget( label, 2, 0 ); | 245 | layout->addWidget( label, 2, 0 ); |
247 | txtUsername = new QLineEdit( container ); | 246 | txtUsername = new QLineEdit( container ); |
248 | layout->addWidget( txtUsername, 2, 1 ); | 247 | layout->addWidget( txtUsername, 2, 1 ); |
249 | 248 | ||
250 | label = new QLabel( tr( "Password:" ), container ); | 249 | label = new QLabel( tr( "Password:" ), container ); |
251 | layout->addWidget( label, 3, 0 ); | 250 | layout->addWidget( label, 3, 0 ); |
252 | txtPassword = new QLineEdit( container ); | 251 | txtPassword = new QLineEdit( container ); |
253 | layout->addWidget( txtPassword, 3, 1 ); | 252 | layout->addWidget( txtPassword, 3, 1 ); |
254 | 253 | ||
255 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), container ); | 254 | QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "edit", Opie::Core::OResource::SmallIcon ), tr( "Update" ), container ); |
256 | connect( btn, SIGNAL( clicked() ), this, SLOT( proxyApplyChanges() ) ); | 255 | connect( btn, SIGNAL( clicked() ), this, SLOT( proxyApplyChanges() ) ); |
257 | layout->addMultiCellWidget( btn, 4, 4, 0, 1 ); | 256 | layout->addMultiCellWidget( btn, 4, 4, 0, 1 ); |
258 | 257 | ||
259 | return control; | 258 | return control; |
260 | } | 259 | } |
261 | 260 | ||
262 | void SettingsImpl :: setupData() | 261 | void SettingsImpl :: setupData() |
263 | { | 262 | { |
264 | // add servers | 263 | // add servers |
265 | QString serverName; | 264 | QString serverName; |
266 | QListIterator<Server> it( dataMgr->getServerList() ); | 265 | QListIterator<Server> it( dataMgr->getServerList() ); |
267 | for ( ; it.current(); ++it ) | 266 | for ( ; it.current(); ++it ) |