Diffstat (limited to 'noncore/unsupported/oipkg/pksettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/pksettings.cpp | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/noncore/unsupported/oipkg/pksettings.cpp b/noncore/unsupported/oipkg/pksettings.cpp index 14c1944..acabaed 100644 --- a/noncore/unsupported/oipkg/pksettings.cpp +++ b/noncore/unsupported/oipkg/pksettings.cpp | |||
@@ -36,45 +36,45 @@ | |||
36 | PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* name, WFlags fl ) | 36 | PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* name, WFlags fl ) |
37 | : PackageManagerSettingsBase( parent, name, fl ) | 37 | : PackageManagerSettingsBase( parent, name, fl ) |
38 | { | 38 | { |
39 | connect( newserver, SIGNAL(clicked()), this, SLOT(newServer()) ); | 39 | connect( newserver, SIGNAL(clicked()), this, SLOT(newServer()) ); |
40 | connect( removeserver, SIGNAL(clicked()), this, SLOT(removeServer()) ); | 40 | connect( removeserver, SIGNAL(clicked()), this, SLOT(removeServer()) ); |
41 | connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); | 41 | connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); |
42 | connect( newdestination, SIGNAL(clicked()), this, SLOT(newDestination()) ); | 42 | connect( newdestination, SIGNAL(clicked()), this, SLOT(newDestination()) ); |
43 | connect( removedestination, SIGNAL(clicked()), this, SLOT(removeDestination()) ); | 43 | connect( removedestination, SIGNAL(clicked()), this, SLOT(removeDestination()) ); |
44 | connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); | 44 | connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); |
45 | // connect( CheckBoxLink, SIGNAL(toggled(bool)), | 45 | // connect( CheckBoxLink, SIGNAL(toggled(bool)), |
46 | // activeLinkDestination, SLOT(setEnabled(bool)) ); | 46 | // activeLinkDestination, SLOT(setEnabled(bool)) ); |
47 | 47 | ||
48 | connect( settingName, SIGNAL(activated(int)), this, SLOT(installationSettingChange(int)) ); | 48 | // connect( settingName, SIGNAL(activated(int)), this, SLOT(installationSettingChange(int)) ); |
49 | connect( settingName, SIGNAL(textChanged(const QString &)), this, SLOT(installationSettingSetName(const QString &)) ); | 49 | // connect( settingName, SIGNAL(textChanged(const QString &)), this, SLOT(installationSettingSetName(const QString &)) ); |
50 | connect( newsetting, SIGNAL(clicked()), this, SLOT(newInstallationSetting()) ); | 50 | // connect( newsetting, SIGNAL(clicked()), this, SLOT(newInstallationSetting()) ); |
51 | connect( renamesetting, SIGNAL(clicked()), this, SLOT(renameInstallationSetting()) ); | 51 | // connect( renamesetting, SIGNAL(clicked()), this, SLOT(renameInstallationSetting()) ); |
52 | connect( removesetting, SIGNAL(clicked()), this, SLOT(removeInstallationSetting()) ); | 52 | // connect( removesetting, SIGNAL(clicked()), this, SLOT(removeInstallationSetting()) ); |
53 | servername->setEnabled(FALSE); | 53 | servername->setEnabled(FALSE); |
54 | serverurl->setEnabled(FALSE); | 54 | serverurl->setEnabled(FALSE); |
55 | serverurlDic.setAutoDelete(TRUE); | 55 | serverurlDic.setAutoDelete(TRUE); |
56 | destinationname->setEnabled(FALSE); | 56 | destinationname->setEnabled(FALSE); |
57 | destinationurl->setEnabled(FALSE); | 57 | destinationurl->setEnabled(FALSE); |
58 | destinationurlDic.setAutoDelete(TRUE); | 58 | destinationurlDic.setAutoDelete(TRUE); |
59 | readSettings(); | 59 | readSettings(); |
60 | activeLinkDestination->hide(); | 60 | activeLinkDestination->hide(); |
61 | serverChanged = false; | 61 | serverChanged = false; |
62 | 62 | ||
63 | // get rid of setups | 63 | // get rid of setups |
64 | // Settings->hide(); | 64 | // Settings->hide(); |
65 | settingName->hide(); | 65 | // settingName->hide(); |
66 | newsetting->hide(); | 66 | // newsetting->hide(); |
67 | renamesetting->hide(); | 67 | // renamesetting->hide(); |
68 | removesetting->hide(); | 68 | // removesetting->hide(); |
69 | } | 69 | } |
70 | 70 | ||
71 | PackageManagerSettings::~PackageManagerSettings() | 71 | PackageManagerSettings::~PackageManagerSettings() |
72 | { | 72 | { |
73 | } | 73 | } |
74 | 74 | ||
75 | 75 | ||
76 | void PackageManagerSettings::newServer() | 76 | void PackageManagerSettings::newServer() |
77 | { | 77 | { |
78 | int i = servers->count(); | 78 | int i = servers->count(); |
79 | if ( servername->isEnabled() || serverurl->text().isEmpty() ) { | 79 | if ( servername->isEnabled() || serverurl->text().isEmpty() ) { |
80 | serverurlDic.insert(i,new QString("http://")); | 80 | serverurlDic.insert(i,new QString("http://")); |
@@ -243,67 +243,67 @@ void PackageManagerSettings::writeIpkgConfig(const QString& conffile) | |||
243 | conf.close(); | 243 | conf.close(); |
244 | } | 244 | } |
245 | 245 | ||
246 | 246 | ||
247 | void PackageManagerSettings::readInstallationSettings() | 247 | void PackageManagerSettings::readInstallationSettings() |
248 | { | 248 | { |
249 | Config cfg( "oipkg", Config::User ); | 249 | Config cfg( "oipkg", Config::User ); |
250 | cfg.setGroup( "Settings" ); | 250 | cfg.setGroup( "Settings" ); |
251 | 251 | ||
252 | installationSettingsCount = cfg.readNumEntry( "count", -1 ); | 252 | installationSettingsCount = cfg.readNumEntry( "count", -1 ); |
253 | currentSetting = cfg.readNumEntry( "current", 0 );// o should be -1 | 253 | currentSetting = cfg.readNumEntry( "current", 0 );// o should be -1 |
254 | 254 | ||
255 | for (int i = 0; i < installationSettingsCount; i++) | 255 | // for (int i = 0; i < installationSettingsCount; i++) |
256 | { | 256 | // { |
257 | cfg.setGroup( "Setting_" + QString::number(i) ); | 257 | // cfg.setGroup( "Setting_" + QString::number(i) ); |
258 | settingName->insertItem( cfg.readEntry( "name", "???" ), i ); | 258 | // settingName->insertItem( cfg.readEntry( "name", "???" ), i ); |
259 | }; | 259 | // }; |
260 | readInstallationSetting( currentSetting ); | 260 | readInstallationSetting( currentSetting ); |
261 | } | 261 | } |
262 | 262 | ||
263 | 263 | ||
264 | 264 | ||
265 | /** | 265 | ///** |
266 | * remove from conf file | 266 | // * remove from conf file |
267 | */ | 267 | // */ |
268 | void PackageManagerSettings::removeInstallationSetting() | 268 | //void PackageManagerSettings::removeInstallationSetting() |
269 | { | 269 | //{ |
270 | settingName->removeItem( settingName->currentItem() ); | 270 | // settingName->removeItem( settingName->currentItem() ); |
271 | Config cfg( "oipkg", Config::User ); | 271 | // Config cfg( "oipkg", Config::User ); |
272 | cfg.setGroup( "Setting_" + QString::number( installationSettingsCount ) ); | 272 | // cfg.setGroup( "Setting_" + QString::number( installationSettingsCount ) ); |
273 | cfg.clearGroup(); | 273 | // cfg.clearGroup(); |
274 | installationSettingsCount--; | 274 | // installationSettingsCount--; |
275 | changed = true; | 275 | // changed = true; |
276 | settingName->setEditable( false ); | 276 | // settingName->setEditable( false ); |
277 | } | 277 | //} |
278 | 278 | ||
279 | /** | 279 | ///** |
280 | * write to confgile | 280 | // * write to confgile |
281 | */ | 281 | // */ |
282 | void PackageManagerSettings::newInstallationSetting() | 282 | //void PackageManagerSettings::newInstallationSetting() |
283 | { | 283 | //{ |
284 | installationSettingsCount++; | 284 | // installationSettingsCount++; |
285 | settingName->insertItem( "New", installationSettingsCount ); | 285 | // settingName->insertItem( "New", installationSettingsCount ); |
286 | settingName->setCurrentItem( installationSettingsCount ); | 286 | // settingName->setCurrentItem( installationSettingsCount ); |
287 | settingName->setEditable( true ); | 287 | // settingName->setEditable( true ); |
288 | changed = true; | 288 | // changed = true; |
289 | } | 289 | //} |
290 | 290 | ||
291 | void PackageManagerSettings::installationSettingChange(int cs) | 291 | //void PackageManagerSettings::installationSettingChange(int cs) |
292 | { | 292 | //{ |
293 | writeCurrentInstallationSetting(); | 293 | // writeCurrentInstallationSetting(); |
294 | currentSetting = cs; | 294 | // currentSetting = cs; |
295 | readInstallationSetting( cs ); | 295 | // readInstallationSetting( cs ); |
296 | changed = true; | 296 | // changed = true; |
297 | } | 297 | //} |
298 | 298 | ||
299 | void PackageManagerSettings::writeInstallationSettings() | 299 | void PackageManagerSettings::writeInstallationSettings() |
300 | { | 300 | { |
301 | { | 301 | { |
302 | Config cfg( "oipkg", Config::User ); | 302 | Config cfg( "oipkg", Config::User ); |
303 | cfg.setGroup( "Settings" ); | 303 | cfg.setGroup( "Settings" ); |
304 | cfg.writeEntry( "count", installationSettingsCount ); | 304 | cfg.writeEntry( "count", installationSettingsCount ); |
305 | cfg.writeEntry( "current", currentSetting ); | 305 | cfg.writeEntry( "current", currentSetting ); |
306 | } | 306 | } |
307 | writeCurrentInstallationSetting(); | 307 | writeCurrentInstallationSetting(); |
308 | } | 308 | } |
309 | 309 | ||
@@ -333,35 +333,35 @@ void PackageManagerSettings::writeCurrentInstallationSetting() | |||
333 | cfg.setGroup( "Setting_" + QString::number(currentSetting) ); | 333 | cfg.setGroup( "Setting_" + QString::number(currentSetting) ); |
334 | cfg.writeEntry( "link", CheckBoxLink->isChecked() ); | 334 | cfg.writeEntry( "link", CheckBoxLink->isChecked() ); |
335 | cfg.writeEntry( "dest", getDestinationName() ); | 335 | cfg.writeEntry( "dest", getDestinationName() ); |
336 | cfg.writeEntry( "linkdest" , getLinkDestinationName() ); | 336 | cfg.writeEntry( "linkdest" , getLinkDestinationName() ); |
337 | QStringList sers = getActiveServers(); | 337 | QStringList sers = getActiveServers(); |
338 | int srvc = 0; | 338 | int srvc = 0; |
339 | for ( QStringList::Iterator it = sers.begin(); it != sers.end(); ++it ) { | 339 | for ( QStringList::Iterator it = sers.begin(); it != sers.end(); ++it ) { |
340 | cfg.writeEntry( "server_" + QString::number(srvc++), *it ); | 340 | cfg.writeEntry( "server_" + QString::number(srvc++), *it ); |
341 | } | 341 | } |
342 | cfg.writeEntry( "server_count", srvc ); | 342 | cfg.writeEntry( "server_count", srvc ); |
343 | } | 343 | } |
344 | 344 | ||
345 | void PackageManagerSettings::renameInstallationSetting() | 345 | //void PackageManagerSettings::renameInstallationSetting() |
346 | { | 346 | //{ |
347 | settingName->setEditable( true ); | 347 | // settingName->setEditable( true ); |
348 | changed = true; | 348 | // changed = true; |
349 | } | 349 | //} |
350 | 350 | ||
351 | void PackageManagerSettings::installationSettingSetName(const QString &name) | 351 | //void PackageManagerSettings::installationSettingSetName(const QString &name) |
352 | { | 352 | //{ |
353 | settingName->changeItem( name, settingName->currentItem() ); | 353 | // settingName->changeItem( name, settingName->currentItem() ); |
354 | changed = true; | 354 | // changed = true; |
355 | } | 355 | //} |
356 | 356 | ||
357 | 357 | ||
358 | bool PackageManagerSettings::readIpkgConfig(const QString& conffile) | 358 | bool PackageManagerSettings::readIpkgConfig(const QString& conffile) |
359 | { | 359 | { |
360 | QFile conf(conffile); | 360 | QFile conf(conffile); |
361 | changed = false; | 361 | changed = false; |
362 | if ( conf.open(IO_ReadOnly) ) { | 362 | if ( conf.open(IO_ReadOnly) ) { |
363 | QTextStream s(&conf); | 363 | QTextStream s(&conf); |
364 | servers->clear(); | 364 | servers->clear(); |
365 | activeServers->clear(); | 365 | activeServers->clear(); |
366 | destinations->clear(); | 366 | destinations->clear(); |
367 | activeDestination->clear(); | 367 | activeDestination->clear(); |