diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 63a4d8fa2751..95fd567c7c92 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -190,6 +190,7 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : connect(openInfoAction, SIGNAL(triggered()), rpcConsole, SLOT(showInfo())); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(showConsole())); connect(openNetworkAction, SIGNAL(triggered()), rpcConsole, SLOT(showNetwork())); + connect(openConfEditorAction, SIGNAL(triggered()), rpcConsole, SLOT(showConfEditor())); // prevents an oben debug window from becoming stuck/unusable on client shutdown @@ -309,6 +310,8 @@ void BitcoinGUI::createActions(bool fIsTestnet) openRPCConsoleAction->setStatusTip(tr("Open debugging console")); openNetworkAction = new QAction(QIcon(":/icons/connect_4"), tr("&Network Monitor"), this); openNetworkAction->setStatusTip(tr("Show network monitor")); + openConfEditorAction = new QAction(QIcon(":/icons/edit"), tr("Open &Configuration File"), this); + openConfEditorAction->setStatusTip(tr("Open configuration file")); usedSendingAddressesAction = new QAction(QIcon(":/icons/address-book"), tr("&Sending addresses..."), this); usedSendingAddressesAction->setStatusTip(tr("Show the list of used sending addresses and labels")); @@ -386,6 +389,7 @@ void BitcoinGUI::createMenuBar() tools->addAction(openInfoAction); tools->addAction(openRPCConsoleAction); tools->addAction(openNetworkAction); + tools->addAction(openConfEditorAction); } QMenu *help = appMenuBar->addMenu(tr("&Help")); @@ -534,6 +538,7 @@ void BitcoinGUI::createTrayIconMenu() trayIconMenu->addAction(openInfoAction); trayIconMenu->addAction(openRPCConsoleAction); trayIconMenu->addAction(openNetworkAction); + trayIconMenu->addAction(openConfEditorAction); #ifndef Q_OS_MAC // This is built-in on Mac trayIconMenu->addSeparator(); trayIconMenu->addAction(quitAction); diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 1a90d2f41069..b01da9af2d77 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -96,6 +96,7 @@ class BitcoinGUI : public QMainWindow QAction *openInfoAction; QAction *openRPCConsoleAction; QAction *openNetworkAction; + QAction *openConfEditorAction; QAction *openAction; QAction *showHelpMessageAction; diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index a82b503ded3a..5d8e489bd604 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -374,6 +374,15 @@ void openDebugLogfile() QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathDebug))); } +void openConfigfile() +{ + boost::filesystem::path pathConfig = GetConfigFile(); + + /* Open darkcoin.conf with the associated application */ + if (boost::filesystem::exists(pathConfig)) + QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathConfig))); +} + ToolTipToRichTextFilter::ToolTipToRichTextFilter(int size_threshold, QObject *parent) : QObject(parent), size_threshold(size_threshold) { diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index c79c477ff825..4b9381bf21a0 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -103,6 +103,9 @@ namespace GUIUtil // Open debug.log void openDebugLogfile(); + + // Open darkcoin.conf + void openConfigfile(); /** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text representation if needed. This assures that Qt can word-wrap long tooltip messages. diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 5591d4c4a714..9257f71bbbc7 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -517,3 +517,8 @@ void RPCConsole::showNetwork() ui->tabWidget->setCurrentIndex(2); show(); } + +void RPCConsole::showConfEditor() +{ + GUIUtil::openConfigfile(); +} diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 4bac774d6e59..ba715156bda7 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -63,6 +63,8 @@ public slots: void showConsole(); /** Switch to network tab and show */ void showNetwork(); + /** Open external (default) editor with darkcoin.conf */ + void showConfEditor(); signals: // For RPC command executor