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) (side-by-side diff)
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
@@ -12,48 +12,52 @@
#include <qmessagebox.h>
#include <qpopupmenu.h>
#include <qtoolbutton.h>
#include <qstring.h>
#include <qlabel.h>
#include <qlistview.h>
#include <qtextview.h>
#include <qlineedit.h>
#include <qtabwidget.h>
#include <qcombobox.h>
#include <qlayout.h>
#include "pksettingsbase.h"
#include "packagelistitem.h"
MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
QMainWindow( parent, name, f )
{
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
QFontMetrics fm = fontMetrics();
int wlw = width()*2;
int w0 = fm.width(tr("Package"))+30;
// int w0 = fm.width(tr("Package"))+30;
int w2 = fm.width("00000")+4;
int w1 = wlw-w2-w0-24;
listViewPackages->addColumn( tr("Package"), w0 );
listViewPackages->addColumn( tr("Description"), w1 );
listViewPackages->addColumn( tr("Size"), w2 );
listViewPackages->setColumnWidthMode(0,QListView::Manual);
listViewPackages->setColumnWidthMode(1,QListView::Manual);
listViewPackages->setColumnWidthMode(2,QListView::Manual);
listViewPackages->setSelectionMode( QListView::Multi );
#endif
connect( section, SIGNAL( activated(int) ),
this, SLOT( sectionChanged() ) );
connect( subsection, SIGNAL(activated(int) ),
this, SLOT( subSectionChanged() ) );
@@ -395,24 +399,38 @@ void MainWindow::showPopup()
QStringList dests = settings->getDestinationNames();
for (uint i = 0; i < dests.count(); i++ )
{
popupAction = new QAction( dests[i], QString::null, 0, this, 0 );
popupAction->addTo( destsMenu );
}
connect( destsMenu, SIGNAL( activated( int ) ),
this, SLOT( changePackageDest( int ) ) );
popupMenu->popup( QCursor::pos() );
}
void MainWindow::changePackageDest( int i )
{
activePackage->setDest( destsMenu->text(i) );
activePackage->setOn();
activePackage->setLink( settings->createLinks() );
activePackageListItem->displayDetails();
}
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