Diffstat (limited to 'noncore/settings/aqpkg/installdlgimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/installdlgimpl.cpp | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp index db9a259..485fe3d 100644 --- a/noncore/settings/aqpkg/installdlgimpl.cpp +++ b/noncore/settings/aqpkg/installdlgimpl.cpp | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #ifdef QWS | 18 | #ifdef QWS |
19 | #include <qpe/config.h> | 19 | #include <qpe/config.h> |
20 | #include <qpe/qpeapplication.h> | ||
20 | #endif | 21 | #endif |
21 | 22 | ||
22 | #include <qmultilineedit.h> | 23 | #include <qmultilineedit.h> |
@@ -91,15 +92,15 @@ InstallDlgImpl::InstallDlgImpl( vector<InstallData> &packageList, DataManager *d | |||
91 | } | 92 | } |
92 | else if ( item.option == "U" || item.option == "R" ) | 93 | else if ( item.option == "U" || item.option == "R" ) |
93 | { | 94 | { |
94 | updateList.push_back( item ); | 95 | updateList.push_back( item ); |
95 | QString type = " (Upgrade)"; | 96 | QString type = " (Upgrade)"; |
96 | if ( item.option == "R" ) | 97 | if ( item.option == "R" ) |
97 | type = " (ReInstall)"; | 98 | type = " (ReInstall)"; |
98 | upgrade += " " + item.packageName + type + "\n"; | 99 | upgrade += " " + item.packageName + type + "\n"; |
99 | } | 100 | } |
100 | } | 101 | } |
101 | 102 | ||
102 | output->setText( remove + install + upgrade ); | 103 | output->setText( remove + install + upgrade ); |
103 | } | 104 | } |
104 | 105 | ||
105 | InstallDlgImpl::InstallDlgImpl( Ipkg *ipkg, QString initialText, QWidget *parent, const char *name, bool modal, WFlags fl ) | 106 | InstallDlgImpl::InstallDlgImpl( Ipkg *ipkg, QString initialText, QWidget *parent, const char *name, bool modal, WFlags fl ) |
@@ -116,27 +117,19 @@ InstallDlgImpl::~InstallDlgImpl() | |||
116 | 117 | ||
117 | bool InstallDlgImpl :: showDlg() | 118 | bool InstallDlgImpl :: showDlg() |
118 | { | 119 | { |
119 | showMaximized(); | 120 | showMaximized(); |
120 | bool ret = exec(); | 121 | bool ret = exec(); |
121 | 122 | ||
122 | return ret; | 123 | return ret; |
123 | } | 124 | } |
124 | 125 | ||
125 | void InstallDlgImpl :: optionsSelected() | 126 | void InstallDlgImpl :: optionsSelected() |
126 | { | 127 | { |
127 | InstallOptionsDlgImpl opt( flags, this, "Option", true ); | 128 | InstallOptionsDlgImpl opt( flags, this, "Option", true ); |
128 | opt.exec(); | 129 | opt.exec(); |
129 | 130 | ||
130 | // set options selected from dialog | 131 | // set options selected from dialog |
131 | flags = 0; | 132 | flags = opt.getFlags(); |
132 | if ( opt.forceDepends->isChecked() ) | ||
133 | flags |= FORCE_DEPENDS; | ||
134 | if ( opt.forceReinstall->isChecked() ) | ||
135 | flags |= FORCE_REINSTALL; | ||
136 | if ( opt.forceRemove->isChecked() ) | ||
137 | flags |= FORCE_REMOVE; | ||
138 | if ( opt.forceOverwrite->isChecked() ) | ||
139 | flags |= FORCE_OVERWRITE; | ||
140 | 133 | ||
141 | #ifdef QWS | 134 | #ifdef QWS |
142 | Config cfg( "aqpkg" ); | 135 | Config cfg( "aqpkg" ); |
@@ -147,13 +140,16 @@ void InstallDlgImpl :: optionsSelected() | |||
147 | 140 | ||
148 | void InstallDlgImpl :: installSelected() | 141 | void InstallDlgImpl :: installSelected() |
149 | { | 142 | { |
150 | if ( btnInstall->text() == "Close" ) | 143 | |
151 | { | 144 | if ( btnInstall->text() == "Close" ) |
152 | done( 1 ); | 145 | { |
153 | return; | 146 | done( 1 ); |
154 | } | 147 | return; |
148 | } | ||
155 | 149 | ||
156 | btnInstall->setEnabled( false ); | 150 | // Disable buttons |
151 | btnOptions->setEnabled( false ); | ||
152 | btnInstall->setEnabled( false ); | ||
157 | 153 | ||
158 | if ( pIpkg ) | 154 | if ( pIpkg ) |
159 | { | 155 | { |
@@ -183,7 +179,7 @@ void InstallDlgImpl :: installSelected() | |||
183 | connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); | 179 | connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); |
184 | 180 | ||
185 | // First run through the remove list, then the install list then the upgrade list | 181 | // First run through the remove list, then the install list then the upgrade list |
186 | vector<InstallData>::iterator it; | 182 | vector<InstallData>::iterator it; |
187 | pIpkg->setOption( "remove" ); | 183 | pIpkg->setOption( "remove" ); |
188 | for ( it = removeList.begin() ; it != removeList.end() ; ++it ) | 184 | for ( it = removeList.begin() ; it != removeList.end() ; ++it ) |
189 | { | 185 | { |
@@ -230,7 +226,8 @@ void InstallDlgImpl :: installSelected() | |||
230 | delete pIpkg; | 226 | delete pIpkg; |
231 | } | 227 | } |
232 | 228 | ||
233 | btnInstall->setEnabled( true ); | 229 | btnOptions->setEnabled( true ); |
230 | btnInstall->setEnabled( true ); | ||
234 | btnInstall->setText( tr( "Close" ) ); | 231 | btnInstall->setText( tr( "Close" ) ); |
235 | } | 232 | } |
236 | 233 | ||