Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"));
Expand Down Expand Up @@ -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"));
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/qt/bitcoingui.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class BitcoinGUI : public QMainWindow
QAction *openInfoAction;
QAction *openRPCConsoleAction;
QAction *openNetworkAction;
QAction *openConfEditorAction;
QAction *openAction;
QAction *showHelpMessageAction;

Expand Down
9 changes: 9 additions & 0 deletions src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
3 changes: 3 additions & 0 deletions src/qt/guiutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,3 +517,8 @@ void RPCConsole::showNetwork()
ui->tabWidget->setCurrentIndex(2);
show();
}

void RPCConsole::showConfEditor()
{
GUIUtil::openConfigfile();
}
2 changes: 2 additions & 0 deletions src/qt/rpcconsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down