summaryrefslogtreecommitdiff
authordrw <drw>2005-03-03 19:15:30 (UTC)
committer drw <drw>2005-03-03 19:15:30 (UTC)
commit9c55e475ed3170488dd37ce8f36fa909397997bb (patch) (unidiff)
treef1fad490bc0d56059f8c26cfdf9002a831158a7c
parentadb8960dfcdb18b698f313fc7e7d40209c65b01a (diff)
downloadopie-9c55e475ed3170488dd37ce8f36fa909397997bb.zip
opie-9c55e475ed3170488dd37ce8f36fa909397997bb.tar.gz
opie-9c55e475ed3170488dd37ce8f36fa909397997bb.tar.bz2
Scale icons appropriately
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/installdlg.cpp34
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.cpp24
2 files changed, 39 insertions, 19 deletions
diff --git a/noncore/settings/packagemanager/installdlg.cpp b/noncore/settings/packagemanager/installdlg.cpp
index 7dea591..36851b0 100644
--- a/noncore/settings/packagemanager/installdlg.cpp
+++ b/noncore/settings/packagemanager/installdlg.cpp
@@ -63,31 +63,31 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap
63 // Save command/package list information 63 // Save command/package list information
64 if ( command1 != OPackage::NotDefined ) 64 if ( command1 != OPackage::NotDefined )
65 { 65 {
66 m_command[ m_numCommands ] = command1; 66 m_command[ m_numCommands ] = command1;
67 m_packages[ m_numCommands ] = packages1; 67 m_packages[ m_numCommands ] = packages1;
68 ++m_numCommands; 68 ++m_numCommands;
69 69
70 if ( command1 == OPackage::Install ) 70 if ( command1 == OPackage::Install )
71 m_installFound = true; 71 m_installFound = true;
72 } 72 }
73 if ( command2 != OPackage::NotDefined ) 73 if ( command2 != OPackage::NotDefined )
74 { 74 {
75 m_command[ m_numCommands ] = command2; 75 m_command[ m_numCommands ] = command2;
76 m_packages[ m_numCommands ] = packages2; 76 m_packages[ m_numCommands ] = packages2;
77 ++m_numCommands; 77 ++m_numCommands;
78 78
79 if ( command2 == OPackage::Install ) 79 if ( command2 == OPackage::Install )
80 m_installFound = true; 80 m_installFound = true;
81 } 81 }
82 if ( command3 != OPackage::NotDefined ) 82 if ( command3 != OPackage::NotDefined )
83 { 83 {
84 m_command[ m_numCommands ] = command3; 84 m_command[ m_numCommands ] = command3;
85 m_packages[ m_numCommands ] = packages3; 85 m_packages[ m_numCommands ] = packages3;
86 ++m_numCommands; 86 ++m_numCommands;
87 87
88 if ( command3 == OPackage::Install ) 88 if ( command3 == OPackage::Install )
89 m_installFound = true; 89 m_installFound = true;
90 } 90 }
91 91
92 // Initialize UI 92 // Initialize UI
93 if ( parent ) 93 if ( parent )
@@ -126,17 +126,20 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap
126 QVBoxLayout *groupBoxLayout = new QVBoxLayout( groupBox->layout() ); 126 QVBoxLayout *groupBoxLayout = new QVBoxLayout( groupBox->layout() );
127 m_output = new QMultiLineEdit( groupBox ); 127 m_output = new QMultiLineEdit( groupBox );
128 m_output->setReadOnly( true ); 128 m_output->setReadOnly( true );
129 groupBoxLayout->addWidget( m_output ); 129 groupBoxLayout->addWidget( m_output );
130 layout->addMultiCellWidget( groupBox, 2, 2, 0, 1 ); 130 layout->addMultiCellWidget( groupBox, 2, 2, 0, 1 );
131 131
132 m_btnStart = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ), tr( "Start" ), this ); 132 QPixmap pic;
133 pic.convertFromImage( Resource::loadImage( "packagemanager/apply" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
134 m_btnStart = new QPushButton( pic, tr( "Start" ), this );
133 layout->addWidget( m_btnStart, 3, 0 ); 135 layout->addWidget( m_btnStart, 3, 0 );
134 connect( m_btnStart, SIGNAL(clicked()), this, SLOT(slotBtnStart()) ); 136 connect( m_btnStart, SIGNAL(clicked()), this, SLOT(slotBtnStart()) );
135 137
136 m_btnOptions = new QPushButton( Resource::loadPixmap( "SettingsIcon" ), tr( "Options" ), this ); 138 pic.convertFromImage( Resource::loadImage( "SettingsIcon" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
139 m_btnOptions = new QPushButton( pic, tr( "Options" ), this );
137 layout->addWidget( m_btnOptions, 3, 1 ); 140 layout->addWidget( m_btnOptions, 3, 1 );
138 connect( m_btnOptions, SIGNAL( clicked() ), this, SLOT(slotBtnOptions()) ); 141 connect( m_btnOptions, SIGNAL( clicked() ), this, SLOT(slotBtnOptions()) );
139 142
140 // Display packages being acted upon in output widget 143 // Display packages being acted upon in output widget
141 for( int i = 0; i < m_numCommands; i++ ) 144 for( int i = 0; i < m_numCommands; i++ )
142 { 145 {
@@ -214,13 +217,15 @@ void InstallDlg::slotBtnStart()
214 { 217 {
215 // Prevent unexecuted commands from executing 218 // Prevent unexecuted commands from executing
216 m_currCommand = 999; 219 m_currCommand = 999;
217 220
218 // Allow user to close dialog 221 // Allow user to close dialog
219 m_btnStart->setText( tr( "Close" ) ); 222 m_btnStart->setText( tr( "Close" ) );
220 m_btnStart->setIconSet( Resource::loadPixmap( "enter" ) ); 223 QPixmap pic;
224 pic.convertFromImage( Resource::loadImage( "enter" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
225 m_btnStart->setIconSet( pic );
221 return; 226 return;
222 } 227 }
223 else if ( btnText == tr( "Close" ) ) 228 else if ( btnText == tr( "Close" ) )
224 { 229 {
225 // TODO - force reload of package data 230 // TODO - force reload of package data
226 emit closeInstallDlg(); 231 emit closeInstallDlg();
@@ -231,39 +236,44 @@ void InstallDlg::slotBtnStart()
231 QString dest; 236 QString dest;
232 if ( m_installFound ) 237 if ( m_installFound )
233 { 238 {
234 dest = m_destination->currentText(); 239 dest = m_destination->currentText();
235 m_destination->setEnabled( false ); 240 m_destination->setEnabled( false );
236 } 241 }
237 242
238 m_btnOptions->setEnabled( false ); 243 m_btnOptions->setEnabled( false );
239 if ( m_numCommands > 1 ) 244 if ( m_numCommands > 1 )
240 { 245 {
241 m_btnStart->setText( tr( "Abort" ) ); 246 m_btnStart->setText( tr( "Abort" ) );
242 m_btnStart->setIconSet( Resource::loadPixmap( "close" ) ); 247 QPixmap pic;
248 pic.convertFromImage( Resource::loadImage( "close" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
249 m_btnStart->setIconSet( pic );
243 } 250 }
244 else 251 else
245 { 252 {
246 m_btnStart->setEnabled( false ); 253 m_btnStart->setEnabled( false );
247 } 254 }
248 255
249 for ( m_currCommand = 0; m_currCommand < m_numCommands; m_currCommand++ ) 256 for ( m_currCommand = 0; m_currCommand < m_numCommands; m_currCommand++ )
250 { 257 {
251 // Execute next command 258 // Execute next command
252 m_packman->executeCommand( m_command[ m_currCommand ], m_packages[ m_currCommand ], dest, 259 m_packman->executeCommand( m_command[ m_currCommand ], m_packages[ m_currCommand ], dest,
253 this, SLOT(slotOutput(const QString &)), true ); 260 this, SLOT(slotOutput(const QString &)), true );
254 } 261 }
255 262
256 // All commands executed, allow user to close dialog 263 // All commands executed, allow user to close dialog
257 m_btnStart->setEnabled( true ); 264 m_btnStart->setEnabled( true );
258 m_btnStart->setText( tr( "Close" ) ); 265 m_btnStart->setText( tr( "Close" ) );
259 m_btnStart->setIconSet( Resource::loadPixmap( "enter" ) ); 266 QPixmap pic;
267 pic.convertFromImage( Resource::loadImage( "enter" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
268 m_btnStart->setIconSet( pic );
260 269
261 m_btnOptions->setEnabled( true ); 270 m_btnOptions->setEnabled( true );
262 m_btnOptions->setText( tr( "Save output" ) ); 271 m_btnOptions->setText( tr( "Save output" ) );
263 m_btnOptions->setIconSet( Resource::loadPixmap( "save" ) ); 272 pic.convertFromImage( Resource::loadImage( "save" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
273 m_btnOptions->setIconSet( pic );
264} 274}
265 275
266void InstallDlg::slotBtnOptions() 276void InstallDlg::slotBtnOptions()
267{ 277{
268 QString btnText = m_btnOptions->text(); 278 QString btnText = m_btnOptions->text();
269 if ( btnText == tr( "Options" ) ) 279 if ( btnText == tr( "Options" ) )
@@ -302,10 +312,10 @@ void InstallDlg::slotOutput( const QString &msg )
302 312
303 QString lineStr = msg; 313 QString lineStr = msg;
304 if ( lineStr[lineStr.length()-1] == '\n' ) 314 if ( lineStr[lineStr.length()-1] == '\n' )
305 lineStr.truncate( lineStr.length() - 1 ); 315 lineStr.truncate( lineStr.length() - 1 );
306 m_output->append( lineStr ); 316 m_output->append( lineStr );
307 m_output->setCursorPosition( m_output->numLines(), 0 ); 317 m_output->setCursorPosition( m_output->numLines(), 0 );
308 318
309 // Update available space 319 // Update available space
310 slotDisplayAvailSpace( QString::null ); 320 slotDisplayAvailSpace( QString::null );
311} 321}
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
@@ -177,24 +177,28 @@ void OIpkgConfigDlg::initServerWidget()
177 m_serverList = new QListBox( container ); 177 m_serverList = new QListBox( container );
178 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." ) ); 178 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." ) );
179 m_serverList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); 179 m_serverList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );
180 connect( m_serverList, SIGNAL(highlighted(int)), this, SLOT(slotServerSelected(int)) ); 180 connect( m_serverList, SIGNAL(highlighted(int)), this, SLOT(slotServerSelected(int)) );
181 layout->addMultiCellWidget( m_serverList, 0, 0, 0, 2 ); 181 layout->addMultiCellWidget( m_serverList, 0, 0, 0, 2 );
182 182
183 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); 183 QPixmap pic;
184 pic.convertFromImage( Resource::loadImage( "new" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
185 QPushButton *btn = new QPushButton( pic, tr( "New" ), container );
184 QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) ); 186 QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) );
185 connect( btn, SIGNAL(clicked()), this, SLOT(slotServerNew()) ); 187 connect( btn, SIGNAL(clicked()), this, SLOT(slotServerNew()) );
186 layout->addWidget( btn, 1, 0 ); 188 layout->addWidget( btn, 1, 0 );
187 189
188 m_serverEditBtn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), container ); 190 pic.convertFromImage( Resource::loadImage( "edit" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
191 m_serverEditBtn = new QPushButton( pic, tr( "Edit" ), container );
189 m_serverEditBtn->setEnabled( false ); 192 m_serverEditBtn->setEnabled( false );
190 QWhatsThis::add( m_serverEditBtn, tr( "Tap here to edit the entry selected above." ) ); 193 QWhatsThis::add( m_serverEditBtn, tr( "Tap here to edit the entry selected above." ) );
191 connect( m_serverEditBtn, SIGNAL(clicked()), this, SLOT(slotServerEdit()) ); 194 connect( m_serverEditBtn, SIGNAL(clicked()), this, SLOT(slotServerEdit()) );
192 layout->addWidget( m_serverEditBtn, 1, 1 ); 195 layout->addWidget( m_serverEditBtn, 1, 1 );
193 196
194 m_serverDeleteBtn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); 197 pic.convertFromImage( Resource::loadImage( "trash" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
198 m_serverDeleteBtn = new QPushButton( pic, tr( "Delete" ), container );
195 m_serverDeleteBtn->setEnabled( false ); 199 m_serverDeleteBtn->setEnabled( false );
196 QWhatsThis::add( m_serverDeleteBtn, tr( "Tap here to delete the entry selected above." ) ); 200 QWhatsThis::add( m_serverDeleteBtn, tr( "Tap here to delete the entry selected above." ) );
197 connect( m_serverDeleteBtn, SIGNAL(clicked()), this, SLOT(slotServerDelete()) ); 201 connect( m_serverDeleteBtn, SIGNAL(clicked()), this, SLOT(slotServerDelete()) );
198 layout->addWidget( m_serverDeleteBtn, 1, 2 ); 202 layout->addWidget( m_serverDeleteBtn, 1, 2 );
199} 203}
200 204
@@ -215,24 +219,28 @@ void OIpkgConfigDlg::initDestinationWidget()
215 m_destList = new QListBox( container ); 219 m_destList = new QListBox( container );
216 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." ) ); 220 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." ) );
217 m_destList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); 221 m_destList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );
218 connect( m_destList, SIGNAL(highlighted(int)), this, SLOT(slotDestSelected(int)) ); 222 connect( m_destList, SIGNAL(highlighted(int)), this, SLOT(slotDestSelected(int)) );
219 layout->addMultiCellWidget( m_destList, 0, 0, 0, 2 ); 223 layout->addMultiCellWidget( m_destList, 0, 0, 0, 2 );
220 224
221 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); 225 QPixmap pic;
226 pic.convertFromImage( Resource::loadImage( "new" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
227 QPushButton *btn = new QPushButton( pic, tr( "New" ), container );
222 QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) ); 228 QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) );
223 connect( btn, SIGNAL(clicked()), this, SLOT(slotDestNew()) ); 229 connect( btn, SIGNAL(clicked()), this, SLOT(slotDestNew()) );
224 layout->addWidget( btn, 1, 0 ); 230 layout->addWidget( btn, 1, 0 );
225 231
226 m_destEditBtn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), container ); 232 pic.convertFromImage( Resource::loadImage( "edit" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
233 m_destEditBtn = new QPushButton( pic, tr( "Edit" ), container );
227 m_destEditBtn->setEnabled( false ); 234 m_destEditBtn->setEnabled( false );
228 QWhatsThis::add( m_destEditBtn, tr( "Tap here to edit the entry selected above." ) ); 235 QWhatsThis::add( m_destEditBtn, tr( "Tap here to edit the entry selected above." ) );
229 connect( m_destEditBtn, SIGNAL(clicked()), this, SLOT(slotDestEdit()) ); 236 connect( m_destEditBtn, SIGNAL(clicked()), this, SLOT(slotDestEdit()) );
230 layout->addWidget( m_destEditBtn, 1, 1 ); 237 layout->addWidget( m_destEditBtn, 1, 1 );
231 238
232 m_destDeleteBtn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); 239 pic.convertFromImage( Resource::loadImage( "trash" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
240 m_destDeleteBtn = new QPushButton( pic, tr( "Delete" ), container );
233 m_destDeleteBtn->setEnabled( false ); 241 m_destDeleteBtn->setEnabled( false );
234 QWhatsThis::add( m_destDeleteBtn, tr( "Tap here to delete the entry selected above." ) ); 242 QWhatsThis::add( m_destDeleteBtn, tr( "Tap here to delete the entry selected above." ) );
235 connect( m_destDeleteBtn, SIGNAL(clicked()), this, SLOT(slotDestDelete()) ); 243 connect( m_destDeleteBtn, SIGNAL(clicked()), this, SLOT(slotDestDelete()) );
236 layout->addWidget( m_destDeleteBtn, 1, 2 ); 244 layout->addWidget( m_destDeleteBtn, 1, 2 );
237} 245}
238 246
@@ -338,13 +346,15 @@ void OIpkgConfigDlg::initOptionsWidget()
338 QWhatsThis::add( l, tr( "Enter the directory where package source feed information is stored." ) ); 346 QWhatsThis::add( l, tr( "Enter the directory where package source feed information is stored." ) );
339 layout->addMultiCellWidget( l, 6, 6, 0, 1 ); 347 layout->addMultiCellWidget( l, 6, 6, 0, 1 );
340 348
341 m_optSourceLists = new QLineEdit( container ); 349 m_optSourceLists = new QLineEdit( container );
342 QWhatsThis::add( m_optSourceLists, tr( "Enter the directory where package source feed information is stored." ) ); 350 QWhatsThis::add( m_optSourceLists, tr( "Enter the directory where package source feed information is stored." ) );
343 layout->addWidget( m_optSourceLists, 7, 0 ); 351 layout->addWidget( m_optSourceLists, 7, 0 );
344 QPushButton *btn = new QPushButton( Resource::loadPixmap( "folder" ), QString::null, container ); 352 QPixmap pic;
353 pic.convertFromImage( Resource::loadImage( "folder" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
354 QPushButton *btn = new QPushButton( pic, QString::null, container );
345 btn->setMaximumWidth( btn->height() ); 355 btn->setMaximumWidth( btn->height() );
346 QWhatsThis::add( btn, tr( "Tap here to select the directory where package source feed information is stored." ) ); 356 QWhatsThis::add( btn, tr( "Tap here to select the directory where package source feed information is stored." ) );
347 connect( btn, SIGNAL(clicked()), this, SLOT(slotOptSelectSourceListsPath()) ); 357 connect( btn, SIGNAL(clicked()), this, SLOT(slotOptSelectSourceListsPath()) );
348 layout->addWidget( btn, 7, 1 ); 358 layout->addWidget( btn, 7, 1 );
349 359
350 layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); 360 layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) );