summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/TODO2
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp18
-rw-r--r--noncore/unsupported/oipkg/mainwindow.h5
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp40
-rw-r--r--noncore/unsupported/oipkg/pmipkg.h4
5 files changed, 65 insertions, 4 deletions
diff --git a/noncore/unsupported/oipkg/TODO b/noncore/unsupported/oipkg/TODO
index 744cba4..b07542a 100644
--- a/noncore/unsupported/oipkg/TODO
+++ b/noncore/unsupported/oipkg/TODO
@@ -1,8 +1,10 @@
+* setDocument function
* Settings Class
* tr() ;)
* Dialog to display ipkg output live
* parse "to install" and "to remove" from status
* install local file
* qcop
* error handling
* manage links
+* dependency checking \ No newline at end of file
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp
index 25ca889..e3abf36 100644
--- a/noncore/unsupported/oipkg/mainwindow.cpp
+++ b/noncore/unsupported/oipkg/mainwindow.cpp
@@ -30,12 +30,16 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
setCaption( tr("Package Manager") );
listViewPackages = new QListView( this,0,0 );
listViewPackages->setSelectionMode(QListView::NoSelection);
setCentralWidget( listViewPackages );
+ channel = new QCopChannel( "QPE/Application/oipkg", this );
+ connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
+ this, SLOT(receive(const QCString&, const QByteArray&)) );
+
makeMenu();
#ifdef NEWLAYOUT
listViewPackages->addColumn( tr("Package") );
listViewPackages->setRootIsDecorated( true );
#endif
#ifndef NEWLAYOUT
@@ -413,6 +417,20 @@ void MainWindow::changePackageDest( int i )
void MainWindow::stopTimer( QListViewItem* )
{
pvDebug( 5, "stop timer" );
popupTimer->stop();
}
+
+void MainWindow::setDocument(const QString &fileName)
+{
+ ipkg->installFile( fileName );
+}
+
+void MainWindow::receive(const QCString &msg, const QByteArray &arg)
+{
+ pvDebug(3, "QCop "+msg);
+ if ( msg == "setDocument(QString)" )
+ {
+ setDocument( QString(arg) );
+ }
+} \ No newline at end of file
diff --git a/noncore/unsupported/oipkg/mainwindow.h b/noncore/unsupported/oipkg/mainwindow.h
index adc5e78..34943f2 100644
--- a/noncore/unsupported/oipkg/mainwindow.h
+++ b/noncore/unsupported/oipkg/mainwindow.h
@@ -13,32 +13,36 @@
class QComboBox;
class QPEToolBar;
class QLineEdit;
class QListView;
class PackageListItem;
+class QCopChannel;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
~MainWindow();
+ QCopChannel *channel;
+
protected slots:
void runIpkg();
void getList();
void updateList();
void displayList();
void subSectionChanged();
void sectionChanged();
void showSettings();
void showSettingsSrv();
void showSettingsDst();
+ void setDocument (const QString &);
public slots:
void showDetails();
void toggleActivePackage();
void setCurrent( QListViewItem* );
void sectionClose();
@@ -46,12 +50,13 @@ public slots:
void findClose();
void findShow(bool);
void filterList();
void showPopup();
void changePackageDest( int );
void stopTimer( QListViewItem* );
+ void receive (const QCString &, const QByteArray &);
private:
void makeMenu();
void setSections();
void setSubSections();
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index 3b31b4d..45c89c5 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -108,16 +108,21 @@ void PmIpkg::makeLinks(Package *pack)
{
Config cfg( "oipkg", Config::User );
cfg.setGroup( "Common" );
QString statusDir = cfg.readEntry( "statusDir", "" );
}
QString fn = dest+"/"+statusDir+"/info/"+pack->name()+".list";
- QFile f( fn );
- if ( ! f.open(IO_ReadOnly) )
+ linkPackage( fn, dest );
+}
+
+void PmIpkg::linkPackage( QString packFileName, QString dest )
+{
+ QFile f( packFileName );
+ if ( ! f.open(IO_ReadOnly) )
{
- out( "<b>Panik!</b> Could not open:<br>"+fn );
+ out( "<b>Panik!</b> Could not open:<br>"+packFileName );
return;
};
QTextStream t( &f );
QString fp;
while ( !t.eof() )
{
@@ -204,13 +209,13 @@ void PmIpkg::commit( PackageList pl )
connect( runwindow->removeButton, SIGNAL( clicked() ),
this, SLOT( remove() ) );
connect( runwindow->cancelButton, SIGNAL( clicked() ),
runwindow, SLOT( close() ) );
runwindow->exec();
- return;
+ out("<h1>"+tr("Its now save to close this window")+"<h1>");
}
void PmIpkg::doIt()
{
remove();
install();
@@ -311,6 +316,33 @@ void PmIpkg::show(bool b)
showButtons(b);
if ( b )
runwindow->progress->hide();
else
runwindow->progress->show();
}
+
+void PmIpkg::installFile(const QString &fileName)
+{
+ pvDebug( 2,"PmIpkg::installFile "+ fileName);
+ show( false );
+ runwindow->outPut->setText("");
+ fileNameToInstall = fileName;
+ runwindow->doItButton->hide();
+ runwindow->removeButton->hide();
+ out("<b>"+tr("Install: ")+fileName);
+ connect( runwindow->installButton, SIGNAL( clicked() ),
+ this, SLOT( installFileName() ) );
+ connect( runwindow->cancelButton, SIGNAL( clicked() ),
+ runwindow, SLOT( close() ) );
+
+ runwindow->exec();
+}
+
+void PmIpkg::installFileName()
+{
+ if ( !QFile::exists( fileNameToInstall ) ) return;
+ out(tr("Installing pacakge ")+fileNameToInstall+"<br>"+tr("please wait")+"</b><br>");
+ runIpkg("install " + fileNameToInstall );
+ if ( settings->createLinks() )
+ linkPackage( fileNameToInstall, settings->getDestinationUrl() );
+ out("<h1>"+tr("Its now save to close this window")+"<h1>");
+} \ No newline at end of file
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h
index c57adb7..8e06f4c 100644
--- a/noncore/unsupported/oipkg/pmipkg.h
+++ b/noncore/unsupported/oipkg/pmipkg.h
@@ -28,20 +28,24 @@ public:
private:
PackageManagerSettings* settings;
RunWindow *runwindow;
QList<Package> to_remove;
QList<Package> to_install;
bool runwindowopen;
+ QString fileNameToInstall;
void makeLinks(Package*);
+ void linkPackage( QString, QString );
void processLinkDir( QString, QString );
int runIpkg(const QString& args, const QString& dest="" );
void out( QString );
public slots:
void doIt();
void install();
+ void installFileName();
void remove();
+ void installFile(const QString &fileName);
void linkDestination( const QString, const QByteArray );
};
#endif