summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/mainwindow.cpp40
-rw-r--r--noncore/settings/packagemanager/mainwindow.h3
2 files changed, 31 insertions, 12 deletions
diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp
index 5a942a1..349094d 100644
--- a/noncore/settings/packagemanager/mainwindow.cpp
+++ b/noncore/settings/packagemanager/mainwindow.cpp
@@ -93,3 +93,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags /*fl*/ )
93 // Initialize package information 93 // Initialize package information
94 QTimer::singleShot( 100, this, SLOT( initPackageInfo() ) ); 94 QTimer::singleShot( -1, this, SLOT( initPackageInfo() ) );
95} 95}
@@ -311,2 +311,24 @@ void MainWindow::searchForPackage( const QString &text )
311 311
312void MainWindow::installLocalPackage( const QString &ipkFile )
313{
314 // Install selected file
315 InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Install local package" ), true,
316 OPackage::Install, new QStringList( ipkFile ) );
317 connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) );
318
319 // Display widget
320 m_widgetStack.addWidget( dlg, 3 );
321 m_widgetStack.raiseWidget( dlg );
322}
323
324void MainWindow::setDocument( const QString &ipkFile )
325{
326 QString file = ipkFile;
327 DocLnk lnk( ipkFile );
328 if ( lnk.isValid() )
329 file = lnk.file();
330
331 installLocalPackage( file );
332}
333
312void MainWindow::initPackageInfo() 334void MainWindow::initPackageInfo()
@@ -326,3 +348,6 @@ void MainWindow::initPackageInfo()
326 348
327 m_widgetStack.raiseWidget( &m_packageList ); 349 QWidget *widget = m_widgetStack.widget( 3 );
350 if ( !widget )
351 widget = &m_packageList;
352 m_widgetStack.raiseWidget( widget );
328} 353}
@@ -539,12 +564,3 @@ void MainWindow::slotInstallLocal()
539 if ( !package.isNull() ) 564 if ( !package.isNull() )
540 { 565 installLocalPackage( package );
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} 566}
diff --git a/noncore/settings/packagemanager/mainwindow.h b/noncore/settings/packagemanager/mainwindow.h
index 7968614..103c664 100644
--- a/noncore/settings/packagemanager/mainwindow.h
+++ b/noncore/settings/packagemanager/mainwindow.h
@@ -103,4 +103,7 @@ private:
103 void searchForPackage( const QString &text ); 103 void searchForPackage( const QString &text );
104 void installLocalPackage( const QString &ipkFile );
104 105
105private slots: 106private slots:
107 void setDocument( const QString &ipkFile );
108
106 void initPackageInfo(); 109 void initPackageInfo();