Showing the changes to interface/src/ImportDialog.cpp (1 of 2 files). Show all
Unified · Split
| @@ -97,7 +97,8 @@ QString HiFiIconProvider::type(const QFileInfo &info) const { · 96 unmodified lines | ||
| 97 | 97 | ImportDialog::ImportDialog(QWidget* parent) : |
| 98 | 98 | QFileDialog(parent, WINDOW_NAME, DESKTOP_LOCATION, NULL), |
| 99 | 99 | _importButton(IMPORT_BUTTON_NAME, this), |
| 100 | − _cancelButton(CANCEL_BUTTON_NAME, this) { | |
| 100 | + _cancelButton(CANCEL_BUTTON_NAME, this), | |
| 101 | + fileAccepted(false) { | |
| 101 | 102 | |
| 102 | 103 | setOption(QFileDialog::DontUseNativeDialog, true); |
| 103 | 104 | setFileMode(QFileDialog::ExistingFile); |
| @@ -131,11 +132,17 @@ ImportDialog::~ImportDialog() { · 27 unmodified lines | ||
| 131 | 132 | } |
| 132 | 133 | |
| 133 | 134 | void ImportDialog::import() { |
| 135 | + fileAccepted = true; | |
| 134 | 136 | emit accepted(); |
| 135 | 137 | } |
| 136 | 138 | |
| 137 | 139 | void ImportDialog::accept() { |
| 138 | − QFileDialog::accept(); | |
| 140 | + if (!fileAccepted) { | |
| 141 | + fileAccepted = true; | |
| 142 | + emit accepted(); | |
| 143 | + } else { | |
| 144 | + QFileDialog::accept(); | |
| 145 | + } | |
| 139 | 146 | } |
| 140 | 147 | |
| 141 | 148 | void ImportDialog::reject() { |