Diffstat (limited to 'noncore/settings/packagemanager/installdlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/installdlg.cpp | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/noncore/settings/packagemanager/installdlg.cpp b/noncore/settings/packagemanager/installdlg.cpp index 205d7ed..15d88ad 100644 --- a/noncore/settings/packagemanager/installdlg.cpp +++ b/noncore/settings/packagemanager/installdlg.cpp @@ -22,27 +22,27 @@ : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "installdlg.h" #include <opie2/ofiledialog.h> +#include <opie2/oresource.h> #include <qpe/fileselector.h> -#include <qpe/resource.h> #include <qpe/storage.h> #include <qapplication.h> #include <qcombobox.h> #include <qfileinfo.h> #include <qgroupbox.h> #include <qlabel.h> #include <qlayout.h> #include <qmap.h> #include <qmultilineedit.h> #include <qpushbutton.h> @@ -121,33 +121,32 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap } QGroupBox *groupBox = new QGroupBox( 0, Qt::Vertical, tr( "Output" ), this ); groupBox->layout()->setSpacing( 0 ); groupBox->layout()->setMargin( 4 ); QVBoxLayout *groupBoxLayout = new QVBoxLayout( groupBox->layout() ); m_output = new QMultiLineEdit( groupBox ); m_output->setReadOnly( true ); groupBoxLayout->addWidget( m_output ); layout->addMultiCellWidget( groupBox, 2, 2, 0, 1 ); - QPixmap pic; - pic.convertFromImage( Resource::loadImage( "packagemanager/apply" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - m_btnStart = new QPushButton( pic, tr( "Start" ), this ); + m_btnStart = new QPushButton( Opie::Core::OResource::loadPixmap( "packagemanager/apply", + Opie::Core::OResource::SmallIcon ), tr( "Start" ), this ); m_btnStart->setMinimumHeight( AppLnk::smallIconSize() ); layout->addWidget( m_btnStart, 3, 0 ); connect( m_btnStart, SIGNAL(clicked()), this, SLOT(slotBtnStart()) ); - pic.convertFromImage( Resource::loadImage( "SettingsIcon" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - m_btnOptions = new QPushButton( pic, tr( "Options" ), this ); + m_btnOptions = new QPushButton( Opie::Core::OResource::loadPixmap( "SettingsIcon", Opie::Core::OResource::SmallIcon ), + tr( "Options" ), this ); m_btnOptions->setMinimumHeight( AppLnk::smallIconSize() ); layout->addWidget( m_btnOptions, 3, 1 ); connect( m_btnOptions, SIGNAL( clicked() ), this, SLOT(slotBtnOptions()) ); // Display packages being acted upon in output widget for( int i = 0; i < m_numCommands; i++ ) { if ( !m_packages[ i ].isEmpty() ) { QString lineStr = tr( "Packages to " ); switch( m_command[ i ] ) @@ -214,75 +213,68 @@ void InstallDlg::slotDisplayAvailSpace( const QString &destination ) } void InstallDlg::slotBtnStart() { QString btnText = m_btnStart->text(); if ( btnText == tr( "Abort" ) ) { // Prevent unexecuted commands from executing m_currCommand = 999; // Allow user to close dialog m_btnStart->setText( tr( "Close" ) ); - QPixmap pic; - pic.convertFromImage( Resource::loadImage( "close" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - m_btnStart->setIconSet( pic ); + m_btnStart->setIconSet( Opie::Core::OResource::loadPixmap( "close", Opie::Core::OResource::SmallIcon ) ); return; } else if ( btnText == tr( "Close" ) ) { // TODO - force reload of package data emit closeInstallDlg(); return; } // Start was clicked, start executing QString dest; if ( m_installFound ) { dest = m_destination->currentText(); m_destination->setEnabled( false ); } m_btnOptions->setEnabled( false ); if ( m_numCommands > 1 ) { m_btnStart->setText( tr( "Abort" ) ); - QPixmap pic; - pic.convertFromImage( Resource::loadImage( "reset" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - m_btnStart->setIconSet( pic ); + m_btnStart->setIconSet( Opie::Core::OResource::loadPixmap( "reset", Opie::Core::OResource::SmallIcon ) ); } else { m_btnStart->setEnabled( false ); } for ( m_currCommand = 0; m_currCommand < m_numCommands; m_currCommand++ ) { // Execute next command m_packman->executeCommand( m_command[ m_currCommand ], m_packages[ m_currCommand ], dest, this, SLOT(slotOutput(const QString &)), true ); } // All commands executed, allow user to close dialog m_btnStart->setEnabled( true ); m_btnStart->setText( tr( "Close" ) ); - QPixmap pic; - pic.convertFromImage( Resource::loadImage( "close" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - m_btnStart->setIconSet( pic ); + m_btnStart->setIconSet( Opie::Core::OResource::loadPixmap( "close", Opie::Core::OResource::SmallIcon ) ); m_btnOptions->setEnabled( true ); m_btnOptions->setText( tr( "Save output" ) ); - pic.convertFromImage( Resource::loadImage( "save" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - m_btnOptions->setIconSet( pic ); + m_btnOptions->setIconSet( Opie::Core::OResource::loadPixmap( "save", Opie::Core::OResource::SmallIcon ) ); } void InstallDlg::slotBtnOptions() { QString btnText = m_btnOptions->text(); if ( btnText == tr( "Options" ) ) { // Display configuration dialog (only options tab is enabled) m_packman->configureDlg( true ); return; } |