comparison src/multichoicedialog.cpp @ 619:4f7ca2d192df

Merge
author Chris Cannam
date Tue, 03 Jul 2012 20:10:04 +0100
parents 98f57888d893
children ae67ea0af696
comparison
equal deleted inserted replaced
618:54ca6a0e9aef 619:4f7ca2d192df
273 } else { 273 } else {
274 m_okButton->setEnabled(getArgument() != ""); 274 m_okButton->setEnabled(getArgument() != "");
275 } 275 }
276 } 276 }
277 277
278 bool
279 MultiChoiceDialog::urlComboNotUrl() const
280 {
281 QString url = m_urlCombo->currentText();
282 if (QRegExp("^\\w+://").indexIn(url) < 0) {
283 return true;
284 } else {
285 return false;
286 }
287 }
288
278 void 289 void
279 MultiChoiceDialog::choiceChanged() 290 MultiChoiceDialog::choiceChanged()
280 { 291 {
281 DEBUG << "choiceChanged" << endl; 292 DEBUG << "choiceChanged" << endl;
282 293
345 356
346 case UrlArg: 357 case UrlArg:
347 m_urlLabel->show(); 358 m_urlLabel->show();
348 m_urlCombo->show(); 359 m_urlCombo->show();
349 m_urlCombo->addItems(rf->getRecent()); 360 m_urlCombo->addItems(rf->getRecent());
350 if (m_defaultEmpty[id]) m_urlCombo->lineEdit()->setText(""); 361 if (m_defaultEmpty[id] || urlComboNotUrl()) {
362 m_urlCombo->lineEdit()->setText("");
363 }
351 break; 364 break;
352 365
353 case UrlToDirectoryArg: 366 case UrlToDirectoryArg:
354 m_urlLabel->show(); 367 m_urlLabel->show();
355 m_urlCombo->show(); 368 m_urlCombo->show();
356 m_urlCombo->addItems(rf->getRecent()); 369 m_urlCombo->addItems(rf->getRecent());
357 if (m_defaultEmpty[id]) m_urlCombo->lineEdit()->setText(""); 370 if (m_defaultEmpty[id] || urlComboNotUrl()) {
371 m_urlCombo->lineEdit()->setText("");
372 }
358 m_fileLabel->setText(tr("&Folder:")); 373 m_fileLabel->setText(tr("&Folder:"));
359 m_fileLabel->show(); 374 m_fileLabel->show();
360 m_fileCombo->show(); 375 m_fileCombo->show();
361 m_fileCombo->lineEdit()->setText(getDefaultPath()); 376 m_fileCombo->lineEdit()->setText(getDefaultPath());
362 updateFileComboFromURL(); 377 updateFileComboFromURL();