author | drw <drw> | 2004-02-22 00:23:34 (UTC) |
---|---|---|
committer | drw <drw> | 2004-02-22 00:23:34 (UTC) |
commit | 91faf16c7336e54a6472fc9821903782918be539 (patch) (side-by-side diff) | |
tree | 1fe4a46860fab93000b8d633d7fd0c10013904d0 /noncore/settings/aqpkg/installdlgimpl.cpp | |
parent | e8aa81decb9a22828dcdbbaf3d08e2c6f1d2217f (diff) | |
download | opie-91faf16c7336e54a6472fc9821903782918be539.zip opie-91faf16c7336e54a6472fc9821903782918be539.tar.gz opie-91faf16c7336e54a6472fc9821903782918be539.tar.bz2 |
AQPkg: libopie->libopie2
Diffstat (limited to 'noncore/settings/aqpkg/installdlgimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/installdlgimpl.cpp | 254 |
1 files changed, 127 insertions, 127 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp index ea2c47f..d927a36 100644 --- a/noncore/settings/aqpkg/installdlgimpl.cpp +++ b/noncore/settings/aqpkg/installdlgimpl.cpp @@ -2,3 +2,3 @@ This file is part of the OPIE Project - + =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> @@ -31,4 +31,4 @@ -#include <opie/ofiledialog.h> - +#include <opie2/ofiledialog.h> + #ifdef QWS @@ -60,3 +60,3 @@ enum { - MAXLINES = 100, + MAXLINES = 100, }; @@ -68,3 +68,3 @@ InstallDlgImpl::InstallDlgImpl( const QList<InstallData> &packageList, DataManag init( TRUE ); - + pIpkg = 0; @@ -83,3 +83,3 @@ InstallDlgImpl::InstallDlgImpl( const QList<InstallData> &packageList, DataManag #else - flags = 0; + flags = 0; #endif @@ -88,5 +88,5 @@ InstallDlgImpl::InstallDlgImpl( const QList<InstallData> &packageList, DataManag output->setReadOnly( true ); -// QFont f( "helvetica" ); -// f.setPointSize( 10 ); -// output->setFont( f ); +// QFont f( "helvetica" ); +// f.setPointSize( 10 ); +// output->setFont( f ); @@ -106,40 +106,40 @@ InstallDlgImpl::InstallDlgImpl( const QList<InstallData> &packageList, DataManag - QListIterator<InstallData> it( packageList ); - // setup package data - QString remove = tr( "Remove\n" ); - QString install = tr( "Install\n" ); - QString upgrade = tr( "Upgrade\n" ); - for ( ; it.current(); ++it ) - { - InstallData *item = it.current(); - InstallData *newitem = new InstallData(); - - newitem->option = item->option; - newitem->packageName = item->packageName; - newitem->destination = item->destination; - newitem->recreateLinks = item->recreateLinks; - packages.append( newitem ); - - if ( item->option == "I" ) - { - install.append( QString( " %1\n" ).arg( item->packageName ) ); - } - else if ( item->option == "D" ) - { - remove.append( QString( " %1\n" ).arg( item->packageName ) ); - } - else if ( item->option == "U" || item->option == "R" ) - { - QString type; - if ( item->option == "R" ) - type = tr( "(ReInstall)" ); - else - type = tr( "(Upgrade)" ); - upgrade.append( QString( " %1 %2\n" ).arg( item->packageName ).arg( type ) ); - } - } - - output->setText( QString( "%1\n%2\n%3\n" ).arg( remove ).arg( install ).arg( upgrade ) ); - - displayAvailableSpace( destination->currentText() ); + QListIterator<InstallData> it( packageList ); + // setup package data + QString remove = tr( "Remove\n" ); + QString install = tr( "Install\n" ); + QString upgrade = tr( "Upgrade\n" ); + for ( ; it.current(); ++it ) + { + InstallData *item = it.current(); + InstallData *newitem = new InstallData(); + + newitem->option = item->option; + newitem->packageName = item->packageName; + newitem->destination = item->destination; + newitem->recreateLinks = item->recreateLinks; + packages.append( newitem ); + + if ( item->option == "I" ) + { + install.append( QString( " %1\n" ).arg( item->packageName ) ); + } + else if ( item->option == "D" ) + { + remove.append( QString( " %1\n" ).arg( item->packageName ) ); + } + else if ( item->option == "U" || item->option == "R" ) + { + QString type; + if ( item->option == "R" ) + type = tr( "(ReInstall)" ); + else + type = tr( "(Upgrade)" ); + upgrade.append( QString( " %1 %2\n" ).arg( item->packageName ).arg( type ) ); + } + } + + output->setText( QString( "%1\n%2\n%3\n" ).arg( remove ).arg( install ).arg( upgrade ) ); + + displayAvailableSpace( destination->currentText() ); } @@ -164,3 +164,3 @@ void InstallDlgImpl :: init( bool displayextrainfo ) { - QGridLayout *layout = new QGridLayout( this ); + QGridLayout *layout = new QGridLayout( this ); layout->setSpacing( 4 ); @@ -187,3 +187,3 @@ void InstallDlgImpl :: init( bool displayextrainfo ) } - + QGroupBox *GroupBox2 = new QGroupBox( 0, Qt::Vertical, tr( "Output" ), this ); @@ -200,3 +200,3 @@ void InstallDlgImpl :: init( bool displayextrainfo ) connect( btnInstall, SIGNAL( clicked() ), this, SLOT( installSelected() ) ); - + btnOptions = new QPushButton( Resource::loadPixmap( "SettingsIcon" ), tr( "Options" ), this ); @@ -234,4 +234,4 @@ void InstallDlgImpl :: optionsSelected() map.insert( tr( "All" ), text ); - - QString filename = OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map ); + + QString filename = Opie::OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map ); if( !filename.isEmpty() ) @@ -259,3 +259,3 @@ void InstallDlgImpl :: installSelected() } - + btnInstall->setText( tr( "Close" ) ); @@ -269,3 +269,3 @@ void InstallDlgImpl :: installSelected() } - + // Disable buttons @@ -293,3 +293,3 @@ void InstallDlgImpl :: installSelected() instFlags |= MAKE_LINKS; - + #ifdef QWS @@ -305,8 +305,8 @@ void InstallDlgImpl :: installSelected() - firstPackage = TRUE; - ipkgFinished(); + firstPackage = TRUE; + ipkgFinished(); // First run through the remove list, then the install list then the upgrade list -/* - pIpkg->setOption( "remove" ); +/* + pIpkg->setOption( "remove" ); QListIterator<InstallData> it( removeList ); @@ -323,3 +323,3 @@ void InstallDlgImpl :: installSelected() tmpFlags |= MAKE_LINKS; - + pIpkg->setFlags( tmpFlags, infoLevel ); @@ -402,3 +402,3 @@ void InstallDlgImpl :: displayAvailableSpace( const QString &text ) space = tr( "Unknown" ); - + if ( txtAvailableSpace ) @@ -409,68 +409,68 @@ void InstallDlgImpl :: ipkgFinished() { - InstallData *item; - if ( firstPackage ) - item = packages.first(); - else - { - // Create symlinks if necessary before moving on to next package - pIpkg->createSymLinks(); - - item = packages.next(); - } - - firstPackage = FALSE; - if ( item ) - { - pIpkg->setPackage( item->packageName ); - int tmpFlags = flags; - - if ( item->option == "I" ) - { - pIpkg->setOption( "install" ); - Destination *d = dataMgr->getDestination( destination->currentText() ); - pIpkg->setDestination( d->getDestinationName() ); - pIpkg->setDestinationDir( d->getDestinationPath() ); - - if ( d->linkToRoot() ) - tmpFlags |= MAKE_LINKS; - } - else if ( item->option == "D" ) - { - pIpkg->setOption( "remove" ); - pIpkg->setDestination( item->destination->getDestinationName() ); - pIpkg->setDestinationDir( item->destination->getDestinationPath() ); - - if ( item->destination->linkToRoot() ) - tmpFlags |= MAKE_LINKS; - } - else - { - if ( item->option == "R" ) - pIpkg->setOption( "reinstall" ); - else - pIpkg->setOption( "upgrade" ); - - pIpkg->setDestination( item->destination->getDestinationName() ); - pIpkg->setDestinationDir( item->destination->getDestinationPath() ); - pIpkg->setPackage( item->packageName ); - - tmpFlags |= FORCE_REINSTALL; - if ( item->destination->linkToRoot() && item->recreateLinks ) - tmpFlags |= MAKE_LINKS; - } - pIpkg->setFlags( tmpFlags, infoLevel ); - pIpkg->runIpkg(); - } - else - { - btnOptions->setEnabled( true ); - btnInstall->setText( tr( "Close" ) ); - 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() ); - } + InstallData *item; + if ( firstPackage ) + item = packages.first(); + else + { + // Create symlinks if necessary before moving on to next package + pIpkg->createSymLinks(); + + item = packages.next(); + } + + firstPackage = FALSE; + if ( item ) + { + pIpkg->setPackage( item->packageName ); + int tmpFlags = flags; + + if ( item->option == "I" ) + { + pIpkg->setOption( "install" ); + Destination *d = dataMgr->getDestination( destination->currentText() ); + pIpkg->setDestination( d->getDestinationName() ); + pIpkg->setDestinationDir( d->getDestinationPath() ); + + if ( d->linkToRoot() ) + tmpFlags |= MAKE_LINKS; + } + else if ( item->option == "D" ) + { + pIpkg->setOption( "remove" ); + pIpkg->setDestination( item->destination->getDestinationName() ); + pIpkg->setDestinationDir( item->destination->getDestinationPath() ); + + if ( item->destination->linkToRoot() ) + tmpFlags |= MAKE_LINKS; + } + else + { + if ( item->option == "R" ) + pIpkg->setOption( "reinstall" ); + else + pIpkg->setOption( "upgrade" ); + + pIpkg->setDestination( item->destination->getDestinationName() ); + pIpkg->setDestinationDir( item->destination->getDestinationPath() ); + pIpkg->setPackage( item->packageName ); + + tmpFlags |= FORCE_REINSTALL; + if ( item->destination->linkToRoot() && item->recreateLinks ) + tmpFlags |= MAKE_LINKS; + } + pIpkg->setFlags( tmpFlags, infoLevel ); + pIpkg->runIpkg(); + } + else + { + btnOptions->setEnabled( true ); + btnInstall->setText( tr( "Close" ) ); + 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() ); + } } |