comparison 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
comparison
equal deleted inserted replaced
78:07405f3a428b 79:aaeabc920ca8
200 } 200 }
201 201
202 void 202 void
203 MultiChoiceDialog::urlChanged(const QString &s) 203 MultiChoiceDialog::urlChanged(const QString &s)
204 { 204 {
205 /* This doesn't work well
205 if (m_argTypes[m_currentChoice] != UrlToDirectoryArg) { 206 if (m_argTypes[m_currentChoice] != UrlToDirectoryArg) {
206 return; 207 return;
207 } 208 }
208 QDir dirPath(m_fileCombo->currentText()); 209 QDir dirPath(m_fileCombo->currentText());
209 if (!dirPath.exists()) { 210 if (!dirPath.exists()) {
212 QString url = m_urlCombo->currentText(); 213 QString url = m_urlCombo->currentText();
213 if (QRegExp("^\\w+://").indexIn(url) < 0) { 214 if (QRegExp("^\\w+://").indexIn(url) < 0) {
214 return; 215 return;
215 } 216 }
216 QString urlDirName = url; 217 QString urlDirName = url;
217 urlDirName.replace(QRegExp("^.*//.*/"), ""); 218 urlDirName.replace(QRegExp("^.*\\//.*\\/"), "");
218 if (urlDirName == "" || urlDirName == url) { 219 if (urlDirName == "" || urlDirName == url) {
219 return; 220 return;
220 } 221 }
221 m_fileCombo->lineEdit()->setText(dirPath.filePath(urlDirName)); 222 m_fileCombo->lineEdit()->setText(dirPath.filePath(urlDirName));
223 */
224 if (m_argTypes[m_currentChoice] == UrlToDirectoryArg) {
225 m_okButton->setEnabled(getArgument() != "" &&
226 getAdditionalArgument() != "");
227 } else {
228 m_okButton->setEnabled(getArgument() != "");
229 }
222 } 230 }
223 231
224 void 232 void
225 MultiChoiceDialog::fileChanged(const QString &s) 233 MultiChoiceDialog::fileChanged(const QString &s)
226 { 234 {