Diffstat (limited to 'noncore/unsupported/oipkg/pksettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/pksettings.cpp | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/noncore/unsupported/oipkg/pksettings.cpp b/noncore/unsupported/oipkg/pksettings.cpp index be01837..6c8dc2a 100644 --- a/noncore/unsupported/oipkg/pksettings.cpp +++ b/noncore/unsupported/oipkg/pksettings.cpp | |||
@@ -33,2 +33,3 @@ | |||
33 | #include "debug.h" | 33 | #include "debug.h" |
34 | //#include "utils.h" | ||
34 | 35 | ||
@@ -58,2 +59,3 @@ PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* na | |||
58 | readSettings(); | 59 | readSettings(); |
60 | activeLinkDestination->hide(); | ||
59 | } | 61 | } |
@@ -78,4 +80,6 @@ void PackageManagerSettings::newServer() | |||
78 | } | 80 | } |
81 | changed = true; | ||
79 | servers->setSelected(i,TRUE); | 82 | servers->setSelected(i,TRUE); |
80 | editServer(i); | 83 | editServer(i); |
84 | changed = true; | ||
81 | } | 85 | } |
@@ -99,2 +103,3 @@ void PackageManagerSettings::newDestination() | |||
99 | editDestination(i); | 103 | editDestination(i); |
104 | changed = true; | ||
100 | } | 105 | } |
@@ -119,2 +124,3 @@ void PackageManagerSettings::editServer(int i) | |||
119 | connect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); | 124 | connect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); |
125 | changed = true; | ||
120 | } | 126 | } |
@@ -139,2 +145,3 @@ void PackageManagerSettings::editDestination(int i) | |||
139 | connect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); | 145 | connect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); |
146 | changed = true; | ||
140 | } | 147 | } |
@@ -153,2 +160,3 @@ void PackageManagerSettings::removeServer() | |||
153 | serverurl->setEnabled(FALSE); | 160 | serverurl->setEnabled(FALSE); |
161 | changed = true; | ||
154 | } | 162 | } |
@@ -168,2 +176,3 @@ void PackageManagerSettings::removeDestination() | |||
168 | destinationurl->setEnabled(FALSE); | 176 | destinationurl->setEnabled(FALSE); |
177 | changed = true; | ||
169 | } | 178 | } |
@@ -175,3 +184,5 @@ void PackageManagerSettings::serverNameChanged(const QString& t) | |||
175 | activeServers->changeItem( t, editedserver ); | 184 | activeServers->changeItem( t, editedserver ); |
185 | changed = true; | ||
176 | connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); | 186 | connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); |
187 | changed = true; | ||
177 | } | 188 | } |
@@ -185,2 +196,3 @@ void PackageManagerSettings::destNameChanged(const QString& t) | |||
185 | connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); | 196 | connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); |
197 | changed = true; | ||
186 | } | 198 | } |
@@ -190,2 +202,3 @@ void PackageManagerSettings::serverUrlChanged(const QString& t) | |||
190 | serverurlDic.replace(editedserver, new QString(t)); | 202 | serverurlDic.replace(editedserver, new QString(t)); |
203 | changed = true; | ||
191 | } | 204 | } |
@@ -195,2 +208,3 @@ void PackageManagerSettings::destUrlChanged(const QString& t) | |||
195 | destinationurlDic.replace(editeddestination, new QString(t)); | 208 | destinationurlDic.replace(editeddestination, new QString(t)); |
209 | changed = true; | ||
196 | } | 210 | } |
@@ -267,2 +281,3 @@ void PackageManagerSettings::installationSettingChange(int cs) | |||
267 | readInstallationSetting( cs ); | 281 | readInstallationSetting( cs ); |
282 | changed = true; | ||
268 | } | 283 | } |
@@ -271,3 +286,2 @@ void PackageManagerSettings::writeInstallationSettings() | |||
271 | { | 286 | { |
272 | if ( ! changed ) return ; | ||
273 | { | 287 | { |
@@ -287,3 +301,3 @@ void PackageManagerSettings::readInstallationSetting(int setting) | |||
287 | cfg.setGroup( "Setting_" + QString::number( setting ) ); | 301 | cfg.setGroup( "Setting_" + QString::number( setting ) ); |
288 | CheckBoxLink->setChecked( cfg.readBoolEntry( "link", false ) ); | 302 | CheckBoxLink->setChecked( cfg.readBoolEntry( "link", true ) ); |
289 | QString dest = cfg.readEntry( "dest" ); | 303 | QString dest = cfg.readEntry( "dest" ); |
@@ -292,3 +306,2 @@ void PackageManagerSettings::readInstallationSetting(int setting) | |||
292 | pvDebug(3, "linkdest="+linkdest); | 306 | pvDebug(3, "linkdest="+linkdest); |
293 | |||
294 | for ( int i = 0; i < activeDestination->count(); i++) | 307 | for ( int i = 0; i < activeDestination->count(); i++) |
@@ -305,3 +318,2 @@ void PackageManagerSettings::writeCurrentInstallationSetting() | |||
305 | Config cfg( "oipkg", Config::User ); | 318 | Config cfg( "oipkg", Config::User ); |
306 | changed = false; | ||
307 | cfg.setGroup( "Setting_" + QString::number(currentSetting) ); | 319 | cfg.setGroup( "Setting_" + QString::number(currentSetting) ); |
@@ -334,2 +346,3 @@ bool PackageManagerSettings::readIpkgConfig(const QString& conffile) | |||
334 | QFile conf(conffile); | 346 | QFile conf(conffile); |
347 | changed = false; | ||
335 | if ( conf.open(IO_ReadOnly) ) { | 348 | if ( conf.open(IO_ReadOnly) ) { |
@@ -426,3 +439,3 @@ void PackageManagerSettings::writeSettings() | |||
426 | { | 439 | { |
427 | writeIpkgConfig("/etc/ipkg.conf"); | 440 | if ( changed ) writeIpkgConfig("/etc/ipkg.conf"); |
428 | writeInstallationSettings(); | 441 | writeInstallationSettings(); |
@@ -437,3 +450,3 @@ bool PackageManagerSettings::showDialog( int i ) | |||
437 | else readSettings(); | 450 | else readSettings(); |
438 | return ret; | 451 | return (changed && ret); |
439 | } | 452 | } |
@@ -471,2 +484,11 @@ QStringList PackageManagerSettings::getActiveServers() | |||
471 | } | 484 | } |
485 | QStringList PackageManagerSettings::getServers() | ||
486 | { | ||
487 | QStringList sl; | ||
488 | for (int i=0; i<(int)activeServers->count(); i++) | ||
489 | { | ||
490 | sl += activeServers->text(i); | ||
491 | } | ||
492 | return sl; | ||
493 | } | ||
472 | 494 | ||
@@ -508,4 +530,13 @@ void PackageManagerSettings::linkEnabled( bool b ) | |||
508 | { | 530 | { |
509 | changed = true; | ||
510 | activeLinkDestination->setEnabled( b ); | 531 | activeLinkDestination->setEnabled( b ); |
511 | } | 532 | } |
533 | |||
534 | void PackageManagerSettings::activeServerChanged() | ||
535 | { | ||
536 | changed = true; | ||
537 | } | ||
538 | |||
539 | QComboBox* PackageManagerSettings::getDestCombo() | ||
540 | { | ||
541 | return new QComboBox(activeDestination); | ||
542 | } | ||