Diffstat (limited to 'noncore/settings/aqpkg/networkpkgmgr.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 46 |
1 files changed, 13 insertions, 33 deletions
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index ee37157..91afe02 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp | |||
@@ -66,7 +66,4 @@ NetworkPackageManager::NetworkPackageManager( QWidget *parent, const char *name | |||
66 | 66 | ||
67 | initGui(); | 67 | initGui(); |
68 | setupConnections(); | ||
69 | |||
70 | //updateData(); | ||
71 | } | 68 | } |
72 | 69 | ||
@@ -148,9 +145,7 @@ void NetworkPackageManager :: initGui() | |||
148 | QLabel *l = new QLabel( tr( "Servers" ), this ); | 145 | QLabel *l = new QLabel( tr( "Servers" ), this ); |
149 | serversList = new QComboBox( this ); | 146 | serversList = new QComboBox( this ); |
147 | connect( serversList, SIGNAL(activated( int )), this, SLOT(serverSelected( int ))); | ||
148 | |||
150 | packagesList = new QListView( this ); | 149 | packagesList = new QListView( this ); |
151 | update = new QPushButton( tr( "Refresh Lists" ), this ); | ||
152 | download = new QPushButton( tr( "Download" ), this ); | ||
153 | upgrade = new QPushButton( tr( "Upgrade" ), this ); | ||
154 | apply = new QPushButton( tr( "Apply" ), this ); | ||
155 | 150 | ||
156 | QVBoxLayout *vbox = new QVBoxLayout( this, 0, -1 ); | 151 | QVBoxLayout *vbox = new QVBoxLayout( this, 0, -1 ); |
@@ -181,19 +176,6 @@ void NetworkPackageManager :: initGui() | |||
181 | vbox->addWidget( packagesList ); | 176 | vbox->addWidget( packagesList ); |
182 | packagesList->addColumn( tr( "Packages" ) ); | 177 | packagesList->addColumn( tr( "Packages" ) ); |
183 | 178 | ||
184 | QHBoxLayout *hbox2 = new QHBoxLayout( vbox, -1 ); | 179 | downloadEnabled = TRUE; |
185 | hbox2->addWidget( update ); | ||
186 | hbox2->addWidget( download ); | ||
187 | hbox2->addWidget( upgrade ); | ||
188 | hbox2->addWidget( apply ); | ||
189 | } | ||
190 | |||
191 | void NetworkPackageManager :: setupConnections() | ||
192 | { | ||
193 | connect( serversList, SIGNAL(activated( int )), this, SLOT(serverSelected( int ))); | ||
194 | connect( apply, SIGNAL(released()), this, SLOT(applyChanges()) ); | ||
195 | connect( download, SIGNAL(released()), this, SLOT(downloadPackage()) ); | ||
196 | connect( upgrade, SIGNAL( released()), this, SLOT(upgradePackages()) ); | ||
197 | connect( update, SIGNAL(released()), this, SLOT(updateServer()) ); | ||
198 | } | 180 | } |
199 | 181 | ||
@@ -341,20 +323,18 @@ void NetworkPackageManager :: serverSelected( int, bool raiseProgress ) | |||
341 | if ( serverName == LOCAL_SERVER ) | 323 | if ( serverName == LOCAL_SERVER ) |
342 | { | 324 | { |
343 | upgrade->setEnabled( false ); | 325 | downloadEnabled = TRUE; |
344 | download->setText( tr( "Download" ) ); | 326 | emit appEnableUpgrade( FALSE ); |
345 | download->setEnabled( true ); | ||
346 | } | 327 | } |
347 | else if ( serverName == LOCAL_IPKGS ) | 328 | else if ( serverName == LOCAL_IPKGS ) |
348 | { | 329 | { |
349 | upgrade->setEnabled( false ); | 330 | downloadEnabled = FALSE; |
350 | download->setEnabled( true ); | 331 | emit appEnableUpgrade( FALSE ); |
351 | download->setText( tr( "Remove" ) ); | ||
352 | } | 332 | } |
353 | else | 333 | else |
354 | { | 334 | { |
355 | upgrade->setEnabled( true ); | 335 | downloadEnabled = TRUE; |
356 | download->setEnabled( true ); | 336 | emit appEnableUpgrade( TRUE ); |
357 | download->setText( tr( "Download" ) ); | ||
358 | } | 337 | } |
338 | emit appEnableDownload( downloadEnabled ); | ||
359 | 339 | ||
360 | // Display this widget once everything is done | 340 | // Display this widget once everything is done |
@@ -422,5 +402,5 @@ void NetworkPackageManager :: downloadPackage() | |||
422 | { | 402 | { |
423 | bool doUpdate = true; | 403 | bool doUpdate = true; |
424 | if ( download->text() == tr( "Download" ) ) | 404 | if ( downloadEnabled ) |
425 | { | 405 | { |
426 | // See if any packages are selected | 406 | // See if any packages are selected |
@@ -446,5 +426,5 @@ void NetworkPackageManager :: downloadPackage() | |||
446 | 426 | ||
447 | } | 427 | } |
448 | else if ( download->text() == tr( "Remove" ) ) | 428 | else |
449 | { | 429 | { |
450 | doUpdate = false; | 430 | doUpdate = false; |