summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/mainwindow.cpp30
-rw-r--r--noncore/settings/packagemanager/mainwindow.h43
2 files changed, 52 insertions, 21 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
@@ -34,6 +34,8 @@ _;:, .> :=|. This file is free software; you can
34#include "entrydlg.h" 34#include "entrydlg.h"
35#include "packageinfodlg.h" 35#include "packageinfodlg.h"
36 36
37#include <opie2/ofiledialog.h>
38
37#include <qpe/qcopenvelope_qws.h> 39#include <qpe/qcopenvelope_qws.h>
38#include <qpe/qpeapplication.h> 40#include <qpe/qpeapplication.h>
39#include <qpe/resource.h> 41#include <qpe/resource.h>
@@ -182,6 +184,12 @@ void MainWindow::initUI()
182 a->addTo( popup ); 184 a->addTo( popup );
183 a->addTo( &m_toolBar ); 185 a->addTo( &m_toolBar );
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();
186 194
187 a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 ); 195 a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 );
@@ -519,6 +527,28 @@ void MainWindow::slotApply()
519 m_widgetStack.raiseWidget( dlg ); 527 m_widgetStack.raiseWidget( dlg );
520} 528}
521 529
530void 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
522void MainWindow::slotCloseDlg() 552void MainWindow::slotCloseDlg()
523{ 553{
524 // Close install dialog 554 // Close install dialog
diff --git a/noncore/settings/packagemanager/mainwindow.h b/noncore/settings/packagemanager/mainwindow.h
index 632effb..7968614 100644
--- a/noncore/settings/packagemanager/mainwindow.h
+++ b/noncore/settings/packagemanager/mainwindow.h
@@ -1,27 +1,27 @@
1/* 1/*
2                This file is part of the OPIE Project 2 This file is part of the OPIE Project
3 3
4 =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 =. Copyright (c) 2003 Dan Williams <drw@handhelds.org>
5             .=l. 5 .=l.
6           .>+-= 6 .>+-=
7 _;:,     .>    :=|. This file is free software; you can 7_;:, .> :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_, > . <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.-- : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i, .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11- . .-<_> .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12 ._= =} : or (at your option) any later version.
13    .%`+i>       _;_. 13 .%`+i> _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14 .i_,=:_. -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16 : .. .:, . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.= = ; Public License for more details.
20++=   -.     .`     .: 20++= -. .` .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21: = ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22-. .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23 -_. . . )=. = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24 -- :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
@@ -116,6 +116,7 @@ private slots:
116 void slotUpgrade(); 116 void slotUpgrade();
117 void slotDownload(); 117 void slotDownload();
118 void slotApply(); 118 void slotApply();
119 void slotInstallLocal();
119 void slotCloseDlg(); 120 void slotCloseDlg();
120 void slotConfigure(); 121 void slotConfigure();
121 122