Diffstat (limited to 'noncore/settings/aqpkg/mainwin.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 84 |
1 files changed, 39 insertions, 45 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp index a25f5a7..947aace 100644 --- a/noncore/settings/aqpkg/mainwin.cpp +++ b/noncore/settings/aqpkg/mainwin.cpp | |||
@@ -45,6 +45,7 @@ | |||
45 | #include "global.h" | 45 | #include "global.h" |
46 | #include "helpwindow.h" | 46 | #include "helpwindow.h" |
47 | #include "inputdlg.h" | 47 | #include "inputdlg.h" |
48 | #include "ipkg.h" | ||
48 | #include "installdlgimpl.h" | 49 | #include "installdlgimpl.h" |
49 | #include "letterpushbutton.h" | 50 | #include "letterpushbutton.h" |
50 | #include "mainwin.h" | 51 | #include "mainwin.h" |
@@ -88,9 +89,6 @@ MainWindow :: MainWindow() | |||
88 | jumpBar->setStretchableWidget( w ); | 89 | jumpBar->setStretchableWidget( w ); |
89 | 90 | ||
90 | QGridLayout *layout = new QGridLayout( w ); | 91 | QGridLayout *layout = new QGridLayout( w ); |
91 | //QVBoxLayout *vbox = new QVBoxLayout( w, 0, -1 ); | ||
92 | //QHBoxLayout *hbox3 = new QHBoxLayout( vbox, -1 ); | ||
93 | //QHBoxLayout *hbox4 = new QHBoxLayout( vbox, -1 ); | ||
94 | 92 | ||
95 | char text[2]; | 93 | char text[2]; |
96 | text[1] = '\0'; | 94 | text[1] = '\0'; |
@@ -100,12 +98,6 @@ MainWindow :: MainWindow() | |||
100 | LetterPushButton *b = new LetterPushButton( text, w ); | 98 | LetterPushButton *b = new LetterPushButton( text, w ); |
101 | connect( b, SIGNAL( released( QString ) ), this, SLOT( letterPushed( QString ) ) ); | 99 | connect( b, SIGNAL( released( QString ) ), this, SLOT( letterPushed( QString ) ) ); |
102 | layout->addWidget( b, i / 13, i % 13); | 100 | layout->addWidget( b, i / 13, i % 13); |
103 | /* | ||
104 | if ( i < 13 ) | ||
105 | hbox3->addWidget( b ); | ||
106 | else | ||
107 | hbox4->addWidget( b ); | ||
108 | */ | ||
109 | } | 101 | } |
110 | 102 | ||
111 | QAction *a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, w, 0 ); | 103 | QAction *a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, w, 0 ); |
@@ -798,13 +790,13 @@ void MainWindow :: updateServer() | |||
798 | // First, write out ipkg_conf file so that ipkg can use it | 790 | // First, write out ipkg_conf file so that ipkg can use it |
799 | mgr->writeOutIpkgConf(); | 791 | mgr->writeOutIpkgConf(); |
800 | 792 | ||
801 | Ipkg ipkg; | 793 | Ipkg *ipkg = new Ipkg; |
802 | ipkg.setOption( "update" ); | 794 | ipkg->setOption( "update" ); |
803 | |||
804 | InstallDlgImpl dlg( &ipkg, tr( "Refreshing server package lists" ), this, tr( "Upgrade" ), true ); | ||
805 | dlg.showDlg(); | ||
806 | 795 | ||
807 | reloadData(); | 796 | InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Refreshing server package lists" ), |
797 | tr( "Update lists" ) ); | ||
798 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); | ||
799 | dlg->showMaximized(); | ||
808 | 800 | ||
809 | // delete progDlg; | 801 | // delete progDlg; |
810 | } | 802 | } |
@@ -827,15 +819,16 @@ void MainWindow :: upgradePackages() | |||
827 | mgr->writeOutIpkgConf(); | 819 | mgr->writeOutIpkgConf(); |
828 | 820 | ||
829 | // Now run upgrade | 821 | // Now run upgrade |
830 | Ipkg ipkg; | 822 | Ipkg *ipkg = new Ipkg; |
831 | ipkg.setOption( "upgrade" ); | 823 | ipkg->setOption( "upgrade" ); |
832 | |||
833 | InstallDlgImpl dlg( &ipkg, tr( "Upgrading installed packages" ), this, tr( "Upgrade" ), true ); | ||
834 | dlg.showDlg(); | ||
835 | 824 | ||
836 | reloadData(); | 825 | InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Upgrading installed packages" ), |
826 | tr ( "Upgrade" ) ); | ||
827 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); | ||
828 | dlg->showMaximized(); | ||
837 | } | 829 | } |
838 | } | 830 | } |
831 | |||
839 | void MainWindow :: downloadPackage() | 832 | void MainWindow :: downloadPackage() |
840 | { | 833 | { |
841 | bool doUpdate = true; | 834 | bool doUpdate = true; |
@@ -898,7 +891,7 @@ void MainWindow :: upgradePackages() | |||
898 | 891 | ||
899 | if ( doUpdate ) | 892 | if ( doUpdate ) |
900 | { | 893 | { |
901 | reloadData(); | 894 | reloadData( 0x0 ); |
902 | } | 895 | } |
903 | } | 896 | } |
904 | 897 | ||
@@ -970,17 +963,9 @@ void MainWindow :: downloadRemotePackage() | |||
970 | vector<InstallData> workingPackages; | 963 | vector<InstallData> workingPackages; |
971 | workingPackages.push_back( item ); | 964 | workingPackages.push_back( item ); |
972 | 965 | ||
973 | InstallDlgImpl dlg2( workingPackages, mgr, this, "Install", true ); | 966 | InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Download" ) ); |
974 | dlg2.showDlg(); | 967 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); |
975 | 968 | dlg->showMaximized(); | |
976 | reloadData(); | ||
977 | |||
978 | #ifdef QWS | ||
979 | // Finally let the main system update itself | ||
980 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | ||
981 | QString lf = QString::null; | ||
982 | e << lf; | ||
983 | #endif | ||
984 | } | 969 | } |
985 | 970 | ||
986 | 971 | ||
@@ -1016,17 +1001,9 @@ void MainWindow :: applyChanges() | |||
1016 | } | 1001 | } |
1017 | 1002 | ||
1018 | // do the stuff | 1003 | // do the stuff |
1019 | InstallDlgImpl dlg( workingPackages, mgr, this, "Install", true ); | 1004 | InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Apply changes" ) ); |
1020 | dlg.showDlg(); | 1005 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); |
1021 | 1006 | dlg->showMaximized(); | |
1022 | reloadData(); | ||
1023 | |||
1024 | #ifdef QWS | ||
1025 | // Finally let the main system update itself | ||
1026 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | ||
1027 | QString lf = QString::null; | ||
1028 | e << lf; | ||
1029 | #endif | ||
1030 | } | 1007 | } |
1031 | 1008 | ||
1032 | // decide what to do - either remove, upgrade or install | 1009 | // decide what to do - either remove, upgrade or install |
@@ -1150,11 +1127,28 @@ InstallData MainWindow :: dealWithItem( QCheckListItem *item ) | |||
1150 | } | 1127 | } |
1151 | } | 1128 | } |
1152 | 1129 | ||
1153 | void MainWindow :: reloadData() | 1130 | void MainWindow :: reloadData( InstallDlgImpl *dlg ) |
1154 | { | 1131 | { |
1155 | stack->raiseWidget( progressWindow ); | 1132 | stack->raiseWidget( progressWindow ); |
1133 | |||
1134 | if ( dlg ) | ||
1135 | { | ||
1136 | dlg->close(); | ||
1137 | delete dlg; | ||
1138 | } | ||
1139 | |||
1156 | mgr->reloadServerData(); | 1140 | mgr->reloadServerData(); |
1157 | serverSelected( -1, FALSE ); | 1141 | serverSelected( -1, FALSE ); |
1142 | |||
1143 | #ifdef QWS | ||
1144 | m_status->setText( tr( "Updating Launcher..." ) ); | ||
1145 | |||
1146 | // Finally let the main system update itself | ||
1147 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | ||
1148 | QString lf = QString::null; | ||
1149 | e << lf; | ||
1150 | #endif | ||
1151 | |||
1158 | stack->raiseWidget( networkPkgWindow ); | 1152 | stack->raiseWidget( networkPkgWindow ); |
1159 | } | 1153 | } |
1160 | 1154 | ||