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 @@ #include <stdio.h> + +#include <opie/ofiledialog.h> @@ -21,2 +23,3 @@ #include <qpe/config.h> +#include <qpe/fileselector.h> #include <qpe/qpeapplication.h> @@ -29,2 +32,3 @@ #include <qdialog.h> +#include <qfileinfo.h> #include <qgroupbox.h> @@ -65,2 +69,3 @@ InstallDlgImpl::InstallDlgImpl( QList<InstallData> &packageList, DataManager *da flags = cfg.readNumEntry( "installFlags", 0 ); + infoLevel = cfg.readNumEntry( "infoLevel", 1 ); #else @@ -192,13 +197,41 @@ void InstallDlgImpl :: optionsSelected() { - InstallOptionsDlgImpl opt( flags, this, "Option", true ); - opt.exec(); - - // set options selected from dialog - flags = opt.getFlags(); + if ( btnOptions->text() == tr( "Options" ) ) + { + InstallOptionsDlgImpl opt( flags, infoLevel, this, "Option", true ); + if ( opt.exec() == QDialog::Accepted ) + { + // set options selected from dialog + flags = opt.getFlags(); + infoLevel = opt.getInfoLevel(); #ifdef QWS - Config cfg( "aqpkg" ); - cfg.setGroup( "settings" ); - cfg.writeEntry( "installFlags", flags ); + Config cfg( "aqpkg" ); + cfg.setGroup( "settings" ); + cfg.writeEntry( "installFlags", flags ); + cfg.writeEntry( "infoLevel", infoLevel ); #endif + } + } + else // Save output + { + QMap<QString, QStringList> map; + map.insert( tr( "All" ), QStringList() ); + QStringList text; + text << "text/*"; + map.insert(tr( "Text" ), text ); + text << "*"; + map.insert( tr( "All" ), text ); + + QString filename = OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map ); + if( !filename.isEmpty() ) + { + QString currentFileName = QFileInfo( filename ).fileName(); + DocLnk doc; + doc.setType( "text/plain" ); + doc.setFile( filename ); + doc.setName( currentFileName ); + FileManager fm; + fm.saveFile( doc, output->text() ); + } + } } @@ -274,3 +307,3 @@ void InstallDlgImpl :: installSelected() - pIpkg->setFlags( tmpFlags ); + pIpkg->setFlags( tmpFlags, infoLevel ); pIpkg->runIpkg(); @@ -281,3 +314,3 @@ void InstallDlgImpl :: installSelected() pIpkg->setDestinationDir( destDir ); - pIpkg->setFlags( instFlags ); + pIpkg->setFlags( instFlags, infoLevel ); QListIterator<InstallData> it2( installList ); @@ -305,3 +338,3 @@ void InstallDlgImpl :: installSelected() tmpFlags |= MAKE_LINKS; - pIpkg->setFlags( tmpFlags ); + pIpkg->setFlags( tmpFlags, infoLevel ); pIpkg->runIpkg(); @@ -317,2 +350,5 @@ void InstallDlgImpl :: installSelected() btnInstall->setIconSet( Resource::loadPixmap( "enter" ) ); + + btnOptions->setText( tr( "Save output" ) ); + btnOptions->setIconSet( Resource::loadPixmap( "save" ) ); |