diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 9bc5ef10ad48..489f9f52b522 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -222,6 +222,7 @@ BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) : connect(openPeersAction, SIGNAL(triggered()), rpcConsole, SLOT(showPeers())); connect(openRepairAction, SIGNAL(triggered()), rpcConsole, SLOT(showRepair())); connect(openConfEditorAction, SIGNAL(triggered()), rpcConsole, SLOT(showConfEditor())); + connect(openMNConfEditorAction, SIGNAL(triggered()), rpcConsole, SLOT(showMNConfEditor())); connect(showBackupsAction, SIGNAL(triggered()), rpcConsole, SLOT(showBackups())); connect(labelConnectionsIcon, SIGNAL(clicked()), rpcConsole, SLOT(showPeers())); @@ -362,8 +363,10 @@ void BitcoinGUI::createActions(const NetworkStyle *networkStyle) openPeersAction->setStatusTip(tr("Show peers info")); openRepairAction = new QAction(QIcon(":/icons/" + theme + "/options"), tr("Wallet &Repair"), this); openRepairAction->setStatusTip(tr("Show wallet repair options")); - openConfEditorAction = new QAction(QIcon(":/icons/" + theme + "/edit"), tr("Open &Configuration File"), this); + openConfEditorAction = new QAction(QIcon(":/icons/" + theme + "/edit"), tr("Open Wallet &Configuration File"), this); openConfEditorAction->setStatusTip(tr("Open configuration file")); + openMNConfEditorAction = new QAction(QIcon(":/icons/" + theme + "/edit"), tr("Open &Masternode Configuration File"), this); + openMNConfEditorAction->setStatusTip(tr("Open Masternode configuration file")); showBackupsAction = new QAction(QIcon(":/icons/" + theme + "/browse"), tr("Show Automatic &Backups"), this); showBackupsAction->setStatusTip(tr("Show automatically created wallet backups")); @@ -448,6 +451,7 @@ void BitcoinGUI::createMenuBar() tools->addAction(openRepairAction); tools->addSeparator(); tools->addAction(openConfEditorAction); + tools->addAction(openMNConfEditorAction); tools->addAction(showBackupsAction); } @@ -616,6 +620,7 @@ void BitcoinGUI::createTrayIconMenu() trayIconMenu->addAction(openRepairAction); trayIconMenu->addSeparator(); trayIconMenu->addAction(openConfEditorAction); + trayIconMenu->addAction(openMNConfEditorAction); trayIconMenu->addAction(showBackupsAction); #ifndef Q_OS_MAC // This is built-in on Mac trayIconMenu->addSeparator(); diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index d58c87cf7763..5696fc5b54f4 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -111,6 +111,7 @@ class BitcoinGUI : public QMainWindow QAction *openPeersAction; QAction *openRepairAction; QAction *openConfEditorAction; + QAction *openMNConfEditorAction; QAction *showBackupsAction; QAction *openAction; QAction *showHelpMessageAction; diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index fcb449ee3576..92a3d4f7ac3d 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -397,6 +397,15 @@ void openConfigfile() QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathConfig))); } +void openMNConfigfile() +{ + boost::filesystem::path pathConfig = GetMasternodeConfigFile(); + + /* Open masternode.conf with the associated application */ + if (boost::filesystem::exists(pathConfig)) + QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathConfig))); +} + void showBackups() { boost::filesystem::path pathBackups = GetDataDir() / "backups"; diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 8882ee74d45f..66b60af6fd10 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -108,7 +108,10 @@ namespace GUIUtil // Open dash.conf void openConfigfile(); - + + // Open masternode.conf + void openMNConfigfile(); + // Browse backup folder void showBackups(); diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 9a51b12fd64b..742f2772527f 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -641,6 +641,12 @@ void RPCConsole::showConfEditor() { GUIUtil::openConfigfile(); } + +void RPCConsole::showMNConfEditor() +{ + GUIUtil::openMNConfigfile(); +} + void RPCConsole::peerSelected(const QItemSelection &selected, const QItemSelection &deselected) { Q_UNUSED(deselected); diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 07281c35a33b..26ee2c5ee387 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -91,7 +91,9 @@ public slots: /** Switch to wallet-repair tab and show */ void showRepair(); /** Open external (default) editor with dash.conf */ - void showConfEditor(); + void showConfEditor(); + /** Open external (default) editor with masternode.conf */ + void showMNConfEditor(); /** Handle selection of peer in peers list */ void peerSelected(const QItemSelection &selected, const QItemSelection &deselected); /** Handle updated peer information */