comparison widgets/PluginParameterDialog.cpp @ 336:4a542ba875c2

* Improvements to layer summary dialog (LayerTree, LayerTreeDialog), & rename. It's still rather unstable though.
author Chris Cannam
date Wed, 28 Nov 2007 17:45:37 +0000
parents b7d45fed8146
children e1a9e478b7f2
comparison
equal deleted inserted replaced
335:2f83b6e3b8ca 336:4a542ba875c2
438 438
439 setAdvancedVisible(m_advancedVisible); 439 setAdvancedVisible(m_advancedVisible);
440 } 440 }
441 441
442 void 442 void
443 PluginParameterDialog::setCandidateInputModels(const QStringList &models) 443 PluginParameterDialog::setCandidateInputModels(const QStringList &models,
444 QString defaultModel)
444 { 445 {
445 m_inputModels->clear(); 446 m_inputModels->clear();
446 447
447 QSettings settings; 448 QSettings settings;
448 settings.beginGroup("PluginParameterDialog"); 449 settings.beginGroup("PluginParameterDialog");
449 QString lastModel = settings.value("lastinputmodel").toString(); 450 QString lastModel = settings.value("lastinputmodel").toString();
450 settings.endGroup(); 451 settings.endGroup();
451 452
453 if (defaultModel == "") defaultModel = lastModel;
454
452 m_inputModels->show(); 455 m_inputModels->show();
453 456
454 m_inputModelList = models; 457 m_inputModelList = models;
455 m_inputModels->addItems(TextAbbrev::abbreviate(models, 80)); 458 m_inputModels->addItems(TextAbbrev::abbreviate(models, 80));
456 m_inputModels->setCurrentIndex(0); 459 m_inputModels->setCurrentIndex(0);
457 460
458 if (lastModel != "") { 461 if (defaultModel != "") {
459 for (int i = 0; i < models.size(); ++i) { 462 for (int i = 0; i < models.size(); ++i) {
460 if (lastModel == models[i]) { 463 if (defaultModel == models[i]) {
461 m_inputModels->setCurrentIndex(i); 464 m_inputModels->setCurrentIndex(i);
462 m_currentInputModel = models[i]; 465 m_currentInputModel = models[i];
463 break; 466 break;
464 } 467 }
465 } 468 }