author | drw <drw> | 2004-11-16 19:06:12 (UTC) |
---|---|---|
committer | drw <drw> | 2004-11-16 19:06:12 (UTC) |
commit | 1c6f490e8541626f68422e0a3a7c7281d7f5b7d3 (patch) (unidiff) | |
tree | cba3bc50c1611088ff1c15ebb0f79d7a3e1f454d /noncore/settings/packagemanager/mainwindow.cpp | |
parent | 64dabf8fbdc8593611b3438e6c9f5d3d7c40016f (diff) | |
download | opie-1c6f490e8541626f68422e0a3a7c7281d7f5b7d3.zip opie-1c6f490e8541626f68422e0a3a7c7281d7f5b7d3.tar.gz opie-1c6f490e8541626f68422e0a3a7c7281d7f5b7d3.tar.bz2 |
Add ability to install local ipkg files
Diffstat (limited to 'noncore/settings/packagemanager/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/mainwindow.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp index 807bddd..5a942a1 100644 --- a/noncore/settings/packagemanager/mainwindow.cpp +++ b/noncore/settings/packagemanager/mainwindow.cpp | |||
@@ -36,2 +36,4 @@ _;:, .> :=|. This file is free software; you can | |||
36 | 36 | ||
37 | #include <opie2/ofiledialog.h> | ||
38 | |||
37 | #include <qpe/qcopenvelope_qws.h> | 39 | #include <qpe/qcopenvelope_qws.h> |
@@ -184,2 +186,8 @@ void MainWindow::initUI() | |||
184 | 186 | ||
187 | a = new QAction( tr( "Install local package" ), Resource::loadPixmap( "folder" ), QString::null, 0, this, 0 ); | ||
188 | a->setWhatsThis( tr( "Tap here to install a package file located on device." ) ); | ||
189 | connect( a, SIGNAL(activated()), this, SLOT(slotInstallLocal()) ); | ||
190 | a->addTo( popup ); | ||
191 | //a->addTo( &m_toolBar ); | ||
192 | |||
185 | popup->insertSeparator(); | 193 | popup->insertSeparator(); |
@@ -521,2 +529,24 @@ void MainWindow::slotApply() | |||
521 | 529 | ||
530 | void MainWindow::slotInstallLocal() | ||
531 | { | ||
532 | // Display file open dialog with only package files | ||
533 | MimeTypes type; | ||
534 | QStringList packages; | ||
535 | packages << "application/ipkg"; | ||
536 | type.insert( tr( "Application Packages" ), packages ); | ||
537 | QString package = Opie::Ui::OFileDialog::getOpenFileName( Opie::Ui::OFileSelector::NORMAL, | ||
538 | "/", QString::null, type ); | ||
539 | if ( !package.isNull() ) | ||
540 | { | ||
541 | // Install selected file | ||
542 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Install local package" ), true, | ||
543 | OPackage::Install, new QStringList( package ) ); | ||
544 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); | ||
545 | |||
546 | // Display widget | ||
547 | m_widgetStack.addWidget( dlg, 3 ); | ||
548 | m_widgetStack.raiseWidget( dlg ); | ||
549 | } | ||
550 | } | ||
551 | |||
522 | void MainWindow::slotCloseDlg() | 552 | void MainWindow::slotCloseDlg() |