Diffstat (limited to 'noncore/settings/packagemanager/packageinfodlg.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/packageinfodlg.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/noncore/settings/packagemanager/packageinfodlg.cpp b/noncore/settings/packagemanager/packageinfodlg.cpp index c5924fd..5f72a67 100644 --- a/noncore/settings/packagemanager/packageinfodlg.cpp +++ b/noncore/settings/packagemanager/packageinfodlg.cpp | |||
@@ -41,8 +41,9 @@ _;:, .> :=|. This file is free software; you can | |||
41 | 41 | ||
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( 0l ) |
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 | , m_retrieveFiles( 0l ) | ||
47 | { | 48 | { |
48 | // Initialize UI | 49 | // Initialize UI |
@@ -89,16 +90,19 @@ PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QStr | |||
89 | filesLayout->addWidget( &m_files ); | 90 | filesLayout->addWidget( &m_files ); |
90 | 91 | ||
91 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ), | 92 | // If file list is already cached, display |
93 | if ( !m_package->files().isNull() ) | ||
94 | m_files.setText( m_package->files() ); | ||
95 | else | ||
96 | { | ||
97 | m_retrieveFiles = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ), | ||
92 | tr( "Retrieve file list" ), filesWidget ); | 98 | tr( "Retrieve file list" ), filesWidget ); |
93 | QWhatsThis::add( btn, tr( "Tap here to retrieve list of files contained in this package." ) ); | 99 | QWhatsThis::add( m_retrieveFiles, tr( "Tap here to retrieve list of files contained in this package." ) ); |
94 | filesLayout->addWidget( btn ); | 100 | filesLayout->addWidget( m_retrieveFiles ); |
95 | connect( btn, SIGNAL(clicked()), this, SLOT(slotBtnFileScan()) ); | 101 | connect( m_retrieveFiles, SIGNAL(clicked()), this, SLOT(slotBtnFileScan()) ); |
96 | tabWidget->addTab( filesWidget, "binary", tr( "File list" ) ); | 102 | } |
97 | 103 | ||
104 | tabWidget->addTab( filesWidget, "binary", tr( "File list" ) ); | ||
98 | tabWidget->setCurrentTab( tr( "Information" ) ); | 105 | tabWidget->setCurrentTab( tr( "Information" ) ); |
99 | 106 | ||
100 | // If file list is already cached, display | ||
101 | if ( !m_package->files().isNull() ) | ||
102 | m_files.setText( m_package->files() ); | ||
103 | } | 107 | } |
104 | else | 108 | else |
@@ -116,5 +120,5 @@ PackageInfoDlg::~PackageInfoDlg() | |||
116 | 120 | ||
117 | // Cache package file list | 121 | // Cache package file list |
118 | if ( !m_files.text().isNull() ) | 122 | if ( !m_files.text().isEmpty() ) |
119 | m_package->setFiles( m_files.text() ); | 123 | m_package->setFiles( m_files.text() ); |
120 | } | 124 | } |
@@ -126,4 +130,7 @@ void PackageInfoDlg::slotBtnFileScan() | |||
126 | QStringList list( m_package->name() ); | 130 | QStringList list( m_package->name() ); |
127 | m_packman->executeCommand( OPackage::Files, list, QString::null, this, SLOT(slotFiles(char*)), true ); | 131 | m_packman->executeCommand( OPackage::Files, list, QString::null, this, SLOT(slotFiles(char*)), true ); |
132 | |||
133 | if ( m_retrieveFiles ) | ||
134 | m_retrieveFiles->hide(); | ||
128 | } | 135 | } |
129 | 136 | ||