diff multichoicedialog.cpp @ 79:aaeabc920ca8

* Some work toward doing the Right Thing with each possible combination of existing/nonexisting directories in Open dialog
author Chris Cannam
date Mon, 22 Nov 2010 12:30:40 +0000
parents 10eb97683aa9
children 01580704de3e
line wrap: on
line diff
--- a/multichoicedialog.cpp	Mon Nov 22 10:03:15 2010 +0000
+++ b/multichoicedialog.cpp	Mon Nov 22 12:30:40 2010 +0000
@@ -202,6 +202,7 @@
 void
 MultiChoiceDialog::urlChanged(const QString &s)
 {
+/* This doesn't work well
     if (m_argTypes[m_currentChoice] != UrlToDirectoryArg) {
         return;
     }
@@ -214,11 +215,18 @@
         return;
     }
     QString urlDirName = url;
-    urlDirName.replace(QRegExp("^.*//.*/"), "");
+    urlDirName.replace(QRegExp("^.*\\//.*\\/"), "");
     if (urlDirName == "" || urlDirName == url) {
         return;
     }
     m_fileCombo->lineEdit()->setText(dirPath.filePath(urlDirName));
+*/
+    if (m_argTypes[m_currentChoice] == UrlToDirectoryArg) {
+        m_okButton->setEnabled(getArgument() != "" &&
+                               getAdditionalArgument() != "");
+    } else {
+        m_okButton->setEnabled(getArgument() != "");
+    }
 }
 
 void