summaryrefslogtreecommitdiff
path: root/noncore/settings/packagemanager/packageinfodlg.cpp
Unidiff
Diffstat (limited to 'noncore/settings/packagemanager/packageinfodlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/packageinfodlg.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/settings/packagemanager/packageinfodlg.cpp b/noncore/settings/packagemanager/packageinfodlg.cpp
index e034f34..8b1b203 100644
--- a/noncore/settings/packagemanager/packageinfodlg.cpp
+++ b/noncore/settings/packagemanager/packageinfodlg.cpp
@@ -11,52 +11,51 @@
11.="- .-=="i,     .._ License as published by the Free Software 11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License, 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version. 13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_. 14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that 15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17 : ..    .:,     . . . without even the implied warranty of 17 : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22:     =  ...= . :.=- 22:     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29*/ 29*/
30 30
31#include "packageinfodlg.h" 31#include "packageinfodlg.h"
32#include "opackage.h" 32#include "opackage.h"
33#include "opackagemanager.h" 33#include "opackagemanager.h"
34 34
35#include <opie2/oresource.h>
35#include <opie2/otabwidget.h> 36#include <opie2/otabwidget.h>
36 37
37#include <qpe/resource.h>
38
39#include <qlayout.h> 38#include <qlayout.h>
40#include <qpushbutton.h> 39#include <qpushbutton.h>
41#include <qwhatsthis.h> 40#include <qwhatsthis.h>
42 41
43PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package ) 42PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package )
44 : QWidget( 0l ) 43 : QWidget( 0l )
45 , m_packman( pm ) 44 , m_packman( pm )
46 , m_information( this ) 45 , m_information( this )
47 , m_files( this ) 46 , m_files( this )
48 , m_retrieveFiles( 0l ) 47 , m_retrieveFiles( 0l )
49{ 48{
50 // Initialize UI 49 // Initialize UI
51 if ( parent ) 50 if ( parent )
52 parent->setCaption( package ); 51 parent->setCaption( package );
53 52
54 QVBoxLayout *layout = new QVBoxLayout( this, 4, 2 ); 53 QVBoxLayout *layout = new QVBoxLayout( this, 4, 2 );
55 54
56 Opie::Ui::OTabWidget *tabWidget = new Opie::Ui::OTabWidget( this ); 55 Opie::Ui::OTabWidget *tabWidget = new Opie::Ui::OTabWidget( this );
57 layout->addWidget( tabWidget ); 56 layout->addWidget( tabWidget );
58 57
59 // Information tab 58 // Information tab
60 QWhatsThis::add( &m_information, tr( "This area contains information about the package." ) ); 59 QWhatsThis::add( &m_information, tr( "This area contains information about the package." ) );
61 m_information.reparent( tabWidget, QPoint( 0, 0 ) ); 60 m_information.reparent( tabWidget, QPoint( 0, 0 ) );
62 m_information.setReadOnly( true ); 61 m_information.setReadOnly( true );
@@ -75,50 +74,51 @@ PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QStr
75 m_information.setText( m_package->information() ); 74 m_information.setText( m_package->information() );
76 else 75 else
77 { 76 {
78 // Package information is not cached, retrieve it 77 // Package information is not cached, retrieve it
79 QStringList list( package ); 78 QStringList list( package );
80 m_packman->executeCommand( OPackage::Info, list, QString::null, 79 m_packman->executeCommand( OPackage::Info, list, QString::null,
81 this, SLOT(slotInfo(const QString &)), true ); 80 this, SLOT(slotInfo(const QString &)), true );
82 } 81 }
83 82
84 // Files tab (display only if package is installed) 83 // Files tab (display only if package is installed)
85 if ( !m_package->versionInstalled().isNull() ) 84 if ( !m_package->versionInstalled().isNull() )
86 { 85 {
87 QWidget *filesWidget = new QWidget( tabWidget ); 86 QWidget *filesWidget = new QWidget( tabWidget );
88 QVBoxLayout *filesLayout = new QVBoxLayout( filesWidget, 2, 2 ); 87 QVBoxLayout *filesLayout = new QVBoxLayout( filesWidget, 2, 2 );
89 QWhatsThis::add( &m_files, tr( "This area contains a list of files contained in this package." ) ); 88 QWhatsThis::add( &m_files, tr( "This area contains a list of files contained in this package." ) );
90 m_files.reparent( filesWidget, QPoint( 0, 0 ) ); 89 m_files.reparent( filesWidget, QPoint( 0, 0 ) );
91 m_files.setReadOnly( true ); 90 m_files.setReadOnly( true );
92 filesLayout->addWidget( &m_files ); 91 filesLayout->addWidget( &m_files );
93 92
94 // If file list is already cached, display 93 // If file list is already cached, display
95 if ( !m_package->files().isNull() ) 94 if ( !m_package->files().isNull() )
96 m_files.setText( m_package->files() ); 95 m_files.setText( m_package->files() );
97 else 96 else
98 { 97 {
99 m_retrieveFiles = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ), 98 m_retrieveFiles = new QPushButton( Opie::Core::OResource::loadPixmap( "packagemanager/apply",
100 tr( "Retrieve file list" ), filesWidget ); 99 Opie::Core::OResource::SmallIcon ), tr( "Retrieve file list" ),
100 filesWidget );
101 QWhatsThis::add( m_retrieveFiles, tr( "Tap here to retrieve list of files contained in this package." ) ); 101 QWhatsThis::add( m_retrieveFiles, tr( "Tap here to retrieve list of files contained in this package." ) );
102 filesLayout->addWidget( m_retrieveFiles ); 102 filesLayout->addWidget( m_retrieveFiles );
103 connect( m_retrieveFiles, SIGNAL(clicked()), this, SLOT(slotBtnFileScan()) ); 103 connect( m_retrieveFiles, SIGNAL(clicked()), this, SLOT(slotBtnFileScan()) );
104 } 104 }
105 105
106 tabWidget->addTab( filesWidget, "binary", tr( "File list" ) ); 106 tabWidget->addTab( filesWidget, "binary", tr( "File list" ) );
107 tabWidget->setCurrentTab( tr( "Information" ) ); 107 tabWidget->setCurrentTab( tr( "Information" ) );
108 108
109 } 109 }
110 else 110 else
111 m_files.hide(); 111 m_files.hide();
112} 112}
113 113
114PackageInfoDlg::~PackageInfoDlg() 114PackageInfoDlg::~PackageInfoDlg()
115{ 115{
116 if ( !m_package ) 116 if ( !m_package )
117 return; 117 return;
118 118
119 // Cache package information 119 // Cache package information
120 if ( !m_information.text().isNull() ) 120 if ( !m_information.text().isNull() )
121 m_package->setInformation( m_information.text() ); 121 m_package->setInformation( m_information.text() );
122 122
123 // Cache package file list 123 // Cache package file list
124 if ( !m_files.text().isEmpty() ) 124 if ( !m_files.text().isEmpty() )