Diffstat (limited to 'noncore/settings/packagemanager/packageinfodlg.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/packageinfodlg.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/noncore/settings/packagemanager/packageinfodlg.cpp b/noncore/settings/packagemanager/packageinfodlg.cpp index 73d3de7..d27eacb 100644 --- a/noncore/settings/packagemanager/packageinfodlg.cpp +++ b/noncore/settings/packagemanager/packageinfodlg.cpp | |||
@@ -22,48 +22,49 @@ | |||
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 | ||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "packageinfodlg.h" | 30 | #include "packageinfodlg.h" |
31 | #include "opackage.h" | 31 | #include "opackage.h" |
32 | #include "opackagemanager.h" | 32 | #include "opackagemanager.h" |
33 | 33 | ||
34 | #include <qlayout.h> | 34 | #include <opie2/otabwidget.h> |
35 | #include <qpushbutton.h> | ||
36 | 35 | ||
37 | #include <qpe/resource.h> | 36 | #include <qpe/resource.h> |
38 | 37 | ||
39 | #include <opie2/otabwidget.h> | 38 | #include <qlayout.h> |
39 | #include <qpushbutton.h> | ||
40 | #include <qwhatsthis.h> | ||
40 | 41 | ||
41 | using namespace Opie::Ui; | ||
42 | PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package ) | 42 | PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package ) |
43 | : QWidget( 0x0 ) | 43 | : QWidget( 0x0 ) |
44 | , m_packman( pm ) | 44 | , m_packman( pm ) |
45 | , m_information( this ) | 45 | , m_information( this ) |
46 | , m_files( this ) | 46 | , m_files( this ) |
47 | { | 47 | { |
48 | // Initialize UI | 48 | // Initialize UI |
49 | if ( parent ) | 49 | if ( parent ) |
50 | parent->setCaption( package ); | 50 | parent->setCaption( package ); |
51 | 51 | ||
52 | QVBoxLayout *layout = new QVBoxLayout( this, 4, 2 ); | 52 | QVBoxLayout *layout = new QVBoxLayout( this, 4, 2 ); |
53 | 53 | ||
54 | OTabWidget *tabWidget = new OTabWidget( this ); | 54 | Opie::Ui::OTabWidget *tabWidget = new Opie::Ui::OTabWidget( this ); |
55 | layout->addWidget( tabWidget ); | 55 | layout->addWidget( tabWidget ); |
56 | 56 | ||
57 | // Information tab | 57 | // Information tab |
58 | QWhatsThis::add( &m_information, tr( "This area contains information about the package." ) ); | ||
58 | m_information.reparent( tabWidget, QPoint( 0, 0 ) ); | 59 | m_information.reparent( tabWidget, QPoint( 0, 0 ) ); |
59 | m_information.setReadOnly( true ); | 60 | m_information.setReadOnly( true ); |
60 | tabWidget->addTab( &m_information, "UtilsIcon", tr( "Information" ) ); | 61 | tabWidget->addTab( &m_information, "UtilsIcon", tr( "Information" ) ); |
61 | 62 | ||
62 | // Retrive package information | 63 | // Retrive package information |
63 | m_package = m_packman->findPackage( package ); | 64 | m_package = m_packman->findPackage( package ); |
64 | if ( !m_package ) | 65 | if ( !m_package ) |
65 | { | 66 | { |
66 | m_information.setText( tr( "Unable to retrieve package information." ) ); | 67 | m_information.setText( tr( "Unable to retrieve package information." ) ); |
67 | return; | 68 | return; |
68 | } | 69 | } |
69 | 70 | ||
@@ -73,30 +74,32 @@ PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QStr | |||
73 | else | 74 | else |
74 | { | 75 | { |
75 | // Package information is not cached, retrieve it | 76 | // Package information is not cached, retrieve it |
76 | QStringList list( package ); | 77 | QStringList list( package ); |
77 | m_packman->executeCommand( OPackage::Info, &list, QString::null, this, SLOT(slotInfo(char*)), true ); | 78 | m_packman->executeCommand( OPackage::Info, &list, QString::null, this, SLOT(slotInfo(char*)), true ); |
78 | } | 79 | } |
79 | 80 | ||
80 | // Files tab (display only if package is installed) | 81 | // Files tab (display only if package is installed) |
81 | if ( !m_package->versionInstalled().isNull() ) | 82 | if ( !m_package->versionInstalled().isNull() ) |
82 | { | 83 | { |
83 | QWidget *filesWidget = new QWidget( tabWidget ); | 84 | QWidget *filesWidget = new QWidget( tabWidget ); |
84 | QVBoxLayout *filesLayout = new QVBoxLayout( filesWidget, 2, 2 ); | 85 | QVBoxLayout *filesLayout = new QVBoxLayout( filesWidget, 2, 2 ); |
86 | QWhatsThis::add( &m_files, tr( "This area contains a list of files contained in this package." ) ); | ||
85 | m_files.reparent( filesWidget, QPoint( 0, 0 ) ); | 87 | m_files.reparent( filesWidget, QPoint( 0, 0 ) ); |
86 | m_files.setReadOnly( true ); | 88 | m_files.setReadOnly( true ); |
87 | filesLayout->addWidget( &m_files ); | 89 | filesLayout->addWidget( &m_files ); |
88 | 90 | ||
89 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ), | 91 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ), |
90 | tr( "Retrieve file list" ), filesWidget ); | 92 | tr( "Retrieve file list" ), filesWidget ); |
93 | QWhatsThis::add( btn, tr( "Tap here to retrieve list of files contained in this package." ) ); | ||
91 | filesLayout->addWidget( btn ); | 94 | filesLayout->addWidget( btn ); |
92 | connect( btn, SIGNAL(clicked()), this, SLOT(slotBtnFileScan()) ); | 95 | connect( btn, SIGNAL(clicked()), this, SLOT(slotBtnFileScan()) ); |
93 | tabWidget->addTab( filesWidget, "binary", tr( "File list" ) ); | 96 | tabWidget->addTab( filesWidget, "binary", tr( "File list" ) ); |
94 | 97 | ||
95 | tabWidget->setCurrentTab( tr( "Information" ) ); | 98 | tabWidget->setCurrentTab( tr( "Information" ) ); |
96 | 99 | ||
97 | // If file list is already cached, display | 100 | // If file list is already cached, display |
98 | if ( !m_package->files().isNull() ) | 101 | if ( !m_package->files().isNull() ) |
99 | m_files.setText( m_package->files() ); | 102 | m_files.setText( m_package->files() ); |
100 | } | 103 | } |
101 | else | 104 | else |
102 | m_files.hide(); | 105 | m_files.hide(); |