aboutsummaryrefslogtreecommitdiff
path: root/src/qt/guiutil.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2017-04-10 10:45:51 +0200
committerJonas Schnelli <dev@jonasschnelli.ch>2017-04-10 10:46:21 +0200
commit1fa4ae67a330c99a09392922f95b5efbea395a1d (patch)
tree44e6f7d55b2577e3004933ef1556d89c73f43c7f /src/qt/guiutil.cpp
parent64962aecb6be1839390c12cf83846acf8e0ea831 (diff)
parent9ab9e7d1b3b4a7eac46b4e4f273c68f4e737e5f7 (diff)
downloadbitcoin-1fa4ae67a330c99a09392922f95b5efbea395a1d.tar.xz
Merge #9890: Add a button to open the config file in a text editor
9ab9e7d Add a button to open the config file in a text editor (Eric Shaw Jr) Tree-SHA512: 1d13be9ac788a05a5116dbb3e1136ef65732dc2b5634547860612658109668922c9ea80b77bde4ba5beaa762d54f2a986a6064d4e34e963cdcd3d126a4eced37
Diffstat (limited to 'src/qt/guiutil.cpp')
-rw-r--r--src/qt/guiutil.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index a2699d374a..cab8295006 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -415,6 +415,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)