summaryrefslogtreecommitdiff
path: root/noncore/settings/packagemanager/oipkgconfigdlg.cpp
authordrw <drw>2005-03-03 19:15:30 (UTC)
committer drw <drw>2005-03-03 19:15:30 (UTC)
commit9c55e475ed3170488dd37ce8f36fa909397997bb (patch) (side-by-side diff)
treef1fad490bc0d56059f8c26cfdf9002a831158a7c /noncore/settings/packagemanager/oipkgconfigdlg.cpp
parentadb8960dfcdb18b698f313fc7e7d40209c65b01a (diff)
downloadopie-9c55e475ed3170488dd37ce8f36fa909397997bb.zip
opie-9c55e475ed3170488dd37ce8f36fa909397997bb.tar.gz
opie-9c55e475ed3170488dd37ce8f36fa909397997bb.tar.bz2
Scale icons appropriately
Diffstat (limited to 'noncore/settings/packagemanager/oipkgconfigdlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
index 7ee2d74..5f60990 100644
--- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp
+++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
@@ -135,146 +135,154 @@ void OIpkgConfigDlg::accept()
m_configs->append( new OConfItem( OConfItem::Other, "lists_dir",
m_optSourceLists->text(), "name" ) );
m_ipkg->setConfigItems( m_configs );
}
// Save options configuration
int options = 0;
if ( m_optForceDepends->isChecked() )
options |= FORCE_DEPENDS;
if ( m_optForceReinstall->isChecked() )
options |= FORCE_REINSTALL;
if ( m_optForceRemove->isChecked() )
options |= FORCE_REMOVE;
if ( m_optForceOverwrite->isChecked() )
options |= FORCE_OVERWRITE;
m_ipkg->setIpkgExecOptions( options );
m_ipkg->setIpkgExecVerbosity( m_optVerboseIpkg->currentItem() );
QDialog::accept();
}
void OIpkgConfigDlg::reject()
{
if ( m_configs )
delete m_configs;
}
void OIpkgConfigDlg::initServerWidget()
{
m_serverWidget = new QWidget( this );
// Initialize UI
QVBoxLayout *vb = new QVBoxLayout( m_serverWidget );
QScrollView *sv = new QScrollView( m_serverWidget );
vb->addWidget( sv, 0, 0 );
sv->setResizePolicy( QScrollView::AutoOneFit );
sv->setFrameStyle( QFrame::NoFrame );
QWidget *container = new QWidget( sv->viewport() );
sv->addChild( container );
QGridLayout *layout = new QGridLayout( container, 2, 3, 2, 4 );
m_serverList = new QListBox( container );
QWhatsThis::add( m_serverList, tr( "This is a list of all servers configured. Select one here to edit or delete, or add a new one below." ) );
m_serverList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );
connect( m_serverList, SIGNAL(highlighted(int)), this, SLOT(slotServerSelected(int)) );
layout->addMultiCellWidget( m_serverList, 0, 0, 0, 2 );
- QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container );
+ QPixmap pic;
+ pic.convertFromImage( Resource::loadImage( "new" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
+ QPushButton *btn = new QPushButton( pic, tr( "New" ), container );
QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) );
connect( btn, SIGNAL(clicked()), this, SLOT(slotServerNew()) );
layout->addWidget( btn, 1, 0 );
- m_serverEditBtn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), container );
+ pic.convertFromImage( Resource::loadImage( "edit" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
+ m_serverEditBtn = new QPushButton( pic, tr( "Edit" ), container );
m_serverEditBtn->setEnabled( false );
QWhatsThis::add( m_serverEditBtn, tr( "Tap here to edit the entry selected above." ) );
connect( m_serverEditBtn, SIGNAL(clicked()), this, SLOT(slotServerEdit()) );
layout->addWidget( m_serverEditBtn, 1, 1 );
- m_serverDeleteBtn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container );
+ pic.convertFromImage( Resource::loadImage( "trash" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
+ m_serverDeleteBtn = new QPushButton( pic, tr( "Delete" ), container );
m_serverDeleteBtn->setEnabled( false );
QWhatsThis::add( m_serverDeleteBtn, tr( "Tap here to delete the entry selected above." ) );
connect( m_serverDeleteBtn, SIGNAL(clicked()), this, SLOT(slotServerDelete()) );
layout->addWidget( m_serverDeleteBtn, 1, 2 );
}
void OIpkgConfigDlg::initDestinationWidget()
{
m_destWidget = new QWidget( this );
// Initialize UI
QVBoxLayout *vb = new QVBoxLayout( m_destWidget );
QScrollView *sv = new QScrollView( m_destWidget );
vb->addWidget( sv, 0, 0 );
sv->setResizePolicy( QScrollView::AutoOneFit );
sv->setFrameStyle( QFrame::NoFrame );
QWidget *container = new QWidget( sv->viewport() );
sv->addChild( container );
QGridLayout *layout = new QGridLayout( container, 2, 3, 2, 4 );
m_destList = new QListBox( container );
QWhatsThis::add( m_destList, tr( "This is a list of all destinations configured for this device. Select one here to edit or delete, or add a new one below." ) );
m_destList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );
connect( m_destList, SIGNAL(highlighted(int)), this, SLOT(slotDestSelected(int)) );
layout->addMultiCellWidget( m_destList, 0, 0, 0, 2 );
- QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container );
+ QPixmap pic;
+ pic.convertFromImage( Resource::loadImage( "new" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
+ QPushButton *btn = new QPushButton( pic, tr( "New" ), container );
QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) );
connect( btn, SIGNAL(clicked()), this, SLOT(slotDestNew()) );
layout->addWidget( btn, 1, 0 );
- m_destEditBtn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), container );
+ pic.convertFromImage( Resource::loadImage( "edit" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
+ m_destEditBtn = new QPushButton( pic, tr( "Edit" ), container );
m_destEditBtn->setEnabled( false );
QWhatsThis::add( m_destEditBtn, tr( "Tap here to edit the entry selected above." ) );
connect( m_destEditBtn, SIGNAL(clicked()), this, SLOT(slotDestEdit()) );
layout->addWidget( m_destEditBtn, 1, 1 );
- m_destDeleteBtn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container );
+ pic.convertFromImage( Resource::loadImage( "trash" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
+ m_destDeleteBtn = new QPushButton( pic, tr( "Delete" ), container );
m_destDeleteBtn->setEnabled( false );
QWhatsThis::add( m_destDeleteBtn, tr( "Tap here to delete the entry selected above." ) );
connect( m_destDeleteBtn, SIGNAL(clicked()), this, SLOT(slotDestDelete()) );
layout->addWidget( m_destDeleteBtn, 1, 2 );
}
void OIpkgConfigDlg::initProxyWidget()
{
m_proxyWidget = new QWidget( this );
// Initialize UI
QVBoxLayout *vb = new QVBoxLayout( m_proxyWidget );
QScrollView *sv = new QScrollView( m_proxyWidget );
vb->addWidget( sv, 0, 0 );
sv->setResizePolicy( QScrollView::AutoOneFit );
sv->setFrameStyle( QFrame::NoFrame );
QWidget *container = new QWidget( sv->viewport() );
sv->addChild( container );
QGridLayout *layout = new QGridLayout( container, 4, 2, 2, 4 );
// HTTP proxy server configuration
QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "HTTP Proxy" ), container );
grpbox->layout()->setSpacing( 2 );
grpbox->layout()->setMargin( 4 );
layout->addMultiCellWidget( grpbox, 0, 0, 0, 1 );
QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() );
m_proxyHttpServer = new QLineEdit( grpbox );
QWhatsThis::add( m_proxyHttpServer, tr( "Enter the URL address of the HTTP proxy server here." ) );
grplayout->addWidget( m_proxyHttpServer );
m_proxyHttpActive = new QCheckBox( tr( "Enabled" ), grpbox );
QWhatsThis::add( m_proxyHttpActive, tr( "Tap here to enable or disable the HTTP proxy server." ) );
grplayout->addWidget( m_proxyHttpActive );
// FTP proxy server configuration
grpbox = new QGroupBox( 0, Qt::Vertical, tr( "FTP Proxy" ), container );
grpbox->layout()->setSpacing( 2 );
grpbox->layout()->setMargin( 4 );
layout->addMultiCellWidget( grpbox, 1, 1, 0, 1 );
grplayout = new QVBoxLayout( grpbox->layout() );
m_proxyFtpServer = new QLineEdit( grpbox );
QWhatsThis::add( m_proxyFtpServer, tr( "Enter the URL address of the FTP proxy server here." ) );
grplayout->addWidget( m_proxyFtpServer );
m_proxyFtpActive = new QCheckBox( tr( "Enabled" ), grpbox );
QWhatsThis::add( m_proxyFtpActive, tr( "Tap here to enable or disable the FTP proxy server." ) );
grplayout->addWidget( m_proxyFtpActive );
// Proxy server username and password configuration
QLabel *label = new QLabel( tr( "Username:" ), container );
@@ -296,97 +304,99 @@ void OIpkgConfigDlg::initOptionsWidget()
{
m_optionsWidget = new QWidget( this );
// Initialize UI
QVBoxLayout *vb = new QVBoxLayout( m_optionsWidget );
QScrollView *sv = new QScrollView( m_optionsWidget );
vb->addWidget( sv, 0, 0 );
sv->setResizePolicy( QScrollView::AutoOneFit );
sv->setFrameStyle( QFrame::NoFrame );
QWidget *container = new QWidget( sv->viewport() );
sv->addChild( container );
QGridLayout *layout = new QGridLayout( container, 8, 2, 2, 4 );
m_optForceDepends = new QCheckBox( tr( "Force Depends" ), container );
QWhatsThis::add( m_optForceDepends, tr( "Tap here to enable or disable the '-force-depends' option for Ipkg." ) );
layout->addMultiCellWidget( m_optForceDepends, 0, 0, 0, 1 );
m_optForceReinstall = new QCheckBox( tr( "Force Reinstall" ), container );
QWhatsThis::add( m_optForceReinstall, tr( "Tap here to enable or disable the '-force-reinstall' option for Ipkg." ) );
layout->addMultiCellWidget( m_optForceReinstall, 1, 1, 0, 1 );
m_optForceRemove = new QCheckBox( tr( "Force Remove" ), container );
QWhatsThis::add( m_optForceRemove, tr( "Tap here to enable or disable the '-force-removal-of-dependent-packages' option for Ipkg." ) );
layout->addMultiCellWidget( m_optForceRemove, 2, 2, 0, 1 );
m_optForceOverwrite = new QCheckBox( tr( "Force Overwrite" ), container );
QWhatsThis::add( m_optForceOverwrite, tr( "Tap here to enable or disable the '-force-overwrite' option for Ipkg." ) );
layout->addMultiCellWidget( m_optForceOverwrite, 3, 3, 0, 1 );
QLabel *l = new QLabel( tr( "Information level:" ), container );
QWhatsThis::add( l, tr( "Select information level for Ipkg." ) );
layout->addMultiCellWidget( l, 4, 4, 0, 1 );
m_optVerboseIpkg = new QComboBox( container );
QWhatsThis::add( m_optVerboseIpkg, tr( "Select information level for Ipkg." ) );
m_optVerboseIpkg->insertItem( tr( "Errors only" ) );
m_optVerboseIpkg->insertItem( tr( "Normal messages" ) );
m_optVerboseIpkg->insertItem( tr( "Informative messages" ) );
m_optVerboseIpkg->insertItem( tr( "Troubleshooting output" ) );
layout->addMultiCellWidget( m_optVerboseIpkg, 5, 5, 0, 1 );
l = new QLabel( tr( "Package source lists directory:" ), container );
QWhatsThis::add( l, tr( "Enter the directory where package source feed information is stored." ) );
layout->addMultiCellWidget( l, 6, 6, 0, 1 );
m_optSourceLists = new QLineEdit( container );
QWhatsThis::add( m_optSourceLists, tr( "Enter the directory where package source feed information is stored." ) );
layout->addWidget( m_optSourceLists, 7, 0 );
- QPushButton *btn = new QPushButton( Resource::loadPixmap( "folder" ), QString::null, container );
+ QPixmap pic;
+ pic.convertFromImage( Resource::loadImage( "folder" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
+ QPushButton *btn = new QPushButton( pic, QString::null, container );
btn->setMaximumWidth( btn->height() );
QWhatsThis::add( btn, tr( "Tap here to select the directory where package source feed information is stored." ) );
connect( btn, SIGNAL(clicked()), this, SLOT(slotOptSelectSourceListsPath()) );
layout->addWidget( btn, 7, 1 );
layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) );
}
void OIpkgConfigDlg::initData()
{
// Read ipkg configuration (server/destination/proxy) information
if ( m_ipkg && !m_installOptions )
{
m_configs = m_ipkg->configItems();
if ( m_configs )
{
for ( OConfItemListIterator configIt( *m_configs ); configIt.current(); ++configIt )
{
OConfItem *config = configIt.current();
// Add configuration item to the appropriate dialog controls
if ( config )
{
switch ( config->type() )
{
case OConfItem::Source : m_serverList->insertItem( config->name() ); break;
case OConfItem::Destination : m_destList->insertItem( config->name() ); break;
case OConfItem::Option :
{
if ( config->name() == "http_proxy" )
{
m_proxyHttpServer->setText( config->value() );
m_proxyHttpActive->setChecked( config->active() );
}
else if ( config->name() == "ftp_proxy" )
{
m_proxyFtpServer->setText( config->value() );
m_proxyFtpActive->setChecked( config->active() );
}
else if ( config->name() == "proxy_username" )
{
m_proxyUsername->setText( config->value() );
}
else if ( config->name() == "proxy_password" )
{
m_proxyPassword->setText( config->value() );
}
}