Diffstat (limited to 'noncore/settings/aqpkg/mainwin.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp index c9963bc..8090646 100644 --- a/noncore/settings/aqpkg/mainwin.cpp +++ b/noncore/settings/aqpkg/mainwin.cpp | |||
@@ -293,13 +293,13 @@ void MainWindow :: init() | |||
293 | categoryFilterEnabled = false; | 293 | categoryFilterEnabled = false; |
294 | 294 | ||
295 | updateData(); | 295 | updateData(); |
296 | 296 | ||
297 | stack->raiseWidget( networkPkgWindow ); | 297 | stack->raiseWidget( networkPkgWindow ); |
298 | } | 298 | } |
299 | 299 | /* | |
300 | void MainWindow :: setDocument( const QString &doc ) | 300 | void MainWindow :: setDocument( const QString &doc ) |
301 | { | 301 | { |
302 | // Remove path from package | 302 | // Remove path from package |
303 | QString package = Utils::getPackageNameFromIpkFilename( doc ); | 303 | QString package = Utils::getPackageNameFromIpkFilename( doc ); |
304 | // std::cout << "Selecting package " << package << std::endl; | 304 | // std::cout << "Selecting package " << package << std::endl; |
305 | 305 | ||
@@ -323,18 +323,22 @@ void MainWindow :: setDocument( const QString &doc ) | |||
323 | { | 323 | { |
324 | item->setOn( true ); | 324 | item->setOn( true ); |
325 | break; | 325 | break; |
326 | } | 326 | } |
327 | } | 327 | } |
328 | } | 328 | } |
329 | 329 | */ | |
330 | void MainWindow :: displaySettings() | 330 | void MainWindow :: displaySettings() |
331 | { | 331 | { |
332 | SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true ); | 332 | SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true ); |
333 | if ( dlg->showDlg( 0 ) ) | 333 | if ( dlg->showDlg( 0 ) ) |
334 | { | ||
335 | stack->raiseWidget( progressWindow ); | ||
334 | updateData(); | 336 | updateData(); |
337 | stack->raiseWidget( networkPkgWindow ); | ||
338 | } | ||
335 | delete dlg; | 339 | delete dlg; |
336 | } | 340 | } |
337 | 341 | ||
338 | void MainWindow :: displayHelp() | 342 | void MainWindow :: displayHelp() |
339 | { | 343 | { |
340 | HelpWindow *dlg = new HelpWindow( this ); | 344 | HelpWindow *dlg = new HelpWindow( this ); |
@@ -725,14 +729,14 @@ void MainWindow :: searchForPackage( const QString &text ) | |||
725 | if ( !text.isEmpty() ) | 729 | if ( !text.isEmpty() ) |
726 | { | 730 | { |
727 | // cout << "searching for " << text << endl; | 731 | // cout << "searching for " << text << endl; |
728 | // look through package list for text startng at current position | 732 | // look through package list for text startng at current position |
729 | vector<InstallData> workingPackages; | 733 | vector<InstallData> workingPackages; |
730 | QCheckListItem *start = (QCheckListItem *)packagesList->currentItem(); | 734 | QCheckListItem *start = (QCheckListItem *)packagesList->currentItem(); |
731 | if ( start != 0 ) | 735 | // if ( start != 0 ) |
732 | start = (QCheckListItem *)start->nextSibling(); | 736 | // start = (QCheckListItem *)start->nextSibling(); |
733 | 737 | ||
734 | if ( start == 0 ) | 738 | if ( start == 0 ) |
735 | start = (QCheckListItem *)packagesList->firstChild(); | 739 | start = (QCheckListItem *)packagesList->firstChild(); |
736 | 740 | ||
737 | for ( QCheckListItem *item = start; item != 0 ; | 741 | for ( QCheckListItem *item = start; item != 0 ; |
738 | item = (QCheckListItem *)item->nextSibling() ) | 742 | item = (QCheckListItem *)item->nextSibling() ) |
@@ -764,15 +768,14 @@ void MainWindow :: updateServer() | |||
764 | Ipkg ipkg; | 768 | Ipkg ipkg; |
765 | ipkg.setOption( "update" ); | 769 | ipkg.setOption( "update" ); |
766 | 770 | ||
767 | InstallDlgImpl dlg( &ipkg, tr( "Refreshing server package lists" ), this, tr( "Upgrade" ), true ); | 771 | InstallDlgImpl dlg( &ipkg, tr( "Refreshing server package lists" ), this, tr( "Upgrade" ), true ); |
768 | dlg.showDlg(); | 772 | dlg.showDlg(); |
769 | 773 | ||
770 | // Reload data | 774 | reloadData(); |
771 | mgr->reloadServerData(); | 775 | |
772 | serverSelected(-1); | ||
773 | // delete progDlg; | 776 | // delete progDlg; |
774 | } | 777 | } |
775 | 778 | ||
776 | void MainWindow :: upgradePackages() | 779 | void MainWindow :: upgradePackages() |
777 | { | 780 | { |
778 | // We're gonna do an upgrade of all packages | 781 | // We're gonna do an upgrade of all packages |
@@ -794,15 +797,13 @@ void MainWindow :: upgradePackages() | |||
794 | Ipkg ipkg; | 797 | Ipkg ipkg; |
795 | ipkg.setOption( "upgrade" ); | 798 | ipkg.setOption( "upgrade" ); |
796 | 799 | ||
797 | InstallDlgImpl dlg( &ipkg, tr( "Upgrading installed packages" ), this, tr( "Upgrade" ), true ); | 800 | InstallDlgImpl dlg( &ipkg, tr( "Upgrading installed packages" ), this, tr( "Upgrade" ), true ); |
798 | dlg.showDlg(); | 801 | dlg.showDlg(); |
799 | 802 | ||
800 | // Reload data | 803 | reloadData(); |
801 | mgr->reloadServerData(); | ||
802 | serverSelected(-1); | ||
803 | } | 804 | } |
804 | } | 805 | } |
805 | void MainWindow :: downloadPackage() | 806 | void MainWindow :: downloadPackage() |
806 | { | 807 | { |
807 | bool doUpdate = true; | 808 | bool doUpdate = true; |
808 | if ( downloadEnabled ) | 809 | if ( downloadEnabled ) |
@@ -861,14 +862,13 @@ void MainWindow :: upgradePackages() | |||
861 | } | 862 | } |
862 | } | 863 | } |
863 | } | 864 | } |
864 | 865 | ||
865 | if ( doUpdate ) | 866 | if ( doUpdate ) |
866 | { | 867 | { |
867 | mgr->reloadServerData(); | 868 | reloadData(); |
868 | serverSelected( -1 ); | ||
869 | } | 869 | } |
870 | } | 870 | } |
871 | 871 | ||
872 | void MainWindow :: downloadSelectedPackages() | 872 | void MainWindow :: downloadSelectedPackages() |
873 | { | 873 | { |
874 | // First, write out ipkg_conf file so that ipkg can use it | 874 | // First, write out ipkg_conf file so that ipkg can use it |
@@ -937,15 +937,13 @@ void MainWindow :: downloadRemotePackage() | |||
937 | vector<InstallData> workingPackages; | 937 | vector<InstallData> workingPackages; |
938 | workingPackages.push_back( item ); | 938 | workingPackages.push_back( item ); |
939 | 939 | ||
940 | InstallDlgImpl dlg2( workingPackages, mgr, this, "Install", true ); | 940 | InstallDlgImpl dlg2( workingPackages, mgr, this, "Install", true ); |
941 | dlg2.showDlg(); | 941 | dlg2.showDlg(); |
942 | 942 | ||
943 | // Reload data | 943 | reloadData(); |
944 | mgr->reloadServerData(); | ||
945 | serverSelected(-1); | ||
946 | 944 | ||
947 | #ifdef QWS | 945 | #ifdef QWS |
948 | // Finally let the main system update itself | 946 | // Finally let the main system update itself |
949 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 947 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
950 | QString lf = QString::null; | 948 | QString lf = QString::null; |
951 | e << lf; | 949 | e << lf; |
@@ -985,15 +983,13 @@ void MainWindow :: applyChanges() | |||
985 | } | 983 | } |
986 | 984 | ||
987 | // do the stuff | 985 | // do the stuff |
988 | InstallDlgImpl dlg( workingPackages, mgr, this, "Install", true ); | 986 | InstallDlgImpl dlg( workingPackages, mgr, this, "Install", true ); |
989 | dlg.showDlg(); | 987 | dlg.showDlg(); |
990 | 988 | ||
991 | // Reload data | 989 | reloadData(); |
992 | mgr->reloadServerData(); | ||
993 | serverSelected(-1); | ||
994 | 990 | ||
995 | #ifdef QWS | 991 | #ifdef QWS |
996 | // Finally let the main system update itself | 992 | // Finally let the main system update itself |
997 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 993 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
998 | QString lf = QString::null; | 994 | QString lf = QString::null; |
999 | e << lf; | 995 | e << lf; |
@@ -1118,12 +1114,20 @@ InstallData MainWindow :: dealWithItem( QCheckListItem *item ) | |||
1118 | 1114 | ||
1119 | // User hit cancel (on dlg - assume remove) | 1115 | // User hit cancel (on dlg - assume remove) |
1120 | return item; | 1116 | return item; |
1121 | } | 1117 | } |
1122 | } | 1118 | } |
1123 | 1119 | ||
1120 | void MainWindow :: reloadData() | ||
1121 | { | ||
1122 | stack->raiseWidget( progressWindow ); | ||
1123 | mgr->reloadServerData(); | ||
1124 | serverSelected( -1, FALSE ); | ||
1125 | stack->raiseWidget( networkPkgWindow ); | ||
1126 | } | ||
1127 | |||
1124 | void MainWindow :: letterPushed( QString t ) | 1128 | void MainWindow :: letterPushed( QString t ) |
1125 | { | 1129 | { |
1126 | QCheckListItem *top = (QCheckListItem *)packagesList->firstChild(); | 1130 | QCheckListItem *top = (QCheckListItem *)packagesList->firstChild(); |
1127 | QCheckListItem *start = (QCheckListItem *)packagesList->currentItem(); | 1131 | QCheckListItem *start = (QCheckListItem *)packagesList->currentItem(); |
1128 | if ( packagesList->firstChild() == 0 ) | 1132 | if ( packagesList->firstChild() == 0 ) |
1129 | return; | 1133 | return; |