Diffstat (limited to 'noncore/unsupported/oipkg/pksettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/pksettings.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/noncore/unsupported/oipkg/pksettings.cpp b/noncore/unsupported/oipkg/pksettings.cpp index 6c8dc2a..7e2ef10 100644 --- a/noncore/unsupported/oipkg/pksettings.cpp +++ b/noncore/unsupported/oipkg/pksettings.cpp | |||
@@ -113,48 +113,50 @@ void PackageManagerSettings::editServer(int i) | |||
113 | } else { | 113 | } else { |
114 | servername->setEnabled(TRUE); | 114 | servername->setEnabled(TRUE); |
115 | serverurl->setEnabled(TRUE); | 115 | serverurl->setEnabled(TRUE); |
116 | } | 116 | } |
117 | 117 | ||
118 | servername->setText( servers->text(i) ); | 118 | servername->setText( servers->text(i) ); |
119 | serverurl->setText( *serverurlDic[i] ); | 119 | serverurl->setText( *serverurlDic[i] ); |
120 | 120 | ||
121 | editedserver = i; | 121 | editedserver = i; |
122 | 122 | ||
123 | connect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); | 123 | connect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); |
124 | 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; | 125 | changed = true; |
126 | } | 126 | } |
127 | 127 | ||
128 | 128 | ||
129 | void PackageManagerSettings::editDestination(int i) | 129 | void PackageManagerSettings::editDestination(int i) |
130 | { | 130 | { |
131 | if ( destinationname->isEnabled() ) { | 131 | if ( destinationname->isEnabled() ) { |
132 | disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); | 132 | disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); |
133 | disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); | 133 | disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); |
134 | } else { | 134 | } else { |
135 | destinationname->setEnabled(TRUE); | 135 | destinationname->setEnabled(TRUE); |
136 | destinationurl->setEnabled(TRUE); | 136 | destinationurl->setEnabled(TRUE); |
137 | createLinksButton->setEnabled(TRUE); | ||
138 | removeLinksButton->setEnabled(TRUE); | ||
137 | } | 139 | } |
138 | 140 | ||
139 | destinationname->setText( destinations->text(i) ); | 141 | destinationname->setText( destinations->text(i) ); |
140 | destinationurl->setText( *destinationurlDic[i] ); | 142 | destinationurl->setText( *destinationurlDic[i] ); |
141 | 143 | ||
142 | editeddestination = i; | 144 | editeddestination = i; |
143 | 145 | ||
144 | connect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); | 146 | connect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); |
145 | connect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); | 147 | connect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); |
146 | changed = true; | 148 | changed = true; |
147 | } | 149 | } |
148 | 150 | ||
149 | void PackageManagerSettings::removeServer() | 151 | void PackageManagerSettings::removeServer() |
150 | { | 152 | { |
151 | disconnect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); | 153 | disconnect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); |
152 | disconnect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); | 154 | disconnect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); |
153 | servername->setText(servers->text(editedserver)); | 155 | servername->setText(servers->text(editedserver)); |
154 | serverurl->setText(*serverurlDic[editedserver]); | 156 | serverurl->setText(*serverurlDic[editedserver]); |
155 | disconnect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); | 157 | disconnect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); |
156 | servers->removeItem(editedserver); | 158 | servers->removeItem(editedserver); |
157 | activeServers->removeItem(editedserver); | 159 | activeServers->removeItem(editedserver); |
158 | connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); | 160 | connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); |
159 | servername->setEnabled(FALSE); | 161 | servername->setEnabled(FALSE); |
160 | serverurl->setEnabled(FALSE); | 162 | serverurl->setEnabled(FALSE); |
@@ -507,36 +509,56 @@ QStringList PackageManagerSettings::getDestinationUrls() | |||
507 | QString PackageManagerSettings::getDestinationUrlByName(QString n) | 509 | QString PackageManagerSettings::getDestinationUrlByName(QString n) |
508 | { | 510 | { |
509 | QStringList sl; | 511 | QStringList sl; |
510 | for (int i=0; i<(int)destinations->count(); i++) | 512 | for (int i=0; i<(int)destinations->count(); i++) |
511 | { | 513 | { |
512 | if ( n == destinations->text(i)) return*destinationurlDic[i]; | 514 | if ( n == destinations->text(i)) return*destinationurlDic[i]; |
513 | } | 515 | } |
514 | return ""; | 516 | return ""; |
515 | } | 517 | } |
516 | 518 | ||
517 | /** returns the destination listed in ipkg.conf */ | 519 | /** returns the destination listed in ipkg.conf */ |
518 | QStringList PackageManagerSettings::getDestinationNames() | 520 | QStringList PackageManagerSettings::getDestinationNames() |
519 | { | 521 | { |
520 | QStringList sl; | 522 | QStringList sl; |
521 | for (int i=0; i<(int)destinations->count(); i++) | 523 | for (int i=0; i<(int)destinations->count(); i++) |
522 | { | 524 | { |
523 | sl += destinations->text(i); | 525 | sl += destinations->text(i); |
524 | } | 526 | } |
525 | return sl; | 527 | return sl; |
526 | } | 528 | } |
527 | 529 | ||
528 | 530 | ||
529 | void PackageManagerSettings::linkEnabled( bool b ) | 531 | void PackageManagerSettings::linkEnabled( bool b ) |
530 | { | 532 | { |
533 | pvDebug(2,"PackageManagerSettings::linkEnabled "+QString(b?"yes":"no")); | ||
531 | activeLinkDestination->setEnabled( b ); | 534 | activeLinkDestination->setEnabled( b ); |
532 | } | 535 | } |
533 | 536 | ||
534 | void PackageManagerSettings::activeServerChanged() | 537 | void PackageManagerSettings::activeServerChanged() |
535 | { | 538 | { |
536 | changed = true; | 539 | changed = true; |
537 | } | 540 | } |
538 | 541 | ||
539 | QComboBox* PackageManagerSettings::getDestCombo() | 542 | QComboBox* PackageManagerSettings::getDestCombo() |
540 | { | 543 | { |
541 | return new QComboBox(activeDestination); | 544 | return new QComboBox(activeDestination); |
542 | } | 545 | } |
546 | |||
547 | void PackageManagerSettings::createLinksToDest() | ||
548 | { | ||
549 | pvDebug(2,"creating links..."); | ||
550 | // emit doCreateLinks( destinationurl->text() ); | ||
551 | //ipkg->createLinks( destinationurl ); | ||
552 | } | ||
553 | |||
554 | void PackageManagerSettings::removeLinksToDest() | ||
555 | { | ||
556 | pvDebug(2,"removing links..."); | ||
557 | // emit doRemoveLinks( destinationurl->text() ); | ||
558 | //ipkg->removeLinks( destinationurl ); | ||
559 | } | ||
560 | |||
561 | //void PackageManagerSettings::setIpkg( PmIpkg* i ) | ||
562 | //{ | ||
563 | //ipkg = i; | ||
564 | //} | ||