author | tille <tille> | 2002-05-03 09:40:11 (UTC) |
---|---|---|
committer | tille <tille> | 2002-05-03 09:40:11 (UTC) |
commit | 6bf450ac622d22ba7e9156e474a7abb714167eba (patch) (side-by-side diff) | |
tree | ff89dd745715e0b540e6c8f17b6af4dec4c3c84a /noncore/unsupported/oipkg/pmipkg.cpp | |
parent | 6ebb8228b660634b4ca8a2a5bf05aef828e39f31 (diff) | |
download | opie-6bf450ac622d22ba7e9156e474a7abb714167eba.zip opie-6bf450ac622d22ba7e9156e474a7abb714167eba.tar.gz opie-6bf450ac622d22ba7e9156e474a7abb714167eba.tar.bz2 |
added install dialog with ipkg options (that are shown ;)
Diffstat (limited to 'noncore/unsupported/oipkg/pmipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 96 |
1 files changed, 32 insertions, 64 deletions
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index be9d6da..fd8279b 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp @@ -54,19 +54,19 @@ int PmIpkg::runIpkg(const QString& args, const QString& dest ) cmd += " -dest "+settings->getDestinationName(); else cmd += " -dest "+ dest; cmd += " -force-defaults "; - if (_force_depends) + if (installDialog->_force_depends) { - if (_force_depends->isChecked()) + if (installDialog->_force_depends->isChecked()) cmd += " -force-depends "; - if (_force_reinstall->isChecked()) + if (installDialog->_force_reinstall->isChecked()) cmd += " -force-reinstall "; - if (_force_remove->isChecked()) + if (installDialog->_force_remove->isChecked()) cmd += " -force-removal-of-essential-packages "; } out( "<hr><br>Starting to "+ args+"<br>\n"); cmd += args; int r = 0; @@ -170,26 +170,23 @@ void PmIpkg::processLinkDir( QString file, QString dest ) if ( fileInfo.isDir() ) { pvDebug(4, "process dir "+file); QDir destDir( destFile ); if (linkOpp==createLink) destDir.mkdir( destFile, true ); QDir d( file ); - d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); +// d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); const QFileInfoList *list = d.entryInfoList(); QFileInfoListIterator it( *list ); QFileInfo *fi; + qDebug( "while %i",list->count()); while ( (fi=it.current()) ) { + pvDebug(4, "processLinkDir "+fi->absFilePath()); processLinkDir( fi->absFilePath(), dest ); ++it; } -// if (linkOpp==removeLink) -// { -// pvDebug(2,"remove destDir "+ destFile ); -// destDir.remove( destFile, true ); -// } } else if ( fileInfo.isFile() ) { const char *instFile = strdup( (file).ascii() ); const char *linkFile = strdup( (destFile).ascii()); if( linkOpp==createLink ) @@ -198,16 +195,18 @@ void PmIpkg::processLinkDir( QString file, QString dest ) symlink( instFile, linkFile ); } } else { const char *linkFile = strdup( (destFile).ascii()); if( linkOpp==removeLink ) { - pvDebug(4,"removing "+destFile+" no "+file); QFileInfo toRemoveLink( destFile ); if ( !QFile::exists( file ) && toRemoveLink.isSymLink() ) + { + pvDebug(4,"removing "+destFile+" no "+file); unlink( linkFile ); + } } } } void PmIpkg::loadList( PackageList pl ) { @@ -220,79 +219,45 @@ void PmIpkg::loadList( PackageList pl ) if ( pack->toRemove() ) to_remove.append( pack ); } } } -void PmIpkg::commit( PackageList pl ) +void PmIpkg::commit() { int sizecount = 0; -// QString rem="<b>"+tr("To remove:")+"</b><br>\n"; -// QString inst="<b>"+tr("To install:")+"</b><br>\n"; - loadList(pl); for (uint i=0; i < to_remove.count(); i++) sizecount += 1; for (uint i=0; i < to_install.count(); i++) sizecount += to_install.at(i)->size().toInt(); runwindow->progress->setTotalSteps(sizecount); startDialog(); } void PmIpkg::startDialog() { - installDialog = new QDialog(0,0,true); - QGridLayout *RunWindowLayout = new QGridLayout( installDialog ); - RunWindowLayout->setSpacing( 2 ); - RunWindowLayout->setMargin( 2 ); - - PackageListView *plv = new PackageListView(installDialog, "install",settings); - plv->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding, plv->sizePolicy().mayShrinkVertically()) ); - RunWindowLayout->addWidget( plv, 1, 0 ); - QCheckListItem *toRemoveItem; - toRemoveItem= new QCheckListItem( plv, QObject::tr("To remove") ); - toRemoveItem->setOpen( true ); - for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) - { - toRemoveItem->insertItem( new PackageListItem(plv, it,settings) ); - } - QCheckListItem *toInstallItem; - toInstallItem = new QCheckListItem( plv, QObject::tr("To install") ); - toInstallItem->setOpen( true ); - for (Package *it=to_install.first(); it != 0; it=to_install.next() ) - { - toInstallItem->insertItem( new PackageListItem(plv, it,settings) ); - } - - QGroupBox *GroupBox1 = new QGroupBox( installDialog, "Ipkg" ); - GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, GroupBox1->sizePolicy().mayShrinkVertically() ) ); - GroupBox1->setTitle( tr( "Ipkg options" ) ); - GroupBox1->setColumnLayout(0, Qt::Vertical ); - GroupBox1->layout()->setSpacing( 0 ); - GroupBox1->layout()->setMargin( 0 ); - QGridLayout *GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); - GroupBox1Layout->setAlignment( Qt::AlignTop ); - GroupBox1Layout->setSpacing( 3 ); - GroupBox1Layout->setMargin( 3 ); - _force_depends = new QCheckBox( GroupBox1, "_force_depends" ); - _force_depends->setText( tr( "-force-depends" ) ); - _force_depends->setAutoResize( TRUE ); - _force_depends->setChecked(true); - GroupBox1Layout->addWidget( _force_depends, 0, 0 ); - _force_reinstall = new QCheckBox( GroupBox1, "_force_reinstall" ); - _force_reinstall->setText( tr( "-force-reinstall" ) ); - _force_reinstall->setAutoResize( TRUE ); - GroupBox1Layout->addWidget( _force_reinstall, 1, 0 ); - _force_remove = new QCheckBox( GroupBox1, "_force_remove" ); - _force_remove->setText( tr( "-force-removal-of-essential-packages" ) ); - _force_remove->setAutoResize( TRUE ); - GroupBox1Layout->addWidget( _force_remove, 1, 0 ); - RunWindowLayout->addWidget( GroupBox1 , 3, 0 ); + installDialog = new InstallDialog(settings,0,0,true); + QCheckListItem *toRemoveItem; + toRemoveItem= new QCheckListItem( installDialog->ListViewPackages, QObject::tr("To remove") ); + toRemoveItem->setOpen( true ); + for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) + { + toRemoveItem->insertItem( new PackageListItem(installDialog->ListViewPackages, it,settings) ); + } + QCheckListItem *toInstallItem; + toInstallItem = new QCheckListItem( installDialog->ListViewPackages, QObject::tr("To install") ); + toInstallItem->setOpen( true ); + for (Package *it=to_install.first(); it != 0; it=to_install.next() ) + { + toInstallItem->insertItem( new PackageListItem(installDialog->ListViewPackages, it,settings) ); + } installDialog->showMaximized(); if ( installDialog->exec() ) doIt(); installDialog->close(); out(tr("<b>All done.</b>")); + to_install.clear(); } void PmIpkg::doIt() { show( true ); remove(); @@ -354,30 +319,33 @@ void PmIpkg::install() out("<br><hr>"); }else{ out("<b>"+tr("Error while installing")+"</b><hr>"+it->name()); } } out("<br>"); + to_install.clear(); } void PmIpkg::createLinks( const QString &dest ) { pvDebug(2,"PmIpkg::createLinks "+dest); linkOpp=createLink; QString url = settings->getDestinationUrlByName( dest ); url = url==""?dest:url; - processLinkDir( "/", url ); + processLinkDir( "/opt", url ); + processLinkDir( "/usr", url ); } void PmIpkg::removeLinks( const QString &dest ) { pvDebug(2,"PmIpkg::removeLinks "+dest); linkOpp=removeLink; QString url = settings->getDestinationUrlByName( dest ); url = url==""?dest:url; - processLinkDir( "/", url ); + processLinkDir( "/opt", url ); + processLinkDir( "/usr", url ); } void PmIpkg::update() { show( false ); runIpkg( "update" ); |