diff src/multichoicedialog.cpp @ 553:9c8147c9f245

Fix #354, Remote repo URL should be cleared when starting a new local project
author Chris Cannam
date Fri, 17 Feb 2012 10:58:41 +0000
parents a582c6417004
children 533519ebc0cb
line wrap: on
line diff
--- a/src/multichoicedialog.cpp	Thu Feb 16 14:30:46 2012 +0000
+++ b/src/multichoicedialog.cpp	Fri Feb 17 10:58:41 2012 +0000
@@ -136,13 +136,15 @@
 
 void
 MultiChoiceDialog::addChoice(QString id, QString text,
-                             QString description, ArgType arg)
+                             QString description, ArgType arg,
+                             bool defaultEmpty)
 {
     bool first = (m_texts.empty());
 
     m_texts[id] = text;
     m_descriptions[id] = description;
     m_argTypes[id] = arg;
+    m_defaultEmpty[id] = defaultEmpty;
     
     if (arg != NoArg) {
         m_recentFiles[id] = QSharedPointer<RecentFiles>
@@ -326,6 +328,7 @@
         m_fileLabel->show();
         m_fileCombo->show();
         m_fileCombo->addItems(rf->getRecent());
+        if (m_defaultEmpty[id]) m_fileCombo->lineEdit()->setText("");
         m_browseButton->show();
         break;
 
@@ -334,6 +337,7 @@
         m_fileLabel->show();
         m_fileCombo->show();
         m_fileCombo->addItems(rf->getRecent());
+        if (m_defaultEmpty[id]) m_fileCombo->lineEdit()->setText("");
         m_browseButton->show();
         break;
 
@@ -341,12 +345,14 @@
         m_urlLabel->show();
         m_urlCombo->show();
         m_urlCombo->addItems(rf->getRecent());
+        if (m_defaultEmpty[id]) m_urlCombo->lineEdit()->setText("");
         break;
 
     case UrlToDirectoryArg:
         m_urlLabel->show();
         m_urlCombo->show();
         m_urlCombo->addItems(rf->getRecent());
+        if (m_defaultEmpty[id]) m_urlCombo->lineEdit()->setText("");
         m_fileLabel->setText(tr("&Folder:"));
         m_fileLabel->show();
         m_fileCombo->show();