From 2d703f80108ede1f308230b31cca11075688cac9 Mon Sep 17 00:00:00 2001 From: crowning- Date: Sun, 15 Feb 2015 14:30:22 +0100 Subject: [PATCH 1/7] Edit configuration file from within wallet --- src/qt/bitcoingui.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 63a4d8fa2751..a2976c96ecd3 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("Edit &Configuration File"), this); + openConfEditorAction->setStatusTip(tr("Edit 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); From 1264546defc0531e7db93e632103311fbfc88b98 Mon Sep 17 00:00:00 2001 From: crowning- Date: Sun, 15 Feb 2015 14:31:11 +0100 Subject: [PATCH 2/7] Edit configuration file from within wallet --- src/qt/bitcoingui.h | 1 + 1 file changed, 1 insertion(+) 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; From dc3f49bad7492aead58a572e85e4ed05922c73bf Mon Sep 17 00:00:00 2001 From: crowning- Date: Sun, 15 Feb 2015 14:31:51 +0100 Subject: [PATCH 3/7] Edit configuration file from within wallet --- src/qt/guiutil.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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) { From e4a290dc04ddcc2f9f45fe78385654668899776d Mon Sep 17 00:00:00 2001 From: crowning- Date: Sun, 15 Feb 2015 14:32:19 +0100 Subject: [PATCH 4/7] Update guiutil.h --- src/qt/guiutil.h | 3 +++ 1 file changed, 3 insertions(+) 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. From 8e312833eaa899d6a802d7afdaea5557bc65fe3f Mon Sep 17 00:00:00 2001 From: crowning- Date: Sun, 15 Feb 2015 14:33:01 +0100 Subject: [PATCH 5/7] Edit configuration file from within wallet --- src/qt/rpcconsole.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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(); +} From 0cc5e478bfc767fadaafb587330fb5612a87467f Mon Sep 17 00:00:00 2001 From: crowning- Date: Sun, 15 Feb 2015 14:33:31 +0100 Subject: [PATCH 6/7] Edit configuration file from within wallet --- src/qt/rpcconsole.h | 2 ++ 1 file changed, 2 insertions(+) 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 From e7ee887836d293f339d5fdffb3a917cd0e2e51f6 Mon Sep 17 00:00:00 2001 From: crowning- Date: Sun, 15 Feb 2015 16:26:57 +0100 Subject: [PATCH 7/7] Edit configuration file from within wallet (formating + text change) --- src/qt/bitcoingui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index a2976c96ecd3..95fd567c7c92 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -310,8 +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("Edit &Configuration File"), this); - openConfEditorAction->setStatusTip(tr("Edit configuration file")); + 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"));