| 57 | } |
| 58 | |
| 59 | void ApplicationDialog::browse() |
| 60 | { |
| 61 | QString filter; |
| 62 | #ifdef Q_OS_WIN |
| 63 | // In Windows (almost) all executables have .exe extension |
| 64 | // so it does not make sense to show everything. |
| 65 | filter += tr("Executable files (*.exe);;All files(*.*)"); |
| 66 | #endif // Q_OS_WIN |
| 67 | QString selectedFile = QFileDialog::getOpenFileName(this, |
| 68 | tr("Select viewer application"), |
| 69 | getPath(SETTINGS_LAST_APP_PATH), |
| 70 | filter); |
| 71 | |
| 72 | if (!selectedFile.isEmpty()) { |
| 73 | setPath(SETTINGS_LAST_APP_PATH, selectedFile); |
| 74 | QString path(QDir::toNativeSeparators(selectedFile)); |
| 75 | mUI->mPath->setText(path); |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | void ApplicationDialog::ok() |
| 80 | { |