Diffstat (limited to 'noncore/settings/aqpkg/installdlgimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/installdlgimpl.cpp | 58 |
1 files changed, 47 insertions, 11 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp index 2bb8b4d..76d0a80 100644 --- a/noncore/settings/aqpkg/installdlgimpl.cpp +++ b/noncore/settings/aqpkg/installdlgimpl.cpp | |||
@@ -18,2 +18,4 @@ | |||
18 | #include <stdio.h> | 18 | #include <stdio.h> |
19 | |||
20 | #include <opie/ofiledialog.h> | ||
19 | 21 | ||
@@ -21,2 +23,3 @@ | |||
21 | #include <qpe/config.h> | 23 | #include <qpe/config.h> |
24 | #include <qpe/fileselector.h> | ||
22 | #include <qpe/qpeapplication.h> | 25 | #include <qpe/qpeapplication.h> |
@@ -29,2 +32,3 @@ | |||
29 | #include <qdialog.h> | 32 | #include <qdialog.h> |
33 | #include <qfileinfo.h> | ||
30 | #include <qgroupbox.h> | 34 | #include <qgroupbox.h> |
@@ -65,2 +69,3 @@ InstallDlgImpl::InstallDlgImpl( QList<InstallData> &packageList, DataManager *da | |||
65 | flags = cfg.readNumEntry( "installFlags", 0 ); | 69 | flags = cfg.readNumEntry( "installFlags", 0 ); |
70 | infoLevel = cfg.readNumEntry( "infoLevel", 1 ); | ||
66 | #else | 71 | #else |
@@ -192,13 +197,41 @@ void InstallDlgImpl :: optionsSelected() | |||
192 | { | 197 | { |
193 | InstallOptionsDlgImpl opt( flags, this, "Option", true ); | 198 | if ( btnOptions->text() == tr( "Options" ) ) |
194 | opt.exec(); | 199 | { |
195 | 200 | InstallOptionsDlgImpl opt( flags, infoLevel, this, "Option", true ); | |
196 | // set options selected from dialog | 201 | if ( opt.exec() == QDialog::Accepted ) |
197 | flags = opt.getFlags(); | 202 | { |
203 | // set options selected from dialog | ||
204 | flags = opt.getFlags(); | ||
205 | infoLevel = opt.getInfoLevel(); | ||
198 | 206 | ||
199 | #ifdef QWS | 207 | #ifdef QWS |
200 | Config cfg( "aqpkg" ); | 208 | Config cfg( "aqpkg" ); |
201 | cfg.setGroup( "settings" ); | 209 | cfg.setGroup( "settings" ); |
202 | cfg.writeEntry( "installFlags", flags ); | 210 | cfg.writeEntry( "installFlags", flags ); |
211 | cfg.writeEntry( "infoLevel", infoLevel ); | ||
203 | #endif | 212 | #endif |
213 | } | ||
214 | } | ||
215 | else // Save output | ||
216 | { | ||
217 | QMap<QString, QStringList> map; | ||
218 | map.insert( tr( "All" ), QStringList() ); | ||
219 | QStringList text; | ||
220 | text << "text/*"; | ||
221 | map.insert(tr( "Text" ), text ); | ||
222 | text << "*"; | ||
223 | map.insert( tr( "All" ), text ); | ||
224 | |||
225 | QString filename = OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map ); | ||
226 | if( !filename.isEmpty() ) | ||
227 | { | ||
228 | QString currentFileName = QFileInfo( filename ).fileName(); | ||
229 | DocLnk doc; | ||
230 | doc.setType( "text/plain" ); | ||
231 | doc.setFile( filename ); | ||
232 | doc.setName( currentFileName ); | ||
233 | FileManager fm; | ||
234 | fm.saveFile( doc, output->text() ); | ||
235 | } | ||
236 | } | ||
204 | } | 237 | } |
@@ -274,3 +307,3 @@ void InstallDlgImpl :: installSelected() | |||
274 | 307 | ||
275 | pIpkg->setFlags( tmpFlags ); | 308 | pIpkg->setFlags( tmpFlags, infoLevel ); |
276 | pIpkg->runIpkg(); | 309 | pIpkg->runIpkg(); |
@@ -281,3 +314,3 @@ void InstallDlgImpl :: installSelected() | |||
281 | pIpkg->setDestinationDir( destDir ); | 314 | pIpkg->setDestinationDir( destDir ); |
282 | pIpkg->setFlags( instFlags ); | 315 | pIpkg->setFlags( instFlags, infoLevel ); |
283 | QListIterator<InstallData> it2( installList ); | 316 | QListIterator<InstallData> it2( installList ); |
@@ -305,3 +338,3 @@ void InstallDlgImpl :: installSelected() | |||
305 | tmpFlags |= MAKE_LINKS; | 338 | tmpFlags |= MAKE_LINKS; |
306 | pIpkg->setFlags( tmpFlags ); | 339 | pIpkg->setFlags( tmpFlags, infoLevel ); |
307 | pIpkg->runIpkg(); | 340 | pIpkg->runIpkg(); |
@@ -317,2 +350,5 @@ void InstallDlgImpl :: installSelected() | |||
317 | btnInstall->setIconSet( Resource::loadPixmap( "enter" ) ); | 350 | btnInstall->setIconSet( Resource::loadPixmap( "enter" ) ); |
351 | |||
352 | btnOptions->setText( tr( "Save output" ) ); | ||
353 | btnOptions->setIconSet( Resource::loadPixmap( "save" ) ); | ||
318 | 354 | ||