Skip to content

Commit 642fec4

Browse files
committed
Implement model error dialog box for open config file failure
Also corrects unused variable warning on Linux compilation
1 parent 3feeb9b commit 642fec4

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/qt/bitcoingui.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -748,18 +748,24 @@ void BitcoinGUI::openConfigClicked()
748748
boost::filesystem::path pathConfig = GetConfigFile();
749749
/* Open gridcoinresearch.conf with the associated application */
750750
bool res = QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromStdString(pathConfig.string())));
751-
#ifdef Q_OS_WIN
751+
752+
#ifdef Q_OS_WIN
752753
// Workaround for windows specific behaviour
753754
if(!res) {
754755
res = QProcess::startDetached("C:\\Windows\\system32\\notepad.exe", QStringList{QString::fromStdString(pathConfig.string())});
755756
}
756-
#endif
757-
#ifdef Q_OS_MAC
757+
#endif
758+
#ifdef Q_OS_MAC
758759
// Workaround for macOS-specific behaviour; see https://github.com/bitcoin/bitcoin/issues/15409
759760
if (!res) {
760761
res = QProcess::startDetached("/usr/bin/open", QStringList{"-t", QString::fromStdString(pathConfig.string())});
761762
}
762-
#endif
763+
#endif
764+
765+
if (!res) {
766+
error("File Association Error", "Unable to open the config file. Please check your operating system"
767+
" file associations.", true);
768+
}
763769
}
764770

765771
void BitcoinGUI::researcherClicked()

0 commit comments

Comments
 (0)