summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/mainwindow.cpp
authortille <tille>2002-04-27 14:35:48 (UTC)
committer tille <tille>2002-04-27 14:35:48 (UTC)
commit320532727fc7dfbe9760d0eea0e17b8e1230fc8e (patch) (unidiff)
treed65575cdd4c89e6a531b178de04198f39d8276c0 /noncore/unsupported/oipkg/mainwindow.cpp
parentdb90999f6298c1107888f062f2c25cb8817b528a (diff)
downloadopie-320532727fc7dfbe9760d0eea0e17b8e1230fc8e.zip
opie-320532727fc7dfbe9760d0eea0e17b8e1230fc8e.tar.gz
opie-320532727fc7dfbe9760d0eea0e17b8e1230fc8e.tar.bz2
added setDocument and a qcop call to install a file
Diffstat (limited to 'noncore/unsupported/oipkg/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp18
1 files changed, 18 insertions, 0 deletions
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
@@ -24,24 +24,28 @@
24#include "pksettingsbase.h" 24#include "pksettingsbase.h"
25#include "packagelistitem.h" 25#include "packagelistitem.h"
26 26
27MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : 27MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
28 QMainWindow( parent, name, f ) 28 QMainWindow( parent, name, f )
29 { 29 {
30 setCaption( tr("Package Manager") ); 30 setCaption( tr("Package Manager") );
31 31
32 listViewPackages = new QListView( this,0,0 ); 32 listViewPackages = new QListView( this,0,0 );
33 listViewPackages->setSelectionMode(QListView::NoSelection); 33 listViewPackages->setSelectionMode(QListView::NoSelection);
34 setCentralWidget( listViewPackages ); 34 setCentralWidget( listViewPackages );
35 35
36 channel = new QCopChannel( "QPE/Application/oipkg", this );
37 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
38 this, SLOT(receive(const QCString&, const QByteArray&)) );
39
36 makeMenu(); 40 makeMenu();
37#ifdef NEWLAYOUT 41#ifdef NEWLAYOUT
38 listViewPackages->addColumn( tr("Package") ); 42 listViewPackages->addColumn( tr("Package") );
39 listViewPackages->setRootIsDecorated( true ); 43 listViewPackages->setRootIsDecorated( true );
40#endif 44#endif
41#ifndef NEWLAYOUT 45#ifndef NEWLAYOUT
42 QFontMetrics fm = fontMetrics(); 46 QFontMetrics fm = fontMetrics();
43 int wlw = width()*2; 47 int wlw = width()*2;
44 int w0 = fm.width(tr("Package"))+30; 48 int w0 = fm.width(tr("Package"))+30;
45 // int w0 = fm.width(tr("Package"))+30; 49 // int w0 = fm.width(tr("Package"))+30;
46 int w2 = fm.width("00000")+4; 50 int w2 = fm.width("00000")+4;
47 int w1 = wlw-w2-w0-24; 51 int w1 = wlw-w2-w0-24;
@@ -407,12 +411,26 @@ void MainWindow::changePackageDest( int i )
407{ 411{
408 activePackage->setDest( destsMenu->text(i) ); 412 activePackage->setDest( destsMenu->text(i) );
409 activePackage->setOn(); 413 activePackage->setOn();
410 activePackage->setLink( settings->createLinks() ); 414 activePackage->setLink( settings->createLinks() );
411 activePackageListItem->displayDetails(); 415 activePackageListItem->displayDetails();
412} 416}
413 417
414void MainWindow::stopTimer( QListViewItem* ) 418void MainWindow::stopTimer( QListViewItem* )
415{ 419{
416 pvDebug( 5, "stop timer" ); 420 pvDebug( 5, "stop timer" );
417 popupTimer->stop(); 421 popupTimer->stop();
418} 422}
423
424void MainWindow::setDocument(const QString &fileName)
425{
426 ipkg->installFile( fileName );
427}
428
429void MainWindow::receive(const QCString &msg, const QByteArray &arg)
430{
431 pvDebug(3, "QCop "+msg);
432 if ( msg == "setDocument(QString)" )
433 {
434 setDocument( QString(arg) );
435 }
436} \ No newline at end of file