summaryrefslogtreecommitdiff
path: root/noncore/settings/packagemanager/mainwindow.cpp
Unidiff
Diffstat (limited to 'noncore/settings/packagemanager/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/packagemanager/mainwindow.cpp30
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
@@ -25,24 +25,26 @@ _;:, .> :=|. This file is free software; you can
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
28*/ 28*/
29 29
30#include "mainwindow.h" 30#include "mainwindow.h"
31#include "installdlg.h" 31#include "installdlg.h"
32#include "filterdlg.h" 32#include "filterdlg.h"
33#include "promptdlg.h" 33#include "promptdlg.h"
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>
40 42
41#include <qaction.h> 43#include <qaction.h>
42#include <qdir.h> 44#include <qdir.h>
43#include <qlayout.h> 45#include <qlayout.h>
44#include <qlineedit.h> 46#include <qlineedit.h>
45#include <qmenubar.h> 47#include <qmenubar.h>
46#include <qmessagebox.h> 48#include <qmessagebox.h>
47#include <qpopupmenu.h> 49#include <qpopupmenu.h>
48#include <qtimer.h> 50#include <qtimer.h>
@@ -173,24 +175,30 @@ void MainWindow::initUI()
173 QAction *actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 ); 175 QAction *actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 );
174 actionDownload->setWhatsThis( tr( "Tap here to download the currently selected package(s)." ) ); 176 actionDownload->setWhatsThis( tr( "Tap here to download the currently selected package(s)." ) );
175 connect( actionDownload, SIGNAL(activated()), this, SLOT(slotDownload()) ); 177 connect( actionDownload, SIGNAL(activated()), this, SLOT(slotDownload()) );
176 actionDownload->addTo( popup ); 178 actionDownload->addTo( popup );
177 actionDownload->addTo( &m_toolBar ); 179 actionDownload->addTo( &m_toolBar );
178 180
179 a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "packagemanager/apply" ), QString::null, 0, this, 0 ); 181 a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "packagemanager/apply" ), QString::null, 0, this, 0 );
180 a->setWhatsThis( tr( "Tap here to install, remove or upgrade currently selected package(s)." ) ); 182 a->setWhatsThis( tr( "Tap here to install, remove or upgrade currently selected package(s)." ) );
181 connect( a, SIGNAL(activated()), this, SLOT(slotApply()) ); 183 connect( a, SIGNAL(activated()), this, SLOT(slotApply()) );
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 );
188 a->setWhatsThis( tr( "Tap here to configure this application." ) ); 196 a->setWhatsThis( tr( "Tap here to configure this application." ) );
189 connect( a, SIGNAL(activated()), this, SLOT(slotConfigure()) ); 197 connect( a, SIGNAL(activated()), this, SLOT(slotConfigure()) );
190 a->addTo( popup ); 198 a->addTo( popup );
191 mb->insertItem( tr( "Actions" ), popup ); 199 mb->insertItem( tr( "Actions" ), popup );
192 200
193 // View menu 201 // View menu
194 popup = new QPopupMenu( this ); 202 popup = new QPopupMenu( this );
195 203
196 m_actionShowNotInstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 ); 204 m_actionShowNotInstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 );
@@ -510,24 +518,46 @@ void MainWindow::slotApply()
510 // Create package manager output widget 518 // Create package manager output widget
511 InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Apply changes" ), true, 519 InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Apply changes" ), true,
512 removeCmd, removeList, 520 removeCmd, removeList,
513 installCmd, installList, 521 installCmd, installList,
514 upgradeCmd, upgradeList ); 522 upgradeCmd, upgradeList );
515 connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); 523 connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) );
516 524
517 // Display widget 525 // Display widget
518 m_widgetStack.addWidget( dlg, 3 ); 526 m_widgetStack.addWidget( dlg, 3 );
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
525 delete m_widgetStack.visibleWidget(); 555 delete m_widgetStack.visibleWidget();
526 556
527 // Reload package list 557 // Reload package list
528 initPackageInfo(); 558 initPackageInfo();
529 559
530 // Update Opie launcher links 560 // Update Opie launcher links
531 QCopEnvelope e("QPE/System", "linkChanged(QString)"); 561 QCopEnvelope e("QPE/System", "linkChanged(QString)");
532 QString lf = QString::null; 562 QString lf = QString::null;
533 e << lf; 563 e << lf;