-rw-r--r-- | noncore/settings/tabmanager/tabmanager.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/noncore/settings/tabmanager/tabmanager.cpp b/noncore/settings/tabmanager/tabmanager.cpp index 5f0899c..c9d7aed 100644 --- a/noncore/settings/tabmanager/tabmanager.cpp +++ b/noncore/settings/tabmanager/tabmanager.cpp | |||
@@ -268,48 +268,51 @@ void TabManager::editItem( QListViewItem * item){ | |||
268 | if(fileName.right(4) == ".png"){ | 268 | if(fileName.right(4) == ".png"){ |
269 | fileName = fileName.mid(0,fileName.length()-4); | 269 | fileName = fileName.mid(0,fileName.length()-4); |
270 | QPixmap imageOfFile(Resource::loadPixmap(fileName)); | 270 | QPixmap imageOfFile(Resource::loadPixmap(fileName)); |
271 | QImage foo = imageOfFile.convertToImage(); | 271 | QImage foo = imageOfFile.convertToImage(); |
272 | foo = foo.smoothScale(16,16); | 272 | foo = foo.smoothScale(16,16); |
273 | imageOfFile.convertFromImage(foo); | 273 | imageOfFile.convertFromImage(foo); |
274 | application->iconLineEdit->insertItem(imageOfFile,fileName); | 274 | application->iconLineEdit->insertItem(imageOfFile,fileName); |
275 | } | 275 | } |
276 | //qDebug(fi->fileName().latin1()); | 276 | //qDebug(fi->fileName().latin1()); |
277 | ++it; | 277 | ++it; |
278 | } | 278 | } |
279 | waitDialog.hide(); | 279 | waitDialog.hide(); |
280 | } | 280 | } |
281 | int pixmap = -1; | 281 | int pixmap = -1; |
282 | QString pixmapText = app.pixmapString(); | 282 | QString pixmapText = app.pixmapString(); |
283 | QComboBox *f = application->iconLineEdit; | 283 | QComboBox *f = application->iconLineEdit; |
284 | for(int i = 0; i < application->iconLineEdit->count(); i++){ | 284 | for(int i = 0; i < application->iconLineEdit->count(); i++){ |
285 | if(f->text(i) == pixmapText){ | 285 | if(f->text(i) == pixmapText){ |
286 | pixmap = i; | 286 | pixmap = i; |
287 | break; | 287 | break; |
288 | } | 288 | } |
289 | } | 289 | } |
290 | if(pixmap != -1) | 290 | if(pixmap != -1) |
291 | application->iconLineEdit->setCurrentItem(pixmap); | 291 | application->iconLineEdit->setCurrentItem(pixmap); |
292 | else if(pixmapText.isEmpty()){ | ||
293 | application->iconLineEdit->setCurrentItem(0); | ||
294 | } | ||
292 | else{ | 295 | else{ |
293 | QPixmap imageOfFile(Resource::loadPixmap(pixmapText)); | 296 | QPixmap imageOfFile(Resource::loadPixmap(pixmapText)); |
294 | QImage foo = imageOfFile.convertToImage(); | 297 | QImage foo = imageOfFile.convertToImage(); |
295 | foo = foo.smoothScale(16,16); | 298 | foo = foo.smoothScale(16,16); |
296 | imageOfFile.convertFromImage(foo); | 299 | imageOfFile.convertFromImage(foo); |
297 | application->iconLineEdit->insertItem(imageOfFile,pixmapText,0); | 300 | application->iconLineEdit->insertItem(imageOfFile,pixmapText,0); |
298 | application->iconLineEdit->setCurrentItem(0); | 301 | application->iconLineEdit->setCurrentItem(0); |
299 | } | 302 | } |
300 | 303 | ||
301 | application->nameLineEdit->setText(app.name()); | 304 | application->nameLineEdit->setText(app.name()); |
302 | application->execLineEdit->setText(app.exec()); | 305 | application->execLineEdit->setText(app.exec()); |
303 | application->commentLineEdit->setText(app.comment()); | 306 | application->commentLineEdit->setText(app.comment()); |
304 | 307 | ||
305 | if(item->parent() == NULL){ | 308 | if(item->parent() == NULL){ |
306 | application->execLineEdit->setEnabled(false); | 309 | application->execLineEdit->setEnabled(false); |
307 | application->TextLabel3->setEnabled(false); | 310 | application->TextLabel3->setEnabled(false); |
308 | application->setCaption(tr("Tab")); | 311 | application->setCaption(tr("Tab")); |
309 | } | 312 | } |
310 | else{ | 313 | else{ |
311 | application->execLineEdit->setEnabled(true); | 314 | application->execLineEdit->setEnabled(true); |
312 | application->TextLabel3->setEnabled(true); | 315 | application->TextLabel3->setEnabled(true); |
313 | application->setCaption(tr("Application")); | 316 | application->setCaption(tr("Application")); |
314 | } | 317 | } |
315 | 318 | ||