-rw-r--r-- | noncore/unsupported/oipkg/main.cpp | 7 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 51 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.h | 6 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/oipkg.pro | 2 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/package.cpp | 6 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/package.h | 1 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistdoclnk.cpp | 36 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistdoclnk.h | 22 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistitem.cpp | 8 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistitem.h | 1 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistremote.cpp | 14 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistremote.h | 2 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistview.cpp | 3 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 21 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.h | 4 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/settings.h | 9 |
16 files changed, 128 insertions, 65 deletions
diff --git a/noncore/unsupported/oipkg/main.cpp b/noncore/unsupported/oipkg/main.cpp index 5cef2dc..bacc973 100644 --- a/noncore/unsupported/oipkg/main.cpp +++ b/noncore/unsupported/oipkg/main.cpp @@ -2,21 +2,22 @@ #include "mainwindow.h" #include <qpe/qpeapplication.h> #include <qstring.h> #include <qmessagebox.h> int debugLevel; int main( int argc, char ** argv ) { debugLevel = 2; if (argc > 0) - { + { debugLevel = QString ( argv[1] ).toInt(); - } + } QPEApplication a( argc, argv ); MainWindow mw; - QMessageBox::information( &mw, "oipkg","While ipkg is working\noipkg is hanging.\nPlease be patient!"); + if (debugLevel < 4) + QMessageBox::information( &mw, "oipkg","While ipkg is working\noipkg is hanging.\nPlease be patient!"); a.showMainDocumentWidget( &mw ); return a.exec(); } diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 0422d65..b668660 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp @@ -29,34 +29,37 @@ #include "pksettingsbase.h" #include "utils.h" #include "packagelistitem.h" MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : QMainWindow( parent, name, f ) { setCaption( tr("Package Manager") ); settings = new PackageManagerSettings(this,0,TRUE); listViewPackages = new PackageListView( this,"listViewPackages",settings ); setCentralWidget( listViewPackages ); - listViewPackages->addList( tr("local"), &packageList ); + listViewPackages->addList( tr("feeds"), &packageListServers ); listViewPackages->addList( tr("ipkgfind"), &packageListSearch ); + listViewPackages->addList( tr("documents"), &packageListDocLnk ); // wait = new QMessageBox(tr("oipkg"),tr("Please wait")//,QMessageBox::Information,QMessageBox::NoButton,QMessageBox::NoButton,QMessageBox::NoButton); // wait = new QMessageBox(this); // wait->setText(tr("Please wait")); ipkg = new PmIpkg( settings, this ); // settings->setIpkg( ipkg ); - packageList.setSettings( settings ); + packageListServers.setSettings( settings ); packageListSearch.setSettings( settings ); - packageList.update(); + packageListDocLnk.setSettings( settings ); + packageListServers.update(); + packageListDocLnk.update(); makeMenu(); makeChannel(); //opie is hardcoded default ;) for (int i=0;i<section->count();i++) if (section->text(i)=="opie") section->setCurrentItem(i); sectionChanged(); connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); connect( settings->removeLinksButton, SIGNAL( clicked()), @@ -235,123 +238,109 @@ MainWindow::~MainWindow() { Config cfg( "oipkg", Config::User ); cfg.setGroup( "gui" ); cfg.writeEntry( "findBar", !findBar->isHidden() ); cfg.writeEntry( "searchBar", !searchBar->isHidden() ); cfg.writeEntry( "sectionBar", !sectionBar->isHidden() ); cfg.writeEntry( "destBar", !destBar->isHidden() ); } void MainWindow::runIpkg() { - packageList.allPackages(); + packageListServers.allPackages(); ipkg->loadList( packageListSearch ); - ipkg->commit( packageList ); + ipkg->loadList( packageListDocLnk ); + ipkg->commit( packageListServers ); // ##### If we looked in the list of files, we could send out accurate // ##### messages. But we don't bother yet, and just do an "all". QCopEnvelope e("QPE/System", "linkChanged(QString)"); QString lf = QString::null; e << lf; displayList(); } void MainWindow::updateList() { // wait->show(); QTimer *t = new QTimer( this ); connect( t, SIGNAL(timeout()), SLOT( rotateUpdateIcon() ) ); t->start( 0, false ); - packageList.clear(); + packageListServers.clear(); + packageListSearch.clear(); + packageListDocLnk.clear(); ipkg->update(); - packageList.update(); + packageListServers.update(); + packageListSearch.update(); + packageListDocLnk.update(); t->stop(); // wait->hide(); } void MainWindow::filterList() { // wait->show(); QString f = ""; if ( findAction->isOn() ) f = findEdit->text(); - packageList.filterPackages( f ); + packageListServers.filterPackages( f ); // wait->hide(); } void MainWindow::displayList() { // wait->hide(); filterList(); listViewPackages->display(); -//// if (!rootLocal) -//// { -// QCheckListItem *rootLocal = new QCheckListItem(listViewPackages,tr("local")); -// QCheckListItem *rootSearch = new QCheckListItem(listViewPackages,tr("ipkgfind")); -//// } -// listViewPackages->clear(); -// Package *pack = packageList.first(); -// PackageListItem *item; -// while( pack ) -// { -// item = new PackageListItem( rootLocal, pack, settings ); -// pack = packageList.next(); -// } -// pack = packageListSearch.first(); -// while( pack ) -// { -// item = new PackageListItem( rootSearch, pack, settings ); -// pack = packageListSearch.next(); -// } } void MainWindow::sectionChanged() { disconnect( section, SIGNAL( activated(int) ), this, SLOT( sectionChanged() ) ); disconnect( subsection, SIGNAL(activated(int) ), this, SLOT( subSectionChanged() ) ); subsection->clear(); - packageList.setSection( section->currentText() ); + packageListServers.setSection( section->currentText() ); setSubSections(); connect( section, SIGNAL( activated(int) ), this, SLOT( sectionChanged() ) ); connect( subsection, SIGNAL(activated(int) ), this, SLOT( subSectionChanged() ) ); displayList(); } void MainWindow::subSectionChanged() { disconnect( section, SIGNAL( activated(int) ), this, SLOT( sectionChanged() ) ); disconnect( subsection, SIGNAL(activated(int) ), this, SLOT( subSectionChanged() ) ); - packageList.setSubSection( subsection->currentText() ); + packageListServers.setSubSection( subsection->currentText() ); connect( section, SIGNAL( activated(int) ), this, SLOT( sectionChanged() ) ); connect( subsection, SIGNAL(activated(int) ), this, SLOT( subSectionChanged() ) ); displayList(); } void MainWindow::setSections() { section->clear(); - section->insertStringList( packageList.getSections() ); + section->insertStringList( packageListServers.getSections() ); } void MainWindow::setSubSections() { subsection->clear(); - subsection->insertStringList( packageList.getSubSections() ); + subsection->insertStringList( packageListServers.getSubSections() ); } void MainWindow::showSettings() { if ( settings->showDialog( 0 ) ) updateList(); } void MainWindow::showSettingsSrv() { if ( settings->showDialog( 1 ) ) updateList(); diff --git a/noncore/unsupported/oipkg/mainwindow.h b/noncore/unsupported/oipkg/mainwindow.h index 4a73b78..f6023b0 100644 --- a/noncore/unsupported/oipkg/mainwindow.h +++ b/noncore/unsupported/oipkg/mainwindow.h @@ -1,23 +1,24 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <qmainwindow.h> #include <qaction.h> #include <qtimer.h> #include <qpopupmenu.h> #include "packagelist.h" #include "packagelistremote.h" #include "packagelistlocal.h" +#include "packagelistdoclnk.h" #include "pmipkg.h" #include "pksettings.h" #include "packagelistview.h" class QComboBox; class QPEToolBar; class QLineEdit; class PackageListItem; class QCopChannel; class QMessageBox; class QCheckBox; @@ -59,29 +60,28 @@ public slots: void setDocument (const QString &); void remotePackageQuery(); private: void makeMenu(); void setSections(); void setSubSections(); void installFile(const QString &); bool updateIcon; PmIpkg* ipkg; PackageManagerSettings *settings; - PackageListLocal packageList; + PackageListLocal packageListServers; PackageListRemote packageListSearch; + PackageListDocLnk packageListDocLnk; PackageListView *listViewPackages; -// QCheckListItem* rootSearch; -// QCheckListItem* rootLocal; QAction *runAction; QAction *updateAction; QAction *findAction; QPEToolBar *findBar; QLineEdit *findEdit; QAction *searchAction; QAction *searchCommit; QPEToolBar *searchBar; QLineEdit *searchEdit; QAction *sectionAction; QPEToolBar *sectionBar; QComboBox *section; diff --git a/noncore/unsupported/oipkg/oipkg.pro b/noncore/unsupported/oipkg/oipkg.pro index 98f92c8..6ee1963 100644 --- a/noncore/unsupported/oipkg/oipkg.pro +++ b/noncore/unsupported/oipkg/oipkg.pro @@ -1,29 +1,31 @@ DESTDIR = $(OPIEDIR)/bin TEMPLATE = app #CONFIG = qt warn_on release CONFIG = qt warn_on debug HEADERS = mainwindow.h \ pksettings.h \ pmipkg.h \ + packagelistdoclnk.h \ utils.h \ packagelistitem.h \ packagelistremote.h \ packagelist.h \ packagelistlocal.h \ packagelistview.h \ package.h SOURCES = main.cpp \ mainwindow.cpp \ utils.cpp \ + packagelistdoclnk.cpp \ packagelistview.cpp \ packagelistremote.cpp \ packagelistlocal.cpp \ pksettings.cpp \ pmipkg.cpp \ packagelistitem.cpp \ packagelist.cpp \ package.cpp INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/ioclude LIBS += -lqpe INTERFACES = runwindow.ui \ diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index f992641..9280d89 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp @@ -39,25 +39,24 @@ Package::Package( QStringList pack, PackageManagerSettings *s ) init(s); parsePackage( pack ); } Package::Package( QString n, PackageManagerSettings *s ) { init(s); if ( !QFile::exists( n ) ) { _name = QString( n ); }else{ parseIpkgFile( n ); - _toProcess = true; _useFileName = true; _fileName = QString( n ); } } Package::Package( Package *pi ) { init(pi->settings); copyValues( pi ); } @@ -357,12 +356,17 @@ void Package::instalFromFile(bool iff) _useFileName = iff; } void Package::setName(QString n) { _displayName = n; } QDict<QString>* Package::getFields() { return &_values; } + +QString Package::status() +{ + return _status; +} diff --git a/noncore/unsupported/oipkg/package.h b/noncore/unsupported/oipkg/package.h index fc725bc..257d9c7 100644 --- a/noncore/unsupported/oipkg/package.h +++ b/noncore/unsupported/oipkg/package.h @@ -41,24 +41,25 @@ class Package //: public QObject bool toInstall(); bool toRemove(); void processed(); QString dest(); void setDest( QString d ); void setOn(); bool link(); void setLink(bool); void parseIpkgFile( QString ); void instalFromFile(bool iff=true); void setName(QString); QDict<QString>* getFields(); + QString status(); public slots: void toggleProcess(); private: PackageManagerSettings *settings; QString _displayName; QString _name; QString _fileName; bool _toProcess; bool _link; QString _status; QString _size; diff --git a/noncore/unsupported/oipkg/packagelistdoclnk.cpp b/noncore/unsupported/oipkg/packagelistdoclnk.cpp new file mode 100644 index 0000000..575ac62 --- a/dev/null +++ b/noncore/unsupported/oipkg/packagelistdoclnk.cpp @@ -0,0 +1,36 @@ + +#include "packagelistdoclnk.h" + +#include <qpe/applnk.h> +#include <qlist.h> + +#include "package.h" +#include "pksettings.h" + +PackageListDocLnk::PackageListDocLnk(PackageManagerSettings* s) + : PackageList(s) +{ + PackageListDocLnk(); +} + +PackageListDocLnk::PackageListDocLnk() + : PackageList() +{ + doclnkset = new DocLnkSet("/mnt/nfs/ipk","application/ipkg"); +} + +PackageListDocLnk::~PackageListDocLnk() +{ +} + + + +void PackageListDocLnk::update() +{ + pvDebug(2,"PackageListDocLnk::update "); + QList<DocLnk> packlist = doclnkset->children(); + for (DocLnk *pack =packlist.first(); pack != 0; pack=packlist.next() ) + { + insertPackage( new Package(pack->file(), settings) ); + } +} diff --git a/noncore/unsupported/oipkg/packagelistdoclnk.h b/noncore/unsupported/oipkg/packagelistdoclnk.h new file mode 100644 index 0000000..3864ace --- a/dev/null +++ b/noncore/unsupported/oipkg/packagelistdoclnk.h @@ -0,0 +1,22 @@ +#ifndef PACKAGELISTDOCLNK_H +#define PACKAGELISTDOCLNK_H + +#include "packagelist.h" +#include "debug.h" + +class DocLnkSet; + +class PackageListDocLnk : public PackageList +{ +public: + PackageListDocLnk(); + PackageListDocLnk( PackageManagerSettings* s); + virtual ~PackageListDocLnk(); +public slots: + void update(); +private: + DocLnkSet *doclnkset; +}; + + +#endif diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp index 2f81714..45aaf1d 100644 --- a/noncore/unsupported/oipkg/packagelistitem.cpp +++ b/noncore/unsupported/oipkg/packagelistitem.cpp @@ -23,24 +23,25 @@ PackageListItem::PackageListItem(QListViewItem *lvi, Package *pi, PackageManager } void PackageListItem::init( Package *pi, PackageManagerSettings *s) { package = pi; settings = s; setExpandable( true ); QCheckListItem *item; nameItem = new QCheckListItem( this, "" ); item = new QCheckListItem( this, QObject::tr("Size: ")+pi->size() ); destItem = new QCheckListItem( this, "" ); linkItem = new QCheckListItem( this, "" ); + statusItem = new QCheckListItem( this, "" ); QCheckListItem *otherItem = new QCheckListItem( this, QObject::tr("other") ); item = new QCheckListItem( otherItem, QObject::tr("Description: ")+pi->desc() ); QDict<QString> *fields = pi->getFields(); QDictIterator<QString> it( *fields ); while ( it.current() ) { item = new QCheckListItem( otherItem, QString(it.currentKey()+": "+*it.current()) ); ++it; } displayDetails(); if (!pm_uninstalled) { @@ -120,21 +121,24 @@ QString PackageListItem::key( int column, bool ascending ) const } void PackageListItem::setOn( bool b ) { QCheckListItem::setOn( b ); package->toggleProcess(); package->setLink( settings->createLinks() ); displayDetails(); } void PackageListItem::displayDetails() { - QString sod = " ("+package->sizeUnits(); + QString sod; + sod += package->sizeUnits().isEmpty()?QString(""):QString(package->sizeUnits()); + //sod += QString(package->dest().isEmpty()?"":QObject::tr(" on ")+package->dest()); sod += package->dest().isEmpty()?QString(""):QString(QObject::tr(" on ")+package->dest()); - sod += ")"; + sod = sod.isEmpty()?QString(""):QString(" ("+sod+")"); setText(0, package->name()+sod ); nameItem->setText( 0, QObject::tr("Name: ")+package->name()); linkItem->setText( 0, QObject::tr("Link: ")+QString(package->link()?QObject::tr("Yes"):QObject::tr("No")) ); destItem->setText( 0, QObject::tr("Destination: ")+package->dest() ); + statusItem->setText( 0, QObject::tr("Status: ")+package->status() ); repaint(); } diff --git a/noncore/unsupported/oipkg/packagelistitem.h b/noncore/unsupported/oipkg/packagelistitem.h index b128f0d..65e9711 100644 --- a/noncore/unsupported/oipkg/packagelistitem.h +++ b/noncore/unsupported/oipkg/packagelistitem.h @@ -23,18 +23,19 @@ public: QString key( int, bool ) const; Package* getPackage() { return package; } ; QString getName() { return package->name(); } ; bool isInstalled(){ return package->installed(); }; virtual void setOn ( bool ); void displayDetails(); private: void init(Package*, PackageManagerSettings*); QCheckListItem *nameItem; QCheckListItem *destItem; QCheckListItem *linkItem; + QCheckListItem *statusItem; PackageManagerSettings *settings; Package *package; }; #endif diff --git a/noncore/unsupported/oipkg/packagelistremote.cpp b/noncore/unsupported/oipkg/packagelistremote.cpp index 721d4a6..1ec7292 100644 --- a/noncore/unsupported/oipkg/packagelistremote.cpp +++ b/noncore/unsupported/oipkg/packagelistremote.cpp @@ -13,35 +13,35 @@ PackageListRemote::PackageListRemote(PackageManagerSettings* s) PackageListRemote::PackageListRemote() : PackageList() { } PackageListRemote::~PackageListRemote() { } void PackageListRemote::query(QString s) { + searchString = s; +} + +void PackageListRemote::update() +{ + pvDebug(2,"PackageListRemote::update"); int r=0; QString cmd = "wget"; QString redirect = "/tmp/oipkg.query"; // use file for output cmd += " --output-document="+redirect; //http://ipkgfind.handhelds.org/packages.phtml?format=pda&query=ipkg&searchtype=package§ion= QString server="http://ipkgfind.handhelds.org/"; cmd += " \""+server+"/packages.phtml"; cmd += "?format=pda&searchtype=package§ion="; - cmd += "&query="+s; + cmd += "&query="+searchString; cmd += "\""; pvDebug(2,"search :"+cmd); r = system(cmd.latin1()); readFileEntries( redirect ); - -} - -void PackageListRemote::update() -{ - pvDebug(2,"PackageListRemote::update\ndoing nothing "); } diff --git a/noncore/unsupported/oipkg/packagelistremote.h b/noncore/unsupported/oipkg/packagelistremote.h index 147da1e..87bf10d 100644 --- a/noncore/unsupported/oipkg/packagelistremote.h +++ b/noncore/unsupported/oipkg/packagelistremote.h @@ -5,15 +5,17 @@ #include "package.h" #include "pksettings.h" #include "debug.h" class PackageListRemote : public PackageList { public: PackageListRemote(); PackageListRemote( PackageManagerSettings* s); virtual ~PackageListRemote(); void query(QString); public slots: void update(); +private: + QString searchString; }; #endif diff --git a/noncore/unsupported/oipkg/packagelistview.cpp b/noncore/unsupported/oipkg/packagelistview.cpp index 5137c64..b6b520b 100644 --- a/noncore/unsupported/oipkg/packagelistview.cpp +++ b/noncore/unsupported/oipkg/packagelistview.cpp @@ -119,14 +119,15 @@ void PackageListView::display() while( pack ) { item = new PackageListItem( rootItem, pack, settings ); pack = packlist->next(); } ++list; } } void PackageListView::addList( QString n, PackageList* pl) { PackageLists.insert(n, pl); - rootItems.insert(n, new QCheckListItem(this,n)); + QCheckListItem *item = new QCheckListItem(this,n); + rootItems.insert(n, item); } diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index 2559a51..be9d6da 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp @@ -21,25 +21,24 @@ #include <qlayout.h> #include <stdlib.h> #include <unistd.h> #include "mainwindow.h" PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) : QObject ( p ) { settings = s; - runwindowopen = false; runwindow = new RunWindow( p, name, true, f ); } PmIpkg::~PmIpkg() { } //#define PROC #define SYSTEM int PmIpkg::runIpkg(const QString& args, const QString& dest ) { pvDebug(2,"PmIpkg::runIpkg "+args); @@ -64,25 +63,25 @@ int PmIpkg::runIpkg(const QString& args, const QString& dest ) cmd += " -force-depends "; if (_force_reinstall->isChecked()) cmd += " -force-reinstall "; if (_force_remove->isChecked()) cmd += " -force-removal-of-essential-packages "; } out( "<hr><br>Starting to "+ args+"<br>\n"); cmd += args; int r = 0; #ifdef PROC QString o = "start"; - Process *ipkg = new Process( "ls");//cmd ); + Process *ipkg = new Process( cmd ); out( "running:<br>\n"+ipkg->arguments().join(" ")+"<br>\n" ); QString description; ipkg->exec("",o); // out( o ); #endif #ifdef SYSTEM out( "running:<br>\n"+cmd+"<br>\n" ); QString redirect = "/tmp/oipkg.pipe"; cmd += " 2>&1 | tee "+redirect+" 2>&1"; pvDebug(2, "running >"+cmd+"<"); r = system(cmd.latin1()); QFile f( redirect ); @@ -151,44 +150,44 @@ void PmIpkg::processFileList( QStringList *fileList, QString d ) if (!fileList) return; for (uint i=0; i < fileList->count(); i++) { QString dest = settings->getDestinationUrlByName( d ); dest = dest==""?d:dest; processLinkDir( (*fileList)[i], dest ); } } void PmIpkg::processLinkDir( QString file, QString dest ) { - pvDebug( 7,"PmIpkg::processLinkDir "+file+" to "+ dest); - if (linkOpp==createLink) pvDebug( 2,"opp: createLink"); - if (linkOpp==removeLink) pvDebug( 2,"opp:removeLink"); + pvDebug( 4,"PmIpkg::processLinkDir "+file+" to "+ dest); + if (linkOpp==createLink) pvDebug( 4,"opp: createLink"); + if (linkOpp==removeLink) pvDebug( 4,"opp: removeLink"); if ( dest == "???" || dest == "" ) return; QString destFile = file; file = dest+"/"+file; if (file == dest) return; QFileInfo fileInfo( file ); 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 ); const QFileInfoList *list = d.entryInfoList(); QFileInfoListIterator it( *list ); QFileInfo *fi; while ( (fi=it.current()) ) { - pvDebug(4, "process dir "+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() ); @@ -217,32 +216,33 @@ void PmIpkg::loadList( PackageList pl ) if ( pack && (pack->name() != "") && pack) { if ( pack->toInstall() ) to_install.append( pack ); if ( pack->toRemove() ) to_remove.append( pack ); } } } void PmIpkg::commit( PackageList pl ) { - sizecount = 0; - QString rem="<b>"+tr("To remove:")+"</b><br>\n"; - QString inst="<b>"+tr("To install:")+"</b><br>\n"; + 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()) ); @@ -312,25 +312,25 @@ void PmIpkg::remove() if ( it->link() )fileList = getList( it->name(), it->dest() ); if ( runIpkg("remove " + it->name(), it->dest() ) == 0) { runwindow->progress->setProgress( 1 + runwindow->progress->progress() ); linkOpp = removeLink; if ( it->link() ) { out( "<br>removing links<br>" ); out( "for package "+it->name()+" in "+it->dest()+"<br>" ); processFileList( fileList, it->dest() ); } it->processed(); - +// to_install.take( it ); out("<br><hr>"); }else{ out("<b>"+tr("Error while removing")+"</b><hr>"+it->name()); } if ( it->link() )delete fileList; } out("<br>"); } void PmIpkg::install() { @@ -341,24 +341,25 @@ void PmIpkg::install() if ( runIpkg("install " + it->installName(), it->dest() ) == 0 ) { runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress()); linkOpp = createLink; if ( it->link() ) { out( "<br>creating links<br>" ); out( "for package "+it->name()+" in "+it->dest()+"<br>" ); makeLinks( it ); } it->processed(); +// to_install.take( it->name() ); out("<br><hr>"); }else{ out("<b>"+tr("Error while installing")+"</b><hr>"+it->name()); } } out("<br>"); } void PmIpkg::createLinks( const QString &dest ) { pvDebug(2,"PmIpkg::createLinks "+dest); linkOpp=createLink; diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h index fa00048..3799969 100644 --- a/noncore/unsupported/oipkg/pmipkg.h +++ b/noncore/unsupported/oipkg/pmipkg.h @@ -30,31 +30,31 @@ public: void show( bool buttons=true ); public slots: void doIt(); void install(); void remove(); void installFile(const QString &fileName, const QString &dest=""); void removeFile(const QString &fileName, const QString &dest=""); void createLinks( const QString &dest ); void removeLinks( const QString &dest ); private: - int sizecount; +// int sizecount; PackageManagerSettings* settings; RunWindow *runwindow; QDialog *installDialog; QList<Package> to_remove; QList<Package> to_install; - bool runwindowopen; +// bool runwindowopen; QString fileNameToInstall; QCheckBox *_force_reinstall; QCheckBox *_force_remove; QCheckBox *_force_depends; void startDialog(); void makeLinks(Package*); void linkPackage( QString, QString ); void processLinkDir( QString , QString ); int runIpkg(const QString& args, const QString& dest="" ); void out( QString ); QStringList* getList( QString, QString ); void processFileList( QStringList*, QString ); diff --git a/noncore/unsupported/oipkg/settings.h b/noncore/unsupported/oipkg/settings.h index 3be4334..bab7a4f 100644 --- a/noncore/unsupported/oipkg/settings.h +++ b/noncore/unsupported/oipkg/settings.h @@ -12,25 +12,27 @@ class PackageManagerSettings : public PackageManagerSettingsBase public: PackageManagerSettings( QWidget* , const char* , WFlags ); ~PackageManagerSettings(); bool showDialog( int ) ; QString getDestinationUrl(); QString getDestinationName(); QString getLinkDestinationName(); bool createLinks(); QStringList getActiveServers(); QStringList getDestinationUrls(); -public slots: +public slots: /** No descriptions */ + void createLinks(); + void removeLinks(); void writeInstallationSettings(); void readInstallationSettings(); void writeCurrentInstallationSetting(); void readInstallationSetting(int); void installationSettingSetName(const QString &); void activeDestinationChange(int) void newServer(); void editServer(int); void removeDestination(); void newDestination(); void editDestination(int); void linkEnabled(bool); @@ -52,16 +54,13 @@ private: int editeddestination; int currentSetting; int installationSettingsCount; bool changed; bool readIpkgConfig(const QString&); void writeIpkgConfig(const QString&); void writeSettings(); void readSettings(); }; #endif - /** No descriptions */ - void createLinks(); - /** No descriptions */ - void removeLinks(); + |