-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 7 | ||||
-rw-r--r-- | noncore/settings/aqpkg/mainwin.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp index 58f6feb..f0e8e48 100644 --- a/noncore/settings/aqpkg/mainwin.cpp +++ b/noncore/settings/aqpkg/mainwin.cpp | |||
@@ -747,24 +747,25 @@ void MainWindow :: updateServer() | |||
747 | 747 | ||
748 | // Disable buttons to stop silly people clicking lots on them :) | 748 | // Disable buttons to stop silly people clicking lots on them :) |
749 | 749 | ||
750 | // First, write out ipkg_conf file so that ipkg can use it | 750 | // First, write out ipkg_conf file so that ipkg can use it |
751 | mgr->writeOutIpkgConf(); | 751 | mgr->writeOutIpkgConf(); |
752 | 752 | ||
753 | Ipkg *ipkg = new Ipkg; | 753 | Ipkg *ipkg = new Ipkg; |
754 | ipkg->setOption( "update" ); | 754 | ipkg->setOption( "update" ); |
755 | 755 | ||
756 | InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Refreshing server package lists" ), | 756 | InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Refreshing server package lists" ), |
757 | tr( "Update lists" ) ); | 757 | tr( "Update lists" ) ); |
758 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); | 758 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); |
759 | reloadDocuments = FALSE; | ||
759 | stack->addWidget( dlg, 3 ); | 760 | stack->addWidget( dlg, 3 ); |
760 | stack->raiseWidget( dlg ); | 761 | stack->raiseWidget( dlg ); |
761 | 762 | ||
762 | // delete progDlg; | 763 | // delete progDlg; |
763 | } | 764 | } |
764 | 765 | ||
765 | void MainWindow :: upgradePackages() | 766 | void MainWindow :: upgradePackages() |
766 | { | 767 | { |
767 | // We're gonna do an upgrade of all packages | 768 | // We're gonna do an upgrade of all packages |
768 | // First warn user that this isn't recommended | 769 | // First warn user that this isn't recommended |
769 | // TODO - ODevice???? | 770 | // TODO - ODevice???? |
770 | QString text = tr( "WARNING: Upgrading while\nOpie/Qtopia is running\nis NOT recommended!\n\nAre you sure?\n" ); | 771 | QString text = tr( "WARNING: Upgrading while\nOpie/Qtopia is running\nis NOT recommended!\n\nAre you sure?\n" ); |
@@ -777,24 +778,25 @@ void MainWindow :: upgradePackages() | |||
777 | if ( warn.exec() == QMessageBox::Yes ) | 778 | if ( warn.exec() == QMessageBox::Yes ) |
778 | { | 779 | { |
779 | // First, write out ipkg_conf file so that ipkg can use it | 780 | // First, write out ipkg_conf file so that ipkg can use it |
780 | mgr->writeOutIpkgConf(); | 781 | mgr->writeOutIpkgConf(); |
781 | 782 | ||
782 | // Now run upgrade | 783 | // Now run upgrade |
783 | Ipkg *ipkg = new Ipkg; | 784 | Ipkg *ipkg = new Ipkg; |
784 | ipkg->setOption( "upgrade" ); | 785 | ipkg->setOption( "upgrade" ); |
785 | 786 | ||
786 | InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Upgrading installed packages" ), | 787 | InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Upgrading installed packages" ), |
787 | tr ( "Upgrade" ) ); | 788 | tr ( "Upgrade" ) ); |
788 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); | 789 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); |
790 | reloadDocuments = TRUE; | ||
789 | stack->addWidget( dlg, 3 ); | 791 | stack->addWidget( dlg, 3 ); |
790 | stack->raiseWidget( dlg ); | 792 | stack->raiseWidget( dlg ); |
791 | } | 793 | } |
792 | } | 794 | } |
793 | 795 | ||
794 | void MainWindow :: downloadPackage() | 796 | void MainWindow :: downloadPackage() |
795 | { | 797 | { |
796 | bool doUpdate = true; | 798 | bool doUpdate = true; |
797 | if ( downloadEnabled ) | 799 | if ( downloadEnabled ) |
798 | { | 800 | { |
799 | // See if any packages are selected | 801 | // See if any packages are selected |
800 | bool found = false; | 802 | bool found = false; |
@@ -919,24 +921,25 @@ void MainWindow :: downloadRemotePackage() | |||
919 | // grab details from dialog | 921 | // grab details from dialog |
920 | // QString package = dlg.getPackageLocation(); | 922 | // QString package = dlg.getPackageLocation(); |
921 | 923 | ||
922 | InstallData *item = new InstallData(); | 924 | InstallData *item = new InstallData(); |
923 | item->option = "I"; | 925 | item->option = "I"; |
924 | item->packageName = package; | 926 | item->packageName = package; |
925 | QList<InstallData> workingPackages; | 927 | QList<InstallData> workingPackages; |
926 | workingPackages.setAutoDelete( TRUE ); | 928 | workingPackages.setAutoDelete( TRUE ); |
927 | workingPackages.append( item ); | 929 | workingPackages.append( item ); |
928 | 930 | ||
929 | InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Download" ) ); | 931 | InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Download" ) ); |
930 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); | 932 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); |
933 | reloadDocuments = TRUE; | ||
931 | stack->addWidget( dlg, 3 ); | 934 | stack->addWidget( dlg, 3 ); |
932 | stack->raiseWidget( dlg ); | 935 | stack->raiseWidget( dlg ); |
933 | } | 936 | } |
934 | 937 | ||
935 | 938 | ||
936 | void MainWindow :: applyChanges() | 939 | void MainWindow :: applyChanges() |
937 | { | 940 | { |
938 | stickyOption = ""; | 941 | stickyOption = ""; |
939 | 942 | ||
940 | // First, write out ipkg_conf file so that ipkg can use it | 943 | // First, write out ipkg_conf file so that ipkg can use it |
941 | mgr->writeOutIpkgConf(); | 944 | mgr->writeOutIpkgConf(); |
942 | 945 | ||
@@ -958,24 +961,25 @@ void MainWindow :: applyChanges() | |||
958 | if ( workingPackages.count() == 0 ) | 961 | if ( workingPackages.count() == 0 ) |
959 | { | 962 | { |
960 | // Nothing to do | 963 | // Nothing to do |
961 | QMessageBox::information( this, tr( "Nothing to do" ), | 964 | QMessageBox::information( this, tr( "Nothing to do" ), |
962 | tr( "No packages selected" ), tr( "OK" ) ); | 965 | tr( "No packages selected" ), tr( "OK" ) ); |
963 | 966 | ||
964 | return; | 967 | return; |
965 | } | 968 | } |
966 | 969 | ||
967 | // do the stuff | 970 | // do the stuff |
968 | InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Apply changes" ) ); | 971 | InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Apply changes" ) ); |
969 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); | 972 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); |
973 | reloadDocuments = TRUE; | ||
970 | stack->addWidget( dlg, 3 ); | 974 | stack->addWidget( dlg, 3 ); |
971 | stack->raiseWidget( dlg ); | 975 | stack->raiseWidget( dlg ); |
972 | } | 976 | } |
973 | 977 | ||
974 | // decide what to do - either remove, upgrade or install | 978 | // decide what to do - either remove, upgrade or install |
975 | // Current rules: | 979 | // Current rules: |
976 | // If not installed - install | 980 | // If not installed - install |
977 | // If installed and different version available - upgrade | 981 | // If installed and different version available - upgrade |
978 | // If installed and version up to date - remove | 982 | // If installed and version up to date - remove |
979 | InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) | 983 | InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) |
980 | { | 984 | { |
981 | QString name = item->text(); | 985 | QString name = item->text(); |
@@ -1097,30 +1101,33 @@ void MainWindow :: reloadData( InstallDlgImpl *dlg ) | |||
1097 | stack->raiseWidget( progressWindow ); | 1101 | stack->raiseWidget( progressWindow ); |
1098 | 1102 | ||
1099 | if ( dlg ) | 1103 | if ( dlg ) |
1100 | { | 1104 | { |
1101 | dlg->close(); | 1105 | dlg->close(); |
1102 | delete dlg; | 1106 | delete dlg; |
1103 | } | 1107 | } |
1104 | 1108 | ||
1105 | mgr->reloadServerData(); | 1109 | mgr->reloadServerData(); |
1106 | serverSelected( -1, FALSE ); | 1110 | serverSelected( -1, FALSE ); |
1107 | 1111 | ||
1108 | #ifdef QWS | 1112 | #ifdef QWS |
1113 | if ( reloadDocuments ) | ||
1114 | { | ||
1109 | m_status->setText( tr( "Updating Launcher..." ) ); | 1115 | m_status->setText( tr( "Updating Launcher..." ) ); |
1110 | 1116 | ||
1111 | // Finally let the main system update itself | 1117 | // Finally let the main system update itself |
1112 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 1118 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
1113 | QString lf = QString::null; | 1119 | QString lf = QString::null; |
1114 | e << lf; | 1120 | e << lf; |
1121 | } | ||
1115 | #endif | 1122 | #endif |
1116 | 1123 | ||
1117 | stack->raiseWidget( networkPkgWindow ); | 1124 | stack->raiseWidget( networkPkgWindow ); |
1118 | } | 1125 | } |
1119 | 1126 | ||
1120 | void MainWindow :: letterPushed( QString t ) | 1127 | void MainWindow :: letterPushed( QString t ) |
1121 | { | 1128 | { |
1122 | QCheckListItem *top = (QCheckListItem *)packagesList->firstChild(); | 1129 | QCheckListItem *top = (QCheckListItem *)packagesList->firstChild(); |
1123 | QCheckListItem *start = (QCheckListItem *)packagesList->currentItem(); | 1130 | QCheckListItem *start = (QCheckListItem *)packagesList->currentItem(); |
1124 | if ( packagesList->firstChild() == 0 ) | 1131 | if ( packagesList->firstChild() == 0 ) |
1125 | return; | 1132 | return; |
1126 | 1133 | ||
diff --git a/noncore/settings/aqpkg/mainwin.h b/noncore/settings/aqpkg/mainwin.h index c4548b1..f95c332 100644 --- a/noncore/settings/aqpkg/mainwin.h +++ b/noncore/settings/aqpkg/mainwin.h | |||
@@ -79,24 +79,25 @@ private: | |||
79 | QPixmap installedIcon; | 79 | QPixmap installedIcon; |
80 | QPixmap updatedIcon; | 80 | QPixmap updatedIcon; |
81 | QString currentlySelectedServer; | 81 | QString currentlySelectedServer; |
82 | QString categoryFilter; | 82 | QString categoryFilter; |
83 | QString stickyOption; | 83 | QString stickyOption; |
84 | 84 | ||
85 | bool categoryFilterEnabled; | 85 | bool categoryFilterEnabled; |
86 | bool showJumpTo; | 86 | bool showJumpTo; |
87 | bool showUninstalledPkgs; | 87 | bool showUninstalledPkgs; |
88 | bool showInstalledPkgs; | 88 | bool showInstalledPkgs; |
89 | bool showUpgradedPkgs; | 89 | bool showUpgradedPkgs; |
90 | bool downloadEnabled; | 90 | bool downloadEnabled; |
91 | bool reloadDocuments; | ||
91 | 92 | ||
92 | void initMainWidget(); | 93 | void initMainWidget(); |
93 | void updateData(); | 94 | void updateData(); |
94 | void serverSelected( int index, bool showProgress ); | 95 | void serverSelected( int index, bool showProgress ); |
95 | void searchForPackage( const QString & ); | 96 | void searchForPackage( const QString & ); |
96 | bool filterByCategory( bool val ); | 97 | bool filterByCategory( bool val ); |
97 | void downloadSelectedPackages(); | 98 | void downloadSelectedPackages(); |
98 | void downloadRemotePackage(); | 99 | void downloadRemotePackage(); |
99 | InstallData *dealWithItem( QCheckListItem *item ); | 100 | InstallData *dealWithItem( QCheckListItem *item ); |
100 | 101 | ||
101 | // Progress widget | 102 | // Progress widget |
102 | QWidget *progressWindow; | 103 | QWidget *progressWindow; |