summaryrefslogtreecommitdiff
authordrw <drw>2004-01-24 18:17:58 (UTC)
committer drw <drw>2004-01-24 18:17:58 (UTC)
commit88b1045297b464cf1002b021a8981bd1087f8f2d (patch) (side-by-side diff)
tree0dbbce38d4da253319fc0895ea8f2fdeb2b6940e
parent5f333c6832ff429a00498e6a36be950525541a2a (diff)
downloadopie-88b1045297b464cf1002b021a8981bd1087f8f2d.zip
opie-88b1045297b464cf1002b021a8981bd1087f8f2d.tar.gz
opie-88b1045297b464cf1002b021a8981bd1087f8f2d.tar.bz2
Start of package information dialog, UI done, need to retrieve package data yet
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/mainwindow.cpp26
-rw-r--r--noncore/settings/packagemanager/mainwindow.h5
-rw-r--r--noncore/settings/packagemanager/packageinfodlg.cpp34
-rw-r--r--noncore/settings/packagemanager/packageinfodlg.h9
4 files changed, 63 insertions, 11 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
@@ -48,4 +48,5 @@
#include "promptdlg.h"
#include "entrydlg.h"
+#include "packageinfodlg.h"
MainWindow::MainWindow( QWidget *parent, const char *name, WFlags fl )
@@ -118,4 +119,6 @@ void MainWindow::initPackageList()
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 *)) );
}
@@ -353,5 +356,5 @@ void MainWindow::slotUpdate()
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
@@ -365,5 +368,5 @@ void MainWindow::slotUpgrade()
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
@@ -412,5 +415,5 @@ void MainWindow::slotDownload()
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
@@ -510,5 +513,5 @@ void MainWindow::slotApply()
installCmd, installList,
upgradeCmd, upgradeList );
- connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseInstallDlg()) );
+ connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) );
// Display widget
@@ -517,5 +520,5 @@ void MainWindow::slotApply()
}
-void MainWindow::slotCloseInstallDlg()
+void MainWindow::slotCloseDlg()
{
// Close install dialog
@@ -666,2 +669,15 @@ 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 );
+}
diff --git a/noncore/settings/packagemanager/mainwindow.h b/noncore/settings/packagemanager/mainwindow.h
index 285cddf..fb555c5 100644
--- a/noncore/settings/packagemanager/mainwindow.h
+++ b/noncore/settings/packagemanager/mainwindow.h
@@ -117,5 +117,5 @@ private slots:
void slotDownload();
void slotApply();
- void slotCloseInstallDlg();
+ void slotCloseDlg();
void slotConfigure();
@@ -132,4 +132,7 @@ private slots:
void slotFindChanged( const QString &findText );
void slotFindNext();
+
+ // Other slots
+ void slotDisplayPackageInfo( QListViewItem * );
};
diff --git a/noncore/settings/packagemanager/packageinfodlg.cpp b/noncore/settings/packagemanager/packageinfodlg.cpp
index 71f17eb..26356b9 100644
--- a/noncore/settings/packagemanager/packageinfodlg.cpp
+++ b/noncore/settings/packagemanager/packageinfodlg.cpp
@@ -35,8 +35,11 @@
#include <qpe/resource.h>
+#include <opie/otabwidget.h>
+
PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package )
: QWidget( 0x0 )
, m_packman( pm )
- , m_output( this )
+ , m_information( this )
+ , m_files( this )
{
// Initialize UI
@@ -46,11 +49,34 @@ PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QStr
QVBoxLayout *layout = new QVBoxLayout( this, 4, 0 );
- m_output.setReadOnly( true );
- layout->addWidget( &m_output );
+ OTabWidget *tabWidget = new OTabWidget( this );
+ layout->addWidget( tabWidget );
QPushButton *btn = new QPushButton( Resource::loadPixmap( "enter" ), tr( "Close" ), this );
layout->addWidget( btn );
-// TODO connect( btn, SIGNAL(clicked()), this, SLOT(slotBtnClose()) );
+ connect( btn, SIGNAL(clicked()), this, SLOT(slotBtnClose()) );
+
+ // Information tab
+ m_information.reparent( tabWidget, QPoint( 0, 0 ) );
+ m_information.setReadOnly( true );
+ tabWidget->addTab( &m_information, "UtilsIcon", tr( "Information" ) );
+
+ // Files tab
+ QWidget *filesWidget = new QWidget( tabWidget );
+ QVBoxLayout *filesLayout = new QVBoxLayout( filesWidget, 4, 0 );
+ m_files.reparent( filesWidget, QPoint( 0, 0 ) );
+ m_files.setReadOnly( true );
+ filesLayout->addWidget( &m_files );
+ btn = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ), tr( "Retrieve file list" ),
+ filesWidget );
+ filesLayout->addWidget( btn );
+// TODO connect( btn, SIGNAL(clicked()), this, SLOT(slotFileScan()) );
+ tabWidget->addTab( filesWidget, "binary", tr( "Files" ) );
+ tabWidget->setCurrentTab( tr( "Information" ) );
+}
+
+void PackageInfoDlg::slotBtnClose()
+{
+ emit closeInfoDlg();
}
diff --git a/noncore/settings/packagemanager/packageinfodlg.h b/noncore/settings/packagemanager/packageinfodlg.h
index 3bb9a7a..09af6f4 100644
--- a/noncore/settings/packagemanager/packageinfodlg.h
+++ b/noncore/settings/packagemanager/packageinfodlg.h
@@ -53,5 +53,12 @@ private:
// UI controls
- QMultiLineEdit m_output; // Multi-line edit to display package information
+ QMultiLineEdit m_information; // Multi-line edit to display package information
+ QMultiLineEdit m_files; // Multi-line edit to display package file list
+
+private slots:
+ void slotBtnClose();
+
+signals:
+ void closeInfoDlg();
};