summaryrefslogtreecommitdiff
path: root/noncore/settings/packagemanager/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/packagemanager/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/packagemanager/mainwindow.cpp26
1 files changed, 21 insertions, 5 deletions
diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp
index 486561d..05f21bc 100644
--- a/noncore/settings/packagemanager/mainwindow.cpp
+++ b/noncore/settings/packagemanager/mainwindow.cpp
@@ -44,12 +44,13 @@
#include "mainwindow.h"
#include "installdlg.h"
#include "filterdlg.h"
#include "promptdlg.h"
#include "entrydlg.h"
+#include "packageinfodlg.h"
MainWindow::MainWindow( QWidget *parent, const char *name, WFlags fl )
: QMainWindow( parent, name, fl || WStyle_ContextHelp )
, m_config( "packman" )
, m_packman( &m_config, this )
, m_menuBar( this )
@@ -114,12 +115,14 @@ void MainWindow::closeEvent( QCloseEvent *event )
void MainWindow::initPackageList()
{
m_packageList.addColumn( tr( "Packages" ) );
QWhatsThis::add( &m_packageList, tr( "This is a listing of all packages.\n\nA blue dot next to the package name indicates that the package is currently installed.\n\nA blue dot with a star indicates that a newer version of the package is available from the server feed.\n\nClick inside the box at the left to select a package." ) );
QPEApplication::setStylusOperation( m_packageList.viewport(), QPEApplication::RightOnHold );
+ connect( &m_packageList, SIGNAL(rightButtonPressed(QListViewItem *,const QPoint &,int)),
+ this, SLOT(slotDisplayPackageInfo(QListViewItem *)) );
}
void MainWindow::initStatusWidget()
{
QVBoxLayout *layout = new QVBoxLayout( &m_statusWidget, 4, 4 );
@@ -349,25 +352,25 @@ void MainWindow::slotStatusBar( int currStep )
void MainWindow::slotUpdate()
{
// Create package manager output widget
InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Update package information" ), false,
OPackage::Update );
- connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseInstallDlg()) );
+ connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) );
// Display widget
m_widgetStack.addWidget( dlg, 3 );
m_widgetStack.raiseWidget( dlg );
}
void MainWindow::slotUpgrade()
{
// Create package manager output widget
InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Upgrade installed packages" ), false,
OPackage::Upgrade );
- connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseInstallDlg()) );
+ connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) );
// Display widget
m_widgetStack.addWidget( dlg, 3 );
m_widgetStack.raiseWidget( dlg );
}
@@ -408,13 +411,13 @@ void MainWindow::slotDownload()
// Get starting directory
QDir::setCurrent( workingDir );
// Create package manager output widget
InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Download packages" ), false,
OPackage::Download, workingPackages );
- connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseInstallDlg()) );
+ connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) );
// Display widget
m_widgetStack.addWidget( dlg, 3 );
m_widgetStack.raiseWidget( dlg );
}
}
@@ -506,20 +509,20 @@ void MainWindow::slotApply()
// Create package manager output widget
InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Apply changes" ), true,
removeCmd, removeList,
installCmd, installList,
upgradeCmd, upgradeList );
- connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseInstallDlg()) );
+ connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) );
// Display widget
m_widgetStack.addWidget( dlg, 3 );
m_widgetStack.raiseWidget( dlg );
}
-void MainWindow::slotCloseInstallDlg()
+void MainWindow::slotCloseDlg()
{
// Close install dialog
delete m_widgetStack.visibleWidget();
// Reload package list
initPackageInfo();
@@ -662,6 +665,19 @@ void MainWindow::slotFindChanged( const QString &findText )
}
void MainWindow::slotFindNext()
{
searchForPackage( m_findEdit->text() );
}
+
+void MainWindow::slotDisplayPackageInfo( QListViewItem *packageItem )
+{
+ QString packageName( ( static_cast<QCheckListItem*>( packageItem ) )->text() );
+
+ // Create package manager output widget
+ PackageInfoDlg *dlg = new PackageInfoDlg( this, &m_packman, packageName );
+ connect( dlg, SIGNAL(closeInfoDlg()), this, SLOT(slotCloseDlg()) );
+
+ // Display widget
+ m_widgetStack.addWidget( dlg, 3 );
+ m_widgetStack.raiseWidget( dlg );
+}