Diffstat (limited to 'noncore/unsupported/oipkg/pksettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/pksettings.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/noncore/unsupported/oipkg/pksettings.cpp b/noncore/unsupported/oipkg/pksettings.cpp index 7e2ef10..24c7beb 100644 --- a/noncore/unsupported/oipkg/pksettings.cpp +++ b/noncore/unsupported/oipkg/pksettings.cpp | |||
@@ -49,24 +49,25 @@ PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* na | |||
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 | } | 62 | } |
62 | 63 | ||
63 | PackageManagerSettings::~PackageManagerSettings() | 64 | PackageManagerSettings::~PackageManagerSettings() |
64 | { | 65 | { |
65 | } | 66 | } |
66 | 67 | ||
67 | 68 | ||
68 | void PackageManagerSettings::newServer() | 69 | void PackageManagerSettings::newServer() |
69 | { | 70 | { |
70 | int i = servers->count(); | 71 | int i = servers->count(); |
71 | if ( servername->isEnabled() || serverurl->text().isEmpty() ) { | 72 | if ( servername->isEnabled() || serverurl->text().isEmpty() ) { |
72 | serverurlDic.insert(i,new QString("http://")); | 73 | serverurlDic.insert(i,new QString("http://")); |
@@ -110,41 +111,42 @@ void PackageManagerSettings::editServer(int i) | |||
110 | if ( servername->isEnabled() ) { | 111 | if ( servername->isEnabled() ) { |
111 | disconnect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); | 112 | disconnect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); |
112 | disconnect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); | 113 | disconnect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); |
113 | } else { | 114 | } else { |
114 | servername->setEnabled(TRUE); | 115 | servername->setEnabled(TRUE); |
115 | serverurl->setEnabled(TRUE); | 116 | serverurl->setEnabled(TRUE); |
116 | } | 117 | } |
117 | 118 | ||
118 | servername->setText( servers->text(i) ); | 119 | servername->setText( servers->text(i) ); |
119 | serverurl->setText( *serverurlDic[i] ); | 120 | serverurl->setText( *serverurlDic[i] ); |
120 | 121 | ||
121 | editedserver = i; | 122 | editedserver = i; |
122 | 123 | serverChanged = true; | |
123 | connect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); | 124 | connect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); |
124 | connect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); | 125 | connect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); |
125 | changed = true; | 126 | changed = true; |
126 | } | 127 | } |
127 | 128 | ||
128 | 129 | ||
129 | void PackageManagerSettings::editDestination(int i) | 130 | void PackageManagerSettings::editDestination(int i) |
130 | { | 131 | { |
131 | if ( destinationname->isEnabled() ) { | 132 | if ( destinationname->isEnabled() ) { |
132 | disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); | 133 | disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); |
133 | disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); | 134 | disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); |
134 | } else { | 135 | } else { |
135 | destinationname->setEnabled(TRUE); | 136 | destinationname->setEnabled(TRUE); |
136 | destinationurl->setEnabled(TRUE); | 137 | destinationurl->setEnabled(TRUE); |
137 | createLinksButton->setEnabled(TRUE); | 138 | //since it does not work anyway |
138 | removeLinksButton->setEnabled(TRUE); | 139 | // createLinksButton->setEnabled(TRUE); |
140 | // removeLinksButton->setEnabled(TRUE); | ||
139 | } | 141 | } |
140 | 142 | ||
141 | destinationname->setText( destinations->text(i) ); | 143 | destinationname->setText( destinations->text(i) ); |
142 | destinationurl->setText( *destinationurlDic[i] ); | 144 | destinationurl->setText( *destinationurlDic[i] ); |
143 | 145 | ||
144 | editeddestination = i; | 146 | editeddestination = i; |
145 | 147 | ||
146 | connect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); | 148 | connect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); |
147 | connect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); | 149 | connect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); |
148 | changed = true; | 150 | changed = true; |
149 | } | 151 | } |
150 | 152 | ||
@@ -175,43 +177,44 @@ void PackageManagerSettings::removeDestination() | |||
175 | activeLinkDestination->removeItem(editeddestination); | 177 | activeLinkDestination->removeItem(editeddestination); |
176 | connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); | 178 | connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); |
177 | destinationname->setEnabled(FALSE); | 179 | destinationname->setEnabled(FALSE); |
178 | destinationurl->setEnabled(FALSE); | 180 | destinationurl->setEnabled(FALSE); |
179 | changed = true; | 181 | changed = true; |
180 | } | 182 | } |
181 | 183 | ||
182 | void PackageManagerSettings::serverNameChanged(const QString& t) | 184 | void PackageManagerSettings::serverNameChanged(const QString& t) |
183 | { | 185 | { |
184 | disconnect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); | 186 | disconnect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); |
185 | servers->changeItem( t, editedserver ); | 187 | servers->changeItem( t, editedserver ); |
186 | activeServers->changeItem( t, editedserver ); | 188 | activeServers->changeItem( t, editedserver ); |
187 | changed = true; | ||
188 | connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); | 189 | connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); |
189 | changed = true; | 190 | changed = true; |
191 | serverChanged = true; | ||
190 | } | 192 | } |
191 | 193 | ||
192 | void PackageManagerSettings::destNameChanged(const QString& t) | 194 | void PackageManagerSettings::destNameChanged(const QString& t) |
193 | { | 195 | { |
194 | disconnect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); | 196 | disconnect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); |
195 | destinations->changeItem( t, editeddestination ); | 197 | destinations->changeItem( t, editeddestination ); |
196 | activeDestination->changeItem( t, editeddestination ); | 198 | activeDestination->changeItem( t, editeddestination ); |
197 | activeLinkDestination->changeItem( t, editeddestination ); | 199 | activeLinkDestination->changeItem( t, editeddestination ); |
198 | connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); | 200 | connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); |
199 | changed = true; | 201 | changed = true; |
200 | } | 202 | } |
201 | 203 | ||
202 | void PackageManagerSettings::serverUrlChanged(const QString& t) | 204 | void PackageManagerSettings::serverUrlChanged(const QString& t) |
203 | { | 205 | { |
204 | serverurlDic.replace(editedserver, new QString(t)); | 206 | serverurlDic.replace(editedserver, new QString(t)); |
205 | changed = true; | 207 | changed = true; |
208 | serverChanged = true; | ||
206 | } | 209 | } |
207 | 210 | ||
208 | void PackageManagerSettings::destUrlChanged(const QString& t) | 211 | void PackageManagerSettings::destUrlChanged(const QString& t) |
209 | { | 212 | { |
210 | destinationurlDic.replace(editeddestination, new QString(t)); | 213 | destinationurlDic.replace(editeddestination, new QString(t)); |
211 | changed = true; | 214 | changed = true; |
212 | } | 215 | } |
213 | 216 | ||
214 | void PackageManagerSettings::writeIpkgConfig(const QString& conffile) | 217 | void PackageManagerSettings::writeIpkgConfig(const QString& conffile) |
215 | { | 218 | { |
216 | QFile conf(conffile); | 219 | QFile conf(conffile); |
217 | if ( ! conf.open(IO_WriteOnly) ) return; | 220 | if ( ! conf.open(IO_WriteOnly) ) return; |