author | drw <drw> | 2003-04-17 20:19:52 (UTC) |
---|---|---|
committer | drw <drw> | 2003-04-17 20:19:52 (UTC) |
commit | fabadbc7caba39006fcdda5167c29fa287e23cc3 (patch) (side-by-side diff) | |
tree | bcd0fe44cd443001514ff4f9e50af5e9da093fcc /noncore/settings/aqpkg/installdlgimpl.cpp | |
parent | 187e3c56ab0bb2f562c9d6347a99edb440c18d6c (diff) | |
download | opie-fabadbc7caba39006fcdda5167c29fa287e23cc3.zip opie-fabadbc7caba39006fcdda5167c29fa287e23cc3.tar.gz opie-fabadbc7caba39006fcdda5167c29fa287e23cc3.tar.bz2 |
Added better verbosity options and option to save ipkg output to a file (per 'bugs' #856 & #857). Also fixed Ok/Cancel behavior on install options dialog.
Diffstat (limited to 'noncore/settings/aqpkg/installdlgimpl.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/installdlgimpl.cpp | 48 |
1 files changed, 42 insertions, 6 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,6 +18,9 @@ #include <stdio.h> +#include <opie/ofiledialog.h> + #ifdef QWS #include <qpe/config.h> +#include <qpe/fileselector.h> #include <qpe/qpeapplication.h> #include <qpe/resource.h> @@ -28,4 +31,5 @@ #include <qcombobox.h> #include <qdialog.h> +#include <qfileinfo.h> #include <qgroupbox.h> #include <qmultilineedit.h> @@ -64,4 +68,5 @@ InstallDlgImpl::InstallDlgImpl( QList<InstallData> &packageList, DataManager *da // Grab flags - Turn MAKE_LINKS on by default (if no flags found) flags = cfg.readNumEntry( "installFlags", 0 ); + infoLevel = cfg.readNumEntry( "infoLevel", 1 ); #else flags = 0; @@ -191,9 +196,12 @@ void InstallDlgImpl :: init( bool displayextrainfo ) void InstallDlgImpl :: optionsSelected() { - InstallOptionsDlgImpl opt( flags, this, "Option", true ); - opt.exec(); - + 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 @@ -201,6 +209,31 @@ void InstallDlgImpl :: optionsSelected() 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() ); + } + } +} void InstallDlgImpl :: installSelected() @@ -273,5 +306,5 @@ void InstallDlgImpl :: installSelected() tmpFlags |= MAKE_LINKS; - pIpkg->setFlags( tmpFlags ); + pIpkg->setFlags( tmpFlags, infoLevel ); pIpkg->runIpkg(); } @@ -280,5 +313,5 @@ void InstallDlgImpl :: installSelected() pIpkg->setDestination( dest ); pIpkg->setDestinationDir( destDir ); - pIpkg->setFlags( instFlags ); + pIpkg->setFlags( instFlags, infoLevel ); QListIterator<InstallData> it2( installList ); for ( ; it2.current(); ++it2 ) @@ -304,5 +337,5 @@ void InstallDlgImpl :: installSelected() if ( idata->destination->linkToRoot() && idata->recreateLinks ) tmpFlags |= MAKE_LINKS; - pIpkg->setFlags( tmpFlags ); + pIpkg->setFlags( tmpFlags, infoLevel ); pIpkg->runIpkg(); } @@ -317,4 +350,7 @@ void InstallDlgImpl :: installSelected() btnInstall->setIconSet( Resource::loadPixmap( "enter" ) ); + btnOptions->setText( tr( "Save output" ) ); + btnOptions->setIconSet( Resource::loadPixmap( "save" ) ); + if ( destination && destination->currentText() != 0 && destination->currentText() != "" ) displayAvailableSpace( destination->currentText() ); |