-rw-r--r-- | noncore/settings/packagemanager/oipkgconfigdlg.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp index 25052f8..886430f 100644 --- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp +++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp | |||
@@ -162,480 +162,479 @@ void OIpkgConfigDlg::initServerWidget() | |||
162 | vb->addWidget( sv, 0, 0 ); | 162 | vb->addWidget( sv, 0, 0 ); |
163 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 163 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
164 | sv->setFrameStyle( QFrame::NoFrame ); | 164 | sv->setFrameStyle( QFrame::NoFrame ); |
165 | QWidget *container = new QWidget( sv->viewport() ); | 165 | QWidget *container = new QWidget( sv->viewport() ); |
166 | sv->addChild( container ); | 166 | sv->addChild( container ); |
167 | QGridLayout *layout = new QGridLayout( container, 3, 2, 2, 4 ); | 167 | QGridLayout *layout = new QGridLayout( container, 3, 2, 2, 4 ); |
168 | 168 | ||
169 | m_serverList = new QListBox( container ); | 169 | m_serverList = new QListBox( container ); |
170 | QWhatsThis::add( m_serverList, tr( "This is a list of all servers configured. Select one here to edit or delete, or add a new one below." ) ); | 170 | QWhatsThis::add( m_serverList, tr( "This is a list of all servers configured. Select one here to edit or delete, or add a new one below." ) ); |
171 | m_serverList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); | 171 | m_serverList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); |
172 | connect( m_serverList, SIGNAL(highlighted(int)), this, SLOT(slotServerEdit(int)) ); | 172 | connect( m_serverList, SIGNAL(highlighted(int)), this, SLOT(slotServerEdit(int)) ); |
173 | layout->addMultiCellWidget( m_serverList, 0, 0, 0, 1 ); | 173 | layout->addMultiCellWidget( m_serverList, 0, 0, 0, 1 ); |
174 | 174 | ||
175 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); | 175 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); |
176 | QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) ); | 176 | QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) ); |
177 | connect( btn, SIGNAL(clicked()), this, SLOT(slotServerNew()) ); | 177 | connect( btn, SIGNAL(clicked()), this, SLOT(slotServerNew()) ); |
178 | layout->addWidget( btn, 1, 0 ); | 178 | layout->addWidget( btn, 1, 0 ); |
179 | 179 | ||
180 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); | 180 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); |
181 | QWhatsThis::add( btn, tr( "Tap here to delete the entry selected above." ) ); | 181 | QWhatsThis::add( btn, tr( "Tap here to delete the entry selected above." ) ); |
182 | connect( btn, SIGNAL(clicked()), this, SLOT(slotServerDelete()) ); | 182 | connect( btn, SIGNAL(clicked()), this, SLOT(slotServerDelete()) ); |
183 | layout->addWidget( btn, 1, 1 ); | 183 | layout->addWidget( btn, 1, 1 ); |
184 | 184 | ||
185 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container ); | 185 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container ); |
186 | grpbox->layout()->setSpacing( 2 ); | 186 | grpbox->layout()->setSpacing( 2 ); |
187 | grpbox->layout()->setMargin( 4 ); | 187 | grpbox->layout()->setMargin( 4 ); |
188 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); | 188 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); |
189 | 189 | ||
190 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); | 190 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); |
191 | 191 | ||
192 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); | 192 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); |
193 | QWhatsThis::add( label, tr( "Enter the name of this entry here." ) ); | 193 | QWhatsThis::add( label, tr( "Enter the name of this entry here." ) ); |
194 | grplayout->addWidget( label, 0, 0 ); | 194 | grplayout->addWidget( label, 0, 0 ); |
195 | m_serverName = new QLineEdit( grpbox ); | 195 | m_serverName = new QLineEdit( grpbox ); |
196 | QWhatsThis::add( m_serverName, tr( "Enter the name of this entry here." ) ); | 196 | QWhatsThis::add( m_serverName, tr( "Enter the name of this entry here." ) ); |
197 | grplayout->addWidget( m_serverName, 0, 1 ); | 197 | grplayout->addWidget( m_serverName, 0, 1 ); |
198 | 198 | ||
199 | label = new QLabel( tr( "Address:" ), grpbox ); | 199 | label = new QLabel( tr( "Address:" ), grpbox ); |
200 | QWhatsThis::add( label, tr( "Enter the URL address of this entry here." ) ); | 200 | QWhatsThis::add( label, tr( "Enter the URL address of this entry here." ) ); |
201 | grplayout->addWidget( label, 1, 0 ); | 201 | grplayout->addWidget( label, 1, 0 ); |
202 | m_serverLocation = new QLineEdit( grpbox ); | 202 | m_serverLocation = new QLineEdit( grpbox ); |
203 | QWhatsThis::add( m_serverLocation, tr( "Enter the URL address of this entry here." ) ); | 203 | QWhatsThis::add( m_serverLocation, tr( "Enter the URL address of this entry here." ) ); |
204 | grplayout->addWidget( m_serverLocation, 1, 1 ); | 204 | grplayout->addWidget( m_serverLocation, 1, 1 ); |
205 | 205 | ||
206 | m_serverActive = new QCheckBox( tr( "Active" ), grpbox ); | 206 | m_serverActive = new QCheckBox( tr( "Active" ), grpbox ); |
207 | QWhatsThis::add( m_serverActive, tr( "Tap here to indicate whether this entry is active or not." ) ); | 207 | QWhatsThis::add( m_serverActive, tr( "Tap here to indicate whether this entry is active or not." ) ); |
208 | grplayout->addMultiCellWidget( m_serverActive, 2, 2, 0, 1 ); | 208 | grplayout->addMultiCellWidget( m_serverActive, 2, 2, 0, 1 ); |
209 | 209 | ||
210 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); | 210 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); |
211 | QWhatsThis::add( btn, tr( "Tap here to update the entry's information." ) ); | 211 | QWhatsThis::add( btn, tr( "Tap here to update the entry's information." ) ); |
212 | connect( btn, SIGNAL(clicked()), this, SLOT(slotServerUpdate()) ); | 212 | connect( btn, SIGNAL(clicked()), this, SLOT(slotServerUpdate()) ); |
213 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); | 213 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); |
214 | } | 214 | } |
215 | 215 | ||
216 | void OIpkgConfigDlg::initDestinationWidget() | 216 | void OIpkgConfigDlg::initDestinationWidget() |
217 | { | 217 | { |
218 | m_destWidget = new QWidget( this ); | 218 | m_destWidget = new QWidget( this ); |
219 | 219 | ||
220 | // Initialize UI | 220 | // Initialize UI |
221 | QVBoxLayout *vb = new QVBoxLayout( m_destWidget ); | 221 | QVBoxLayout *vb = new QVBoxLayout( m_destWidget ); |
222 | QScrollView *sv = new QScrollView( m_destWidget ); | 222 | QScrollView *sv = new QScrollView( m_destWidget ); |
223 | vb->addWidget( sv, 0, 0 ); | 223 | vb->addWidget( sv, 0, 0 ); |
224 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 224 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
225 | sv->setFrameStyle( QFrame::NoFrame ); | 225 | sv->setFrameStyle( QFrame::NoFrame ); |
226 | QWidget *container = new QWidget( sv->viewport() ); | 226 | QWidget *container = new QWidget( sv->viewport() ); |
227 | sv->addChild( container ); | 227 | sv->addChild( container ); |
228 | QGridLayout *layout = new QGridLayout( container, 3, 2, 2, 4 ); | 228 | QGridLayout *layout = new QGridLayout( container, 3, 2, 2, 4 ); |
229 | 229 | ||
230 | m_destList = new QListBox( container ); | 230 | m_destList = new QListBox( container ); |
231 | QWhatsThis::add( m_destList, tr( "This is a list of all destinations configured for this device. Select one here to edit or delete, or add a new one below." ) ); | 231 | QWhatsThis::add( m_destList, tr( "This is a list of all destinations configured for this device. Select one here to edit or delete, or add a new one below." ) ); |
232 | m_destList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); | 232 | m_destList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); |
233 | connect( m_destList, SIGNAL(highlighted(int)), this, SLOT(slotDestEdit(int)) ); | 233 | connect( m_destList, SIGNAL(highlighted(int)), this, SLOT(slotDestEdit(int)) ); |
234 | layout->addMultiCellWidget( m_destList, 0, 0, 0, 1 ); | 234 | layout->addMultiCellWidget( m_destList, 0, 0, 0, 1 ); |
235 | 235 | ||
236 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); | 236 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); |
237 | QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) ); | 237 | QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) ); |
238 | connect( btn, SIGNAL(clicked()), this, SLOT(slotDestNew()) ); | 238 | connect( btn, SIGNAL(clicked()), this, SLOT(slotDestNew()) ); |
239 | layout->addWidget( btn, 1, 0 ); | 239 | layout->addWidget( btn, 1, 0 ); |
240 | 240 | ||
241 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); | 241 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); |
242 | QWhatsThis::add( btn, tr( "Tap here to delete the entry selected above." ) ); | 242 | QWhatsThis::add( btn, tr( "Tap here to delete the entry selected above." ) ); |
243 | connect( btn, SIGNAL(clicked()), this, SLOT(slotDestDelete()) ); | 243 | connect( btn, SIGNAL(clicked()), this, SLOT(slotDestDelete()) ); |
244 | layout->addWidget( btn, 1, 1 ); | 244 | layout->addWidget( btn, 1, 1 ); |
245 | 245 | ||
246 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Destination" ), container ); | 246 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Destination" ), container ); |
247 | grpbox->layout()->setSpacing( 2 ); | 247 | grpbox->layout()->setSpacing( 2 ); |
248 | grpbox->layout()->setMargin( 4 ); | 248 | grpbox->layout()->setMargin( 4 ); |
249 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); | 249 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); |
250 | 250 | ||
251 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); | 251 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); |
252 | 252 | ||
253 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); | 253 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); |
254 | QWhatsThis::add( label, tr( "Enter the name of this entry here." ) ); | 254 | QWhatsThis::add( label, tr( "Enter the name of this entry here." ) ); |
255 | grplayout->addWidget( label, 0, 0 ); | 255 | grplayout->addWidget( label, 0, 0 ); |
256 | m_destName = new QLineEdit( grpbox ); | 256 | m_destName = new QLineEdit( grpbox ); |
257 | QWhatsThis::add( m_destName, tr( "Enter the name of this entry here." ) ); | 257 | QWhatsThis::add( m_destName, tr( "Enter the name of this entry here." ) ); |
258 | grplayout->addMultiCellWidget( m_destName, 0, 0, 1, 2 ); | 258 | grplayout->addMultiCellWidget( m_destName, 0, 0, 1, 2 ); |
259 | 259 | ||
260 | label = new QLabel( tr( "Location:" ), grpbox ); | 260 | label = new QLabel( tr( "Location:" ), grpbox ); |
261 | QWhatsThis::add( label, tr( "Enter the absolute directory path of this entry here." ) ); | 261 | QWhatsThis::add( label, tr( "Enter the absolute directory path of this entry here." ) ); |
262 | grplayout->addWidget( label, 1, 0 ); | 262 | grplayout->addWidget( label, 1, 0 ); |
263 | m_destLocation = new QLineEdit( grpbox ); | 263 | m_destLocation = new QLineEdit( grpbox ); |
264 | QWhatsThis::add( m_destLocation, tr( "Enter the absolute directory path of this entry here." ) ); | 264 | QWhatsThis::add( m_destLocation, tr( "Enter the absolute directory path of this entry here." ) ); |
265 | grplayout->addWidget( m_destLocation, 1, 1 ); | 265 | grplayout->addWidget( m_destLocation, 1, 1 ); |
266 | btn = new QPushButton( Resource::loadPixmap( "folder" ), QString::null, grpbox ); | 266 | btn = new QPushButton( Resource::loadPixmap( "folder" ), QString::null, grpbox ); |
267 | btn->setMaximumWidth( btn->height() ); | 267 | btn->setMaximumWidth( btn->height() ); |
268 | QWhatsThis::add( btn, tr( "Tap here to select the desired location." ) ); | 268 | QWhatsThis::add( btn, tr( "Tap here to select the desired location." ) ); |
269 | connect( btn, SIGNAL(clicked()), this, SLOT(slotDestSelectPath()) ); | 269 | connect( btn, SIGNAL(clicked()), this, SLOT(slotDestSelectPath()) ); |
270 | grplayout->addWidget( btn, 1, 2 ); | 270 | grplayout->addWidget( btn, 1, 2 ); |
271 | 271 | ||
272 | m_destActive = new QCheckBox( tr( "Active" ), grpbox ); | 272 | m_destActive = new QCheckBox( tr( "Active" ), grpbox ); |
273 | QWhatsThis::add( m_destActive, tr( "Tap here to indicate whether this entry is active or not." ) ); | 273 | QWhatsThis::add( m_destActive, tr( "Tap here to indicate whether this entry is active or not." ) ); |
274 | grplayout->addMultiCellWidget( m_destActive, 2, 2, 0, 2 ); | 274 | grplayout->addMultiCellWidget( m_destActive, 2, 2, 0, 2 ); |
275 | 275 | ||
276 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); | 276 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); |
277 | QWhatsThis::add( btn, tr( "Tap here to update the entry's information." ) ); | 277 | QWhatsThis::add( btn, tr( "Tap here to update the entry's information." ) ); |
278 | connect( btn, SIGNAL(clicked()), this, SLOT(slotDestUpdate()) ); | 278 | connect( btn, SIGNAL(clicked()), this, SLOT(slotDestUpdate()) ); |
279 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 2 ); | 279 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 2 ); |
280 | } | 280 | } |
281 | 281 | ||
282 | void OIpkgConfigDlg::initProxyWidget() | 282 | void OIpkgConfigDlg::initProxyWidget() |
283 | { | 283 | { |
284 | m_proxyWidget = new QWidget( this ); | 284 | m_proxyWidget = new QWidget( this ); |
285 | 285 | ||
286 | // Initialize UI | 286 | // Initialize UI |
287 | QVBoxLayout *vb = new QVBoxLayout( m_proxyWidget ); | 287 | QVBoxLayout *vb = new QVBoxLayout( m_proxyWidget ); |
288 | QScrollView *sv = new QScrollView( m_proxyWidget ); | 288 | QScrollView *sv = new QScrollView( m_proxyWidget ); |
289 | vb->addWidget( sv, 0, 0 ); | 289 | vb->addWidget( sv, 0, 0 ); |
290 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 290 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
291 | sv->setFrameStyle( QFrame::NoFrame ); | 291 | sv->setFrameStyle( QFrame::NoFrame ); |
292 | QWidget *container = new QWidget( sv->viewport() ); | 292 | QWidget *container = new QWidget( sv->viewport() ); |
293 | sv->addChild( container ); | 293 | sv->addChild( container ); |
294 | QGridLayout *layout = new QGridLayout( container, 4, 2, 2, 4 ); | 294 | QGridLayout *layout = new QGridLayout( container, 4, 2, 2, 4 ); |
295 | 295 | ||
296 | // HTTP proxy server configuration | 296 | // HTTP proxy server configuration |
297 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "HTTP Proxy" ), container ); | 297 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "HTTP Proxy" ), container ); |
298 | grpbox->layout()->setSpacing( 2 ); | 298 | grpbox->layout()->setSpacing( 2 ); |
299 | grpbox->layout()->setMargin( 4 ); | 299 | grpbox->layout()->setMargin( 4 ); |
300 | layout->addMultiCellWidget( grpbox, 0, 0, 0, 1 ); | 300 | layout->addMultiCellWidget( grpbox, 0, 0, 0, 1 ); |
301 | QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() ); | 301 | QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() ); |
302 | m_proxyHttpServer = new QLineEdit( grpbox ); | 302 | m_proxyHttpServer = new QLineEdit( grpbox ); |
303 | QWhatsThis::add( m_proxyHttpServer, tr( "Enter the URL address of the HTTP proxy server here." ) ); | 303 | QWhatsThis::add( m_proxyHttpServer, tr( "Enter the URL address of the HTTP proxy server here." ) ); |
304 | grplayout->addWidget( m_proxyHttpServer ); | 304 | grplayout->addWidget( m_proxyHttpServer ); |
305 | m_proxyHttpActive = new QCheckBox( tr( "Enabled" ), grpbox ); | 305 | m_proxyHttpActive = new QCheckBox( tr( "Enabled" ), grpbox ); |
306 | QWhatsThis::add( m_proxyHttpActive, tr( "Tap here to enable or disable the HTTP proxy server." ) ); | 306 | QWhatsThis::add( m_proxyHttpActive, tr( "Tap here to enable or disable the HTTP proxy server." ) ); |
307 | grplayout->addWidget( m_proxyHttpActive ); | 307 | grplayout->addWidget( m_proxyHttpActive ); |
308 | 308 | ||
309 | // FTP proxy server configuration | 309 | // FTP proxy server configuration |
310 | grpbox = new QGroupBox( 0, Qt::Vertical, tr( "FTP Proxy" ), container ); | 310 | grpbox = new QGroupBox( 0, Qt::Vertical, tr( "FTP Proxy" ), container ); |
311 | grpbox->layout()->setSpacing( 2 ); | 311 | grpbox->layout()->setSpacing( 2 ); |
312 | grpbox->layout()->setMargin( 4 ); | 312 | grpbox->layout()->setMargin( 4 ); |
313 | layout->addMultiCellWidget( grpbox, 1, 1, 0, 1 ); | 313 | layout->addMultiCellWidget( grpbox, 1, 1, 0, 1 ); |
314 | grplayout = new QVBoxLayout( grpbox->layout() ); | 314 | grplayout = new QVBoxLayout( grpbox->layout() ); |
315 | m_proxyFtpServer = new QLineEdit( grpbox ); | 315 | m_proxyFtpServer = new QLineEdit( grpbox ); |
316 | QWhatsThis::add( m_proxyFtpServer, tr( "Enter the URL address of the FTP proxy server here." ) ); | 316 | QWhatsThis::add( m_proxyFtpServer, tr( "Enter the URL address of the FTP proxy server here." ) ); |
317 | grplayout->addWidget( m_proxyFtpServer ); | 317 | grplayout->addWidget( m_proxyFtpServer ); |
318 | m_proxyFtpActive = new QCheckBox( tr( "Enabled" ), grpbox ); | 318 | m_proxyFtpActive = new QCheckBox( tr( "Enabled" ), grpbox ); |
319 | QWhatsThis::add( m_proxyFtpActive, tr( "Tap here to enable or disable the FTP proxy server." ) ); | 319 | QWhatsThis::add( m_proxyFtpActive, tr( "Tap here to enable or disable the FTP proxy server." ) ); |
320 | grplayout->addWidget( m_proxyFtpActive ); | 320 | grplayout->addWidget( m_proxyFtpActive ); |
321 | 321 | ||
322 | // Proxy server username and password configuration | 322 | // Proxy server username and password configuration |
323 | QLabel *label = new QLabel( tr( "Username:" ), container ); | 323 | QLabel *label = new QLabel( tr( "Username:" ), container ); |
324 | QWhatsThis::add( label, tr( "Enter the username for the proxy servers here." ) ); | 324 | QWhatsThis::add( label, tr( "Enter the username for the proxy servers here." ) ); |
325 | layout->addWidget( label, 2, 0 ); | 325 | layout->addWidget( label, 2, 0 ); |
326 | m_proxyUsername = new QLineEdit( container ); | 326 | m_proxyUsername = new QLineEdit( container ); |
327 | QWhatsThis::add( m_proxyUsername, tr( "Enter the username for the proxy servers here." ) ); | 327 | QWhatsThis::add( m_proxyUsername, tr( "Enter the username for the proxy servers here." ) ); |
328 | layout->addWidget( m_proxyUsername, 2, 1 ); | 328 | layout->addWidget( m_proxyUsername, 2, 1 ); |
329 | 329 | ||
330 | label = new QLabel( tr( "Password:" ), container ); | 330 | label = new QLabel( tr( "Password:" ), container ); |
331 | QWhatsThis::add( label, tr( "Enter the password for the proxy servers here." ) ); | 331 | QWhatsThis::add( label, tr( "Enter the password for the proxy servers here." ) ); |
332 | layout->addWidget( label, 3, 0 ); | 332 | layout->addWidget( label, 3, 0 ); |
333 | m_proxyPassword = new QLineEdit( container ); | 333 | m_proxyPassword = new QLineEdit( container ); |
334 | QWhatsThis::add( m_proxyPassword, tr( "Enter the password for the proxy servers here." ) ); | 334 | QWhatsThis::add( m_proxyPassword, tr( "Enter the password for the proxy servers here." ) ); |
335 | layout->addWidget( m_proxyPassword, 3, 1 ); | 335 | layout->addWidget( m_proxyPassword, 3, 1 ); |
336 | } | 336 | } |
337 | 337 | ||
338 | void OIpkgConfigDlg::initOptionsWidget() | 338 | void OIpkgConfigDlg::initOptionsWidget() |
339 | { | 339 | { |
340 | m_optionsWidget = new QWidget( this ); | 340 | m_optionsWidget = new QWidget( this ); |
341 | 341 | ||
342 | // Initialize UI | 342 | // Initialize UI |
343 | QVBoxLayout *vb = new QVBoxLayout( m_optionsWidget ); | 343 | QVBoxLayout *vb = new QVBoxLayout( m_optionsWidget ); |
344 | QScrollView *sv = new QScrollView( m_optionsWidget ); | 344 | QScrollView *sv = new QScrollView( m_optionsWidget ); |
345 | vb->addWidget( sv, 0, 0 ); | 345 | vb->addWidget( sv, 0, 0 ); |
346 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 346 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
347 | sv->setFrameStyle( QFrame::NoFrame ); | 347 | sv->setFrameStyle( QFrame::NoFrame ); |
348 | QWidget *container = new QWidget( sv->viewport() ); | 348 | QWidget *container = new QWidget( sv->viewport() ); |
349 | sv->addChild( container ); | 349 | sv->addChild( container ); |
350 | QVBoxLayout *layout = new QVBoxLayout( container, 2, 4 ); | 350 | QVBoxLayout *layout = new QVBoxLayout( container, 2, 4 ); |
351 | 351 | ||
352 | m_optForceDepends = new QCheckBox( tr( "Force Depends" ), container ); | 352 | m_optForceDepends = new QCheckBox( tr( "Force Depends" ), container ); |
353 | QWhatsThis::add( m_optForceDepends, tr( "Tap here to enable or disable the '-force-depends' option for Ipkg." ) ); | 353 | QWhatsThis::add( m_optForceDepends, tr( "Tap here to enable or disable the '-force-depends' option for Ipkg." ) ); |
354 | layout->addWidget( m_optForceDepends ); | 354 | layout->addWidget( m_optForceDepends ); |
355 | 355 | ||
356 | m_optForceReinstall = new QCheckBox( tr( "Force Reinstall" ), container ); | 356 | m_optForceReinstall = new QCheckBox( tr( "Force Reinstall" ), container ); |
357 | QWhatsThis::add( m_optForceReinstall, tr( "Tap here to enable or disable the '-force-reinstall' option for Ipkg." ) ); | 357 | QWhatsThis::add( m_optForceReinstall, tr( "Tap here to enable or disable the '-force-reinstall' option for Ipkg." ) ); |
358 | layout->addWidget( m_optForceReinstall ); | 358 | layout->addWidget( m_optForceReinstall ); |
359 | 359 | ||
360 | m_optForceRemove = new QCheckBox( tr( "Force Remove" ), container ); | 360 | m_optForceRemove = new QCheckBox( tr( "Force Remove" ), container ); |
361 | QWhatsThis::add( m_optForceRemove, tr( "Tap here to enable or disable the '-force-removal-of-dependent-packages' option for Ipkg." ) ); | 361 | QWhatsThis::add( m_optForceRemove, tr( "Tap here to enable or disable the '-force-removal-of-dependent-packages' option for Ipkg." ) ); |
362 | layout->addWidget( m_optForceRemove ); | 362 | layout->addWidget( m_optForceRemove ); |
363 | 363 | ||
364 | m_optForceOverwrite = new QCheckBox( tr( "Force Overwrite" ), container ); | 364 | m_optForceOverwrite = new QCheckBox( tr( "Force Overwrite" ), container ); |
365 | QWhatsThis::add( m_optForceOverwrite, tr( "Tap here to enable or disable the '-force-overwrite' option for Ipkg." ) ); | 365 | QWhatsThis::add( m_optForceOverwrite, tr( "Tap here to enable or disable the '-force-overwrite' option for Ipkg." ) ); |
366 | layout->addWidget( m_optForceOverwrite ); | 366 | layout->addWidget( m_optForceOverwrite ); |
367 | 367 | ||
368 | QLabel *l = new QLabel( tr( "Information Level" ), container ); | 368 | QLabel *l = new QLabel( tr( "Information Level" ), container ); |
369 | QWhatsThis::add( l, tr( "Select information level for Ipkg." ) ); | 369 | QWhatsThis::add( l, tr( "Select information level for Ipkg." ) ); |
370 | layout->addWidget( l ); | 370 | layout->addWidget( l ); |
371 | 371 | ||
372 | m_optVerboseIpkg = new QComboBox( container ); | 372 | m_optVerboseIpkg = new QComboBox( container ); |
373 | QWhatsThis::add( m_optVerboseIpkg, tr( "Select information level for Ipkg." ) ); | 373 | QWhatsThis::add( m_optVerboseIpkg, tr( "Select information level for Ipkg." ) ); |
374 | m_optVerboseIpkg->insertItem( tr( "Errors only" ) ); | 374 | m_optVerboseIpkg->insertItem( tr( "Errors only" ) ); |
375 | m_optVerboseIpkg->insertItem( tr( "Normal messages" ) ); | 375 | m_optVerboseIpkg->insertItem( tr( "Normal messages" ) ); |
376 | m_optVerboseIpkg->insertItem( tr( "Informative messages" ) ); | 376 | m_optVerboseIpkg->insertItem( tr( "Informative messages" ) ); |
377 | m_optVerboseIpkg->insertItem( tr( "Troubleshooting output" ) ); | 377 | m_optVerboseIpkg->insertItem( tr( "Troubleshooting output" ) ); |
378 | layout->addWidget( m_optVerboseIpkg ); | 378 | layout->addWidget( m_optVerboseIpkg ); |
379 | 379 | ||
380 | layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); | 380 | layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); |
381 | } | 381 | } |
382 | 382 | ||
383 | void OIpkgConfigDlg::initData() | 383 | void OIpkgConfigDlg::initData() |
384 | { | 384 | { |
385 | // Read ipkg configuration (server/destination/proxy) information | 385 | // Read ipkg configuration (server/destination/proxy) information |
386 | if ( m_ipkg && !m_installOptions ) | 386 | if ( m_ipkg && !m_installOptions ) |
387 | { | 387 | { |
388 | m_configs = m_ipkg->configItems(); | 388 | m_configs = m_ipkg->configItems(); |
389 | if ( m_configs ) | 389 | if ( m_configs ) |
390 | { | 390 | { |
391 | for ( OConfItemListIterator configIt( *m_configs ); configIt.current(); ++configIt ) | 391 | for ( OConfItemListIterator configIt( *m_configs ); configIt.current(); ++configIt ) |
392 | { | 392 | { |
393 | OConfItem *config = configIt.current(); | 393 | OConfItem *config = configIt.current(); |
394 | 394 | ||
395 | // Add configuration item to the appropriate dialog controls | 395 | // Add configuration item to the appropriate dialog controls |
396 | if ( config ) | 396 | if ( config ) |
397 | { | 397 | { |
398 | if ( config->type() == OConfItem::Source ) | 398 | if ( config->type() == OConfItem::Source ) |
399 | { | 399 | { |
400 | m_serverList->insertItem( config->name() ); | 400 | m_serverList->insertItem( config->name() ); |
401 | } | 401 | } |
402 | else if ( config->type() == OConfItem::Destination ) | 402 | else if ( config->type() == OConfItem::Destination ) |
403 | { | 403 | { |
404 | m_destList->insertItem( config->name() ); | 404 | m_destList->insertItem( config->name() ); |
405 | } | 405 | } |
406 | else if ( config->type() == OConfItem::Option ) | 406 | else if ( config->type() == OConfItem::Option ) |
407 | { | 407 | { |
408 | if ( config->name() == "http_proxy" ) | 408 | if ( config->name() == "http_proxy" ) |
409 | { | 409 | { |
410 | m_proxyHttpServer->setText( config->value() ); | 410 | m_proxyHttpServer->setText( config->value() ); |
411 | m_proxyHttpActive->setChecked( config->active() ); | 411 | m_proxyHttpActive->setChecked( config->active() ); |
412 | } | 412 | } |
413 | else if ( config->name() == "ftp_proxy" ) | 413 | else if ( config->name() == "ftp_proxy" ) |
414 | { | 414 | { |
415 | m_proxyFtpServer->setText( config->value() ); | 415 | m_proxyFtpServer->setText( config->value() ); |
416 | m_proxyFtpActive->setChecked( config->active() ); | 416 | m_proxyFtpActive->setChecked( config->active() ); |
417 | } | 417 | } |
418 | else if ( config->name() == "proxy_username" ) | 418 | else if ( config->name() == "proxy_username" ) |
419 | { | 419 | { |
420 | m_proxyUsername->setText( config->value() ); | 420 | m_proxyUsername->setText( config->value() ); |
421 | } | 421 | } |
422 | else if ( config->name() == "proxy_password" ) | 422 | else if ( config->name() == "proxy_password" ) |
423 | { | 423 | { |
424 | m_proxyPassword->setText( config->value() ); | 424 | m_proxyPassword->setText( config->value() ); |
425 | } | 425 | } |
426 | } | 426 | } |
427 | } | 427 | } |
428 | } | 428 | } |
429 | } | 429 | } |
430 | } | 430 | } |
431 | 431 | ||
432 | // Get Ipkg execution options | 432 | // Get Ipkg execution options |
433 | int options = m_ipkg->ipkgExecOptions(); | 433 | int options = m_ipkg->ipkgExecOptions(); |
434 | if ( options & FORCE_DEPENDS ) | 434 | if ( options & FORCE_DEPENDS ) |
435 | m_optForceDepends->setChecked( true ); | 435 | m_optForceDepends->setChecked( true ); |
436 | if ( options & FORCE_REINSTALL ) | 436 | if ( options & FORCE_REINSTALL ) |
437 | m_optForceReinstall->setChecked( true ); | 437 | m_optForceReinstall->setChecked( true ); |
438 | if ( options & FORCE_REMOVE ) | 438 | if ( options & FORCE_REMOVE ) |
439 | m_optForceRemove->setChecked( true ); | 439 | m_optForceRemove->setChecked( true ); |
440 | if ( options & FORCE_OVERWRITE ) | 440 | if ( options & FORCE_OVERWRITE ) |
441 | m_optForceOverwrite->setChecked( true ); | 441 | m_optForceOverwrite->setChecked( true ); |
442 | 442 | ||
443 | m_optVerboseIpkg->setCurrentItem( m_ipkg->ipkgExecVerbosity() ); | 443 | m_optVerboseIpkg->setCurrentItem( m_ipkg->ipkgExecVerbosity() ); |
444 | } | 444 | } |
445 | 445 | ||
446 | OConfItem *OIpkgConfigDlg::findConfItem( OConfItem::Type type, const QString &name ) | 446 | OConfItem *OIpkgConfigDlg::findConfItem( OConfItem::Type type, const QString &name ) |
447 | { | 447 | { |
448 | // Find selected server in list | 448 | // Find selected server in list |
449 | OConfItemListIterator configIt( *m_configs ); | 449 | OConfItemListIterator configIt( *m_configs ); |
450 | OConfItem *config = 0x0; | 450 | OConfItem *config = 0x0; |
451 | for ( ; configIt.current(); ++configIt ) | 451 | for ( ; configIt.current(); ++configIt ) |
452 | { | 452 | { |
453 | config = configIt.current(); | 453 | config = configIt.current(); |
454 | if ( config->type() == type && config->name() == name ) | 454 | if ( config->type() == type && config->name() == name ) |
455 | break; | 455 | break; |
456 | } | 456 | } |
457 | 457 | ||
458 | if ( config && config->type() == type && config->name() == name ) | 458 | if ( config && config->type() == type && config->name() == name ) |
459 | return config; | 459 | return config; |
460 | 460 | ||
461 | return 0x0; | 461 | return 0x0; |
462 | } | 462 | } |
463 | 463 | ||
464 | void OIpkgConfigDlg::slotServerEdit( int index ) | 464 | void OIpkgConfigDlg::slotServerEdit( int index ) |
465 | { | 465 | { |
466 | m_serverNew = false; | 466 | m_serverNew = false; |
467 | m_serverCurrent = index; | 467 | m_serverCurrent = index; |
468 | 468 | ||
469 | // Find selected server in list | 469 | // Find selected server in list |
470 | OConfItem *server = findConfItem( OConfItem::Source, m_serverList->currentText() ); | 470 | OConfItem *server = findConfItem( OConfItem::Source, m_serverList->currentText() ); |
471 | 471 | ||
472 | // Display server details | 472 | // Display server details |
473 | if ( server ) | 473 | if ( server ) |
474 | { | 474 | { |
475 | m_serverCurrName = server->name(); | 475 | m_serverCurrName = server->name(); |
476 | m_serverName->setText( server->name() ); | 476 | m_serverName->setText( server->name() ); |
477 | m_serverLocation->setText( server->value() ); | 477 | m_serverLocation->setText( server->value() ); |
478 | m_serverActive->setChecked( server->active() ); | 478 | m_serverActive->setChecked( server->active() ); |
479 | m_serverName->setFocus(); | 479 | m_serverName->setFocus(); |
480 | } | 480 | } |
481 | } | 481 | } |
482 | 482 | ||
483 | void OIpkgConfigDlg::slotServerNew() | 483 | void OIpkgConfigDlg::slotServerNew() |
484 | { | 484 | { |
485 | m_serverNew = true; | 485 | m_serverNew = true; |
486 | 486 | ||
487 | m_serverName->setText( QString::null ); | 487 | m_serverName->setText( QString::null ); |
488 | m_serverLocation->setText( QString::null ); | 488 | m_serverLocation->setText( QString::null ); |
489 | m_serverActive->setChecked( true ); | 489 | m_serverActive->setChecked( true ); |
490 | m_serverName->setFocus(); | 490 | m_serverName->setFocus(); |
491 | } | 491 | } |
492 | 492 | ||
493 | void OIpkgConfigDlg::slotServerDelete() | 493 | void OIpkgConfigDlg::slotServerDelete() |
494 | { | 494 | { |
495 | // Find selected server in list | 495 | // Find selected server in list |
496 | OConfItem *server = findConfItem( OConfItem::Source, m_serverList->currentText() ); | 496 | OConfItem *server = findConfItem( OConfItem::Source, m_serverList->currentText() ); |
497 | 497 | ||
498 | // Delete server | 498 | // Delete server |
499 | if ( server ) | 499 | if ( server ) |
500 | { | 500 | { |
501 | m_configs->removeRef( server ); | 501 | m_configs->removeRef( server ); |
502 | m_serverList->removeItem( m_serverCurrent ); | 502 | m_serverList->removeItem( m_serverCurrent ); |
503 | } | 503 | } |
504 | } | 504 | } |
505 | 505 | ||
506 | void OIpkgConfigDlg::slotServerUpdate() | 506 | void OIpkgConfigDlg::slotServerUpdate() |
507 | { | 507 | { |
508 | QString newName = m_serverName->text(); | 508 | QString newName = m_serverName->text(); |
509 | 509 | ||
510 | // Convert any spaces to underscores | 510 | // Convert any spaces to underscores |
511 | newName.replace( QRegExp( " " ), "_" ); | 511 | newName.replace( QRegExp( " " ), "_" ); |
512 | 512 | ||
513 | if ( !m_serverNew ) | 513 | if ( !m_serverNew ) |
514 | { | 514 | { |
515 | // Find selected server in list | 515 | // Find selected server in list |
516 | OConfItem *server = findConfItem( OConfItem::Source, m_serverCurrName ); | 516 | OConfItem *server = findConfItem( OConfItem::Source, m_serverCurrName ); |
517 | 517 | ||
518 | // Delete server | 518 | // Delete server |
519 | if ( server ) | 519 | if ( server ) |
520 | { | 520 | { |
521 | // Update url | 521 | // Update url |
522 | server->setValue( m_serverLocation->text() ); | 522 | server->setValue( m_serverLocation->text() ); |
523 | server->setActive( m_serverActive->isChecked() ); | 523 | server->setActive( m_serverActive->isChecked() ); |
524 | 524 | ||
525 | // Check if server name has changed, if it has then we need to replace the key in the map | 525 | // Check if server name has changed, if it has then we need to replace the key in the map |
526 | if ( m_serverCurrName != newName ) | 526 | if ( m_serverCurrName != newName ) |
527 | { | 527 | { |
528 | // Update server name | 528 | // Update server name |
529 | server->setName( newName ); | 529 | server->setName( newName ); |
530 | 530 | ||
531 | // Update list box | 531 | // Update list box |
532 | m_serverList->changeItem( newName, m_serverCurrent ); | 532 | m_serverList->changeItem( newName, m_serverCurrent ); |
533 | } | 533 | } |
534 | } | 534 | } |
535 | } | 535 | } |
536 | else | 536 | else |
537 | { | 537 | { |
538 | // Add new destination to configuration list | 538 | // Add new destination to configuration list |
539 | m_configs->append( new OConfItem( OConfItem::Source, newName, | 539 | m_configs->append( new OConfItem( OConfItem::Source, newName, |
540 | m_serverLocation->text(), m_serverActive->isChecked() ) ); | 540 | m_serverLocation->text(), m_serverActive->isChecked() ) ); |
541 | m_configs->sort(); | 541 | m_configs->sort(); |
542 | 542 | ||
543 | m_serverList->insertItem( newName ); | 543 | m_serverList->insertItem( newName ); |
544 | m_serverList->setCurrentItem( m_serverList->count() ); | 544 | m_serverList->setCurrentItem( m_serverList->count() ); |
545 | m_serverNew = false; | 545 | m_serverNew = false; |
546 | // m_serverList->insertItem( newName ); | ||
547 | } | 546 | } |
548 | } | 547 | } |
549 | 548 | ||
550 | void OIpkgConfigDlg::slotDestEdit( int index ) | 549 | void OIpkgConfigDlg::slotDestEdit( int index ) |
551 | { | 550 | { |
552 | m_destNew = false; | 551 | m_destNew = false; |
553 | m_destCurrent = index; | 552 | m_destCurrent = index; |
554 | 553 | ||
555 | // Find selected destination in list | 554 | // Find selected destination in list |
556 | OConfItem *destination = findConfItem( OConfItem::Destination, m_destList->currentText() ); | 555 | OConfItem *destination = findConfItem( OConfItem::Destination, m_destList->currentText() ); |
557 | 556 | ||
558 | // Display destination details | 557 | // Display destination details |
559 | if ( destination ) | 558 | if ( destination ) |
560 | { | 559 | { |
561 | m_destCurrName = destination->name(); | 560 | m_destCurrName = destination->name(); |
562 | m_destName->setText( destination->name() ); | 561 | m_destName->setText( destination->name() ); |
563 | m_destLocation->setText( destination->value() ); | 562 | m_destLocation->setText( destination->value() ); |
564 | m_destActive->setChecked( destination->active() ); | 563 | m_destActive->setChecked( destination->active() ); |
565 | m_destName->setFocus(); | 564 | m_destName->setFocus(); |
566 | } | 565 | } |
567 | } | 566 | } |
568 | 567 | ||
569 | void OIpkgConfigDlg::slotDestNew() | 568 | void OIpkgConfigDlg::slotDestNew() |
570 | { | 569 | { |
571 | m_destNew = true; | 570 | m_destNew = true; |
572 | 571 | ||
573 | m_destName->setText( QString::null ); | 572 | m_destName->setText( QString::null ); |
574 | m_destLocation->setText( QString::null ); | 573 | m_destLocation->setText( QString::null ); |
575 | m_destActive->setChecked( true ); | 574 | m_destActive->setChecked( true ); |
576 | m_destName->setFocus(); | 575 | m_destName->setFocus(); |
577 | } | 576 | } |
578 | 577 | ||
579 | void OIpkgConfigDlg::slotDestDelete() | 578 | void OIpkgConfigDlg::slotDestDelete() |
580 | { | 579 | { |
581 | // Find selected destination in list | 580 | // Find selected destination in list |
582 | OConfItem *destination = findConfItem( OConfItem::Destination, m_destList->currentText() ); | 581 | OConfItem *destination = findConfItem( OConfItem::Destination, m_destList->currentText() ); |
583 | 582 | ||
584 | // Delete destination | 583 | // Delete destination |
585 | if ( destination ) | 584 | if ( destination ) |
586 | { | 585 | { |
587 | m_configs->removeRef( destination ); | 586 | m_configs->removeRef( destination ); |
588 | m_destList->removeItem( m_destCurrent ); | 587 | m_destList->removeItem( m_destCurrent ); |
589 | } | 588 | } |
590 | } | 589 | } |
591 | 590 | ||
592 | void OIpkgConfigDlg::slotDestSelectPath() | 591 | void OIpkgConfigDlg::slotDestSelectPath() |
593 | { | 592 | { |
594 | QString path = Opie::Ui::OFileDialog::getDirectory( 0, m_destLocation->text() ); | 593 | QString path = Opie::Ui::OFileDialog::getDirectory( 0, m_destLocation->text() ); |
595 | if ( path.at( path.length() - 1 ) == '/' ) | 594 | if ( path.at( path.length() - 1 ) == '/' ) |
596 | path.truncate( path.length() - 1 ); | 595 | path.truncate( path.length() - 1 ); |
597 | m_destLocation->setText( path ); | 596 | m_destLocation->setText( path ); |
598 | } | 597 | } |
599 | 598 | ||
600 | void OIpkgConfigDlg::slotDestUpdate() | 599 | void OIpkgConfigDlg::slotDestUpdate() |
601 | { | 600 | { |
602 | QString newName = m_destName->text(); | 601 | QString newName = m_destName->text(); |
603 | 602 | ||
604 | // Convert any spaces to underscores | 603 | // Convert any spaces to underscores |
605 | newName.replace( QRegExp( " " ), "_" ); | 604 | newName.replace( QRegExp( " " ), "_" ); |
606 | 605 | ||
607 | if ( !m_destNew ) | 606 | if ( !m_destNew ) |
608 | { | 607 | { |
609 | // Find selected destination in list | 608 | // Find selected destination in list |
610 | OConfItem *destination = findConfItem( OConfItem::Destination, m_destCurrName ); | 609 | OConfItem *destination = findConfItem( OConfItem::Destination, m_destCurrName ); |
611 | 610 | ||
612 | // Display destination details | 611 | // Display destination details |
613 | if ( destination ) | 612 | if ( destination ) |
614 | { | 613 | { |
615 | // Update url | 614 | // Update url |
616 | destination->setValue( m_destLocation->text() ); | 615 | destination->setValue( m_destLocation->text() ); |
617 | destination->setActive( m_destActive->isChecked() ); | 616 | destination->setActive( m_destActive->isChecked() ); |
618 | 617 | ||
619 | // Check if destination name has changed, if it has then we need to replace the key in the map | 618 | // Check if destination name has changed, if it has then we need to replace the key in the map |
620 | if ( m_destCurrName != newName ) | 619 | if ( m_destCurrName != newName ) |
621 | { | 620 | { |
622 | // Update destination name | 621 | // Update destination name |
623 | destination->setName( newName ); | 622 | destination->setName( newName ); |
624 | 623 | ||
625 | // Update list box | 624 | // Update list box |
626 | m_destList->changeItem( newName, m_destCurrent ); | 625 | m_destList->changeItem( newName, m_destCurrent ); |
627 | } | 626 | } |
628 | } | 627 | } |
629 | } | 628 | } |
630 | else | 629 | else |
631 | { | 630 | { |
632 | // Add new destination to configuration list | 631 | // Add new destination to configuration list |
633 | m_configs->append( new OConfItem( OConfItem::Destination, newName, | 632 | m_configs->append( new OConfItem( OConfItem::Destination, newName, |
634 | m_destLocation->text(), m_destActive->isChecked() ) ); | 633 | m_destLocation->text(), m_destActive->isChecked() ) ); |
635 | m_configs->sort(); | 634 | m_configs->sort(); |
636 | 635 | ||
637 | m_destList->insertItem( newName ); | 636 | m_destList->insertItem( newName ); |
638 | m_destList->setCurrentItem( m_destList->count() ); | 637 | m_destList->setCurrentItem( m_destList->count() ); |
639 | m_destNew = false; | 638 | m_destNew = false; |
640 | } | 639 | } |
641 | } | 640 | } |