author | drw <drw> | 2003-02-04 17:52:14 (UTC) |
---|---|---|
committer | drw <drw> | 2003-02-04 17:52:14 (UTC) |
commit | 294f0a9b5e5678a6eba1fb77943201fac804049f (patch) (unidiff) | |
tree | b37638264f6bd22bb0894025ea70037294f15c9d /noncore/settings/aqpkg/settingsimpl.cpp | |
parent | 328aeec813c953b260a992afc53a5c9d812e1bcf (diff) | |
download | opie-294f0a9b5e5678a6eba1fb77943201fac804049f.zip opie-294f0a9b5e5678a6eba1fb77943201fac804049f.tar.gz opie-294f0a9b5e5678a6eba1fb77943201fac804049f.tar.bz2 |
Updates to configure dialog
Diffstat (limited to 'noncore/settings/aqpkg/settingsimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/settingsimpl.cpp | 237 |
1 files changed, 204 insertions, 33 deletions
diff --git a/noncore/settings/aqpkg/settingsimpl.cpp b/noncore/settings/aqpkg/settingsimpl.cpp index 4bb928a..c5a55d2 100644 --- a/noncore/settings/aqpkg/settingsimpl.cpp +++ b/noncore/settings/aqpkg/settingsimpl.cpp | |||
@@ -21,7 +21,11 @@ using namespace std; | |||
21 | 21 | ||
22 | #include <qlistbox.h> | 22 | #include <qcheckbox.h> |
23 | #include <qgroupbox.h> | ||
24 | #include <qlabel.h> | ||
25 | #include <qlayout.h> | ||
23 | #include <qlineedit.h> | 26 | #include <qlineedit.h> |
27 | #include <qlistbox.h> | ||
24 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
25 | #include <qtabwidget.h> | 29 | |
26 | #include <qcheckbox.h> | 30 | #include <opie/otabwidget.h> |
27 | 31 | ||
@@ -29,2 +33,3 @@ using namespace std; | |||
29 | #include <qpe/config.h> | 33 | #include <qpe/config.h> |
34 | #include <qpe/resource.h> | ||
30 | #endif | 35 | #endif |
@@ -36,6 +41,21 @@ using namespace std; | |||
36 | SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) | 41 | SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) |
37 | : SettingsBase( parent, name, modal, fl ) | 42 | : QDialog( parent, name, modal, fl ) |
38 | { | 43 | { |
44 | setCaption( tr( "Configuration" ) ); | ||
45 | |||
46 | // Setup layout to make everything pretty | ||
47 | QVBoxLayout *layout = new QVBoxLayout( this ); | ||
48 | layout->setMargin( 2 ); | ||
49 | layout->setSpacing( 4 ); | ||
50 | |||
51 | // Setup tabs for all info | ||
52 | OTabWidget *tabwidget = new OTabWidget( this ); | ||
53 | layout->addWidget( tabwidget ); | ||
54 | |||
55 | tabwidget->addTab( initServerTab(), "aqpkg/servertab", tr( "Servers" ) ); | ||
56 | tabwidget->addTab( initDestinationTab(), "aqpkg/desttab", tr( "Destinations" ) ); | ||
57 | tabwidget->addTab( initProxyTab(), "aqpkg/proxytab", tr( "Proxies" ) ); | ||
58 | tabwidget->setCurrentTab( tr( "Servers" ) ); | ||
59 | |||
39 | dataMgr = dataManager; | 60 | dataMgr = dataManager; |
40 | |||
41 | setupData(); | 61 | setupData(); |
@@ -51,5 +71,4 @@ SettingsImpl :: ~SettingsImpl() | |||
51 | 71 | ||
52 | bool SettingsImpl :: showDlg( int i ) | 72 | bool SettingsImpl :: showDlg() |
53 | { | 73 | { |
54 | TabWidget->setCurrentPage( i ); | ||
55 | showMaximized(); | 74 | showMaximized(); |
@@ -63,2 +82,173 @@ bool SettingsImpl :: showDlg( int i ) | |||
63 | 82 | ||
83 | QWidget *SettingsImpl :: initServerTab() | ||
84 | { | ||
85 | QWidget *control = new QWidget( this ); | ||
86 | |||
87 | QVBoxLayout *vb = new QVBoxLayout( control ); | ||
88 | |||
89 | QScrollView *sv = new QScrollView( control ); | ||
90 | vb->addWidget( sv, 0, 0 ); | ||
91 | sv->setResizePolicy( QScrollView::AutoOneFit ); | ||
92 | sv->setFrameStyle( QFrame::NoFrame ); | ||
93 | |||
94 | QWidget *container = new QWidget( sv->viewport() ); | ||
95 | sv->addChild( container ); | ||
96 | |||
97 | QGridLayout *layout = new QGridLayout( container ); | ||
98 | layout->setSpacing( 2 ); | ||
99 | layout->setMargin( 4 ); | ||
100 | |||
101 | servers = new QListBox( container ); | ||
102 | servers->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); | ||
103 | connect( servers, SIGNAL( highlighted( int ) ), this, SLOT( editServer( int ) ) ); | ||
104 | layout->addMultiCellWidget( servers, 0, 0, 0, 1 ); | ||
105 | |||
106 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); | ||
107 | connect( btn, SIGNAL( clicked() ), this, SLOT( newServer() ) ); | ||
108 | layout->addWidget( btn, 1, 0 ); | ||
109 | |||
110 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); | ||
111 | connect( btn, SIGNAL( clicked() ), this, SLOT( removeServer() ) ); | ||
112 | layout->addWidget( btn, 1, 1 ); | ||
113 | |||
114 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container ); | ||
115 | grpbox->layout()->setSpacing( 2 ); | ||
116 | grpbox->layout()->setMargin( 4 ); | ||
117 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); | ||
118 | |||
119 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); | ||
120 | |||
121 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); | ||
122 | grplayout->addWidget( label, 0, 0 ); | ||
123 | servername = new QLineEdit( grpbox ); | ||
124 | grplayout->addWidget( servername, 0, 1 ); | ||
125 | |||
126 | label = new QLabel( tr( "Address:" ), grpbox ); | ||
127 | grplayout->addWidget( label, 1, 0 ); | ||
128 | serverurl = new QLineEdit( grpbox ); | ||
129 | grplayout->addWidget( serverurl, 1, 1 ); | ||
130 | |||
131 | active = new QCheckBox( tr( "Active Server" ), grpbox ); | ||
132 | grplayout->addMultiCellWidget( active, 2, 2, 0, 1 ); | ||
133 | |||
134 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); | ||
135 | connect( btn, SIGNAL( clicked() ), this, SLOT( changeServerDetails() ) ); | ||
136 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); | ||
137 | |||
138 | return control; | ||
139 | } | ||
140 | |||
141 | QWidget *SettingsImpl :: initDestinationTab() | ||
142 | { | ||
143 | QWidget *control = new QWidget( this ); | ||
144 | |||
145 | QVBoxLayout *vb = new QVBoxLayout( control ); | ||
146 | |||
147 | QScrollView *sv = new QScrollView( control ); | ||
148 | vb->addWidget( sv, 0, 0 ); | ||
149 | sv->setResizePolicy( QScrollView::AutoOneFit ); | ||
150 | sv->setFrameStyle( QFrame::NoFrame ); | ||
151 | |||
152 | QWidget *container = new QWidget( sv->viewport() ); | ||
153 | sv->addChild( container ); | ||
154 | |||
155 | QGridLayout *layout = new QGridLayout( container ); | ||
156 | layout->setSpacing( 2 ); | ||
157 | layout->setMargin( 4 ); | ||
158 | |||
159 | destinations = new QListBox( container ); | ||
160 | destinations->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); | ||
161 | connect( destinations, SIGNAL( highlighted( int ) ), this, SLOT( editDestination( int ) ) ); | ||
162 | layout->addMultiCellWidget( destinations, 0, 0, 0, 1 ); | ||
163 | |||
164 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); | ||
165 | connect( btn, SIGNAL( clicked() ), this, SLOT( newDestination() ) ); | ||
166 | layout->addWidget( btn, 1, 0 ); | ||
167 | |||
168 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); | ||
169 | connect( btn, SIGNAL( clicked() ), this, SLOT( removeDestination() ) ); | ||
170 | layout->addWidget( btn, 1, 1 ); | ||
171 | |||
172 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Destination" ), container ); | ||
173 | grpbox->layout()->setSpacing( 2 ); | ||
174 | grpbox->layout()->setMargin( 4 ); | ||
175 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); | ||
176 | |||
177 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); | ||
178 | |||
179 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); | ||
180 | grplayout->addWidget( label, 0, 0 ); | ||
181 | destinationname = new QLineEdit( grpbox ); | ||
182 | grplayout->addWidget( destinationname, 0, 1 ); | ||
183 | |||
184 | label = new QLabel( tr( "Location:" ), grpbox ); | ||
185 | grplayout->addWidget( label, 1, 0 ); | ||
186 | destinationurl = new QLineEdit( grpbox ); | ||
187 | grplayout->addWidget( destinationurl, 1, 1 ); | ||
188 | |||
189 | linkToRoot = new QCheckBox( tr( "Link to root" ), grpbox ); | ||
190 | grplayout->addMultiCellWidget( linkToRoot, 2, 2, 0, 1 ); | ||
191 | |||
192 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); | ||
193 | connect( btn, SIGNAL( clicked() ), this, SLOT( changeDestinationDetails() ) ); | ||
194 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); | ||
195 | |||
196 | return control; | ||
197 | } | ||
198 | |||
199 | QWidget *SettingsImpl :: initProxyTab() | ||
200 | { | ||
201 | QWidget *control = new QWidget( this ); | ||
202 | |||
203 | QVBoxLayout *vb = new QVBoxLayout( control ); | ||
204 | |||
205 | QScrollView *sv = new QScrollView( control ); | ||
206 | vb->addWidget( sv, 0, 0 ); | ||
207 | sv->setResizePolicy( QScrollView::AutoOneFit ); | ||
208 | sv->setFrameStyle( QFrame::NoFrame ); | ||
209 | |||
210 | QWidget *container = new QWidget( sv->viewport() ); | ||
211 | sv->addChild( container ); | ||
212 | |||
213 | QGridLayout *layout = new QGridLayout( container ); | ||
214 | layout->setSpacing( 2 ); | ||
215 | layout->setMargin( 4 ); | ||
216 | |||
217 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "HTTP Proxy" ), container ); | ||
218 | grpbox->layout()->setSpacing( 2 ); | ||
219 | grpbox->layout()->setMargin( 4 ); | ||
220 | layout->addMultiCellWidget( grpbox, 0, 0, 0, 1 ); | ||
221 | QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() ); | ||
222 | txtHttpProxy = new QLineEdit( grpbox ); | ||
223 | grplayout->addWidget( txtHttpProxy ); | ||
224 | chkHttpProxyEnabled = new QCheckBox( tr( "Enabled" ), grpbox ); | ||
225 | grplayout->addWidget( chkHttpProxyEnabled ); | ||
226 | |||
227 | grpbox = new QGroupBox( 0, Qt::Vertical, tr( "FTP Proxy" ), container ); | ||
228 | grpbox->layout()->setSpacing( 2 ); | ||
229 | grpbox->layout()->setMargin( 4 ); | ||
230 | layout->addMultiCellWidget( grpbox, 1, 1, 0, 1 ); | ||
231 | grplayout = new QVBoxLayout( grpbox->layout() ); | ||
232 | txtFtpProxy = new QLineEdit( grpbox ); | ||
233 | grplayout->addWidget( txtFtpProxy ); | ||
234 | chkFtpProxyEnabled = new QCheckBox( tr( "Enabled" ), grpbox ); | ||
235 | grplayout->addWidget( chkFtpProxyEnabled ); | ||
236 | |||
237 | QLabel *label = new QLabel( tr( "Username:" ), container ); | ||
238 | layout->addWidget( label, 2, 0 ); | ||
239 | txtUsername = new QLineEdit( container ); | ||
240 | layout->addWidget( txtUsername, 2, 1 ); | ||
241 | |||
242 | label = new QLabel( tr( "Password:" ), container ); | ||
243 | layout->addWidget( label, 3, 0 ); | ||
244 | txtPassword = new QLineEdit( container ); | ||
245 | layout->addWidget( txtPassword, 3, 1 ); | ||
246 | |||
247 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), container ); | ||
248 | connect( btn, SIGNAL( clicked() ), this, SLOT( proxyApplyChanges() ) ); | ||
249 | layout->addMultiCellWidget( btn, 4, 4, 0, 1 ); | ||
250 | |||
251 | return control; | ||
252 | } | ||
253 | |||
64 | void SettingsImpl :: setupData() | 254 | void SettingsImpl :: setupData() |
@@ -75,2 +265,3 @@ void SettingsImpl :: setupData() | |||
75 | 265 | ||
266 | |||
76 | // add destinations | 267 | // add destinations |
@@ -79,12 +270,3 @@ void SettingsImpl :: setupData() | |||
79 | destinations->insertItem( it2->getDestinationName() ); | 270 | destinations->insertItem( it2->getDestinationName() ); |
80 | 271 | ||
81 | // setup general tab | ||
82 | #ifdef QWS | ||
83 | Config cfg( "aqpkg" ); | ||
84 | cfg.setGroup( "settings" ); | ||
85 | jumpTo->setChecked( cfg.readBoolEntry( "showJumpTo", "true" ) ); | ||
86 | #else | ||
87 | jumpTo->setChecked( true ); | ||
88 | #endif | ||
89 | |||
90 | // setup proxy tab | 272 | // setup proxy tab |
@@ -102,3 +284,3 @@ void SettingsImpl :: editServer( int sel ) | |||
102 | { | 284 | { |
103 | currentSelectedServer = sel; | 285 | currentSelectedServer = sel; |
104 | vector<Server>::iterator s = dataMgr->getServer( servers->currentText() ); | 286 | vector<Server>::iterator s = dataMgr->getServer( servers->currentText() ); |
@@ -112,6 +294,6 @@ void SettingsImpl :: newServer() | |||
112 | { | 294 | { |
113 | newserver = true; | 295 | newserver = true; |
114 | servername->setText( "" ); | 296 | servername->setText( "" ); |
115 | serverurl->setText( "" ); | 297 | serverurl->setText( "" ); |
116 | servername->setFocus(); | 298 | servername->setFocus(); |
117 | active->setChecked( true ); | 299 | active->setChecked( true ); |
@@ -244,13 +426,2 @@ void SettingsImpl :: changeDestinationDetails() | |||
244 | 426 | ||
245 | //------------------ General tab ---------------------- | ||
246 | |||
247 | void SettingsImpl :: toggleJumpTo( bool val ) | ||
248 | { | ||
249 | #ifdef QWS | ||
250 | Config cfg( "aqpkg" ); | ||
251 | cfg.setGroup( "settings" ); | ||
252 | cfg.writeEntry( "showJumpTo", val ); | ||
253 | #endif | ||
254 | } | ||
255 | |||
256 | //------------------ Proxy tab ---------------------- | 427 | //------------------ Proxy tab ---------------------- |