From 9ab9e7d1b3b4a7eac46b4e4f273c68f4e737e5f7 Mon Sep 17 00:00:00 2001 From: Eric Shaw Jr Date: Tue, 28 Feb 2017 12:13:34 -0500 Subject: Add a button to open the config file in a text editor --- src/qt/guiutil.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/qt/guiutil.cpp') diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index bb5b2d4347..2c9d2b0013 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -417,6 +417,22 @@ void openDebugLogfile() QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathDebug))); } +bool openBitcoinConf() +{ + boost::filesystem::path pathConfig = GetConfigFile(BITCOIN_CONF_FILENAME); + + /* Create the file */ + boost::filesystem::ofstream configFile(pathConfig, std::ios_base::app); + + if (!configFile.good()) + return false; + + configFile.close(); + + /* Open bitcoin.conf with the associated application */ + return QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathConfig))); +} + void SubstituteFonts(const QString& language) { #if defined(Q_OS_MAC) -- cgit v1.2.3