Skip to content

Commit 29a6618

Browse files
author
limxdev
committed
Test for open bitcore.conf from Qt
1 parent b389877 commit 29a6618

5 files changed

Lines changed: 36 additions & 8 deletions

File tree

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ AC_PREREQ([2.60])
33
define(_CLIENT_VERSION_MAJOR, 0)
44
define(_CLIENT_VERSION_MINOR, 9)
55
define(_CLIENT_VERSION_REVISION, 8)
6-
define(_CLIENT_VERSION_BUILD, 4)
6+
define(_CLIENT_VERSION_BUILD, 5)
77
define(_CLIENT_VERSION_IS_RELEASE, true)
88
define(_COPYRIGHT_YEAR, 2020)
99
define(_COPYRIGHT_HOLDERS,[The %s developers])

src/qt/bitcoingui.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,11 @@ void BitcoinGUI::createActions()
389389
//-//openPeersAction->setStatusTip(tr("Show peers info"));
390390
//-//openRepairAction = new QAction(QIcon(":/icons/" + theme + "/options"), tr("Wallet &Repair"), this);
391391
//-//openRepairAction->setStatusTip(tr("Show wallet repair options"));
392-
//-//openConfEditorAction = new QAction(QIcon(":/icons/" + theme + "/edit"), tr("Open Wallet &Configuration File"), this);
393-
//-//openConfEditorAction->setStatusTip(tr("Open configuration file"));
392+
openConfEditorAction = new QAction(QIcon(":/icons/" + theme + "/edit"), tr("Open Wallet &Configuration File"), this);
393+
openConfEditorAction->setStatusTip(tr("Open configuration file"));
394394
openMNConfEditorAction = new QAction(platformStyle->TextColorIcon(":/icons/edit"), tr("Open &Masternode Configuration File"), this);
395395
openMNConfEditorAction->setStatusTip(tr("Open Masternode configuration file"));
396+
396397
//-//showBackupsAction = new QAction(QIcon(":/icons/" + theme + "/browse"), tr("Show Automatic &Backups"), this);
397398
//-//showBackupsAction->setStatusTip(tr("Show automatically created wallet backups"));
398399
// initially disable the debug window menu items
@@ -443,7 +444,7 @@ void BitcoinGUI::createActions()
443444
//-//connect(openRepairAction, SIGNAL(triggered()), this, SLOT(showRepair()));
444445

445446
// Open configs and backup folder from menu
446-
//-//connect(openConfEditorAction, SIGNAL(triggered()), this, SLOT(showConfEditor()));
447+
connect(openConfEditorAction, SIGNAL(triggered()), this, SLOT(showConfEditor()));
447448
connect(openMNConfEditorAction, SIGNAL(triggered()), this, SLOT(showMNConfEditor()));
448449
//-//connect(showBackupsAction, SIGNAL(triggered()), this, SLOT(showBackups()));
449450

@@ -549,7 +550,7 @@ void BitcoinGUI::createMenuBar()
549550
//-//tools->addAction(openPeersAction);
550551
//-//tools->addAction(openRepairAction);
551552
//-//tools->addSeparator();
552-
//-//tools->addAction(openConfEditorAction);
553+
tools->addAction(openConfEditorAction);
553554
tools->addAction(openMNConfEditorAction);
554555
//-//tools->addAction(showBackupsAction);
555556
}
@@ -938,7 +939,11 @@ void BitcoinGUI::showMNConfEditor()
938939
{
939940
GUIUtil::openMNConfigfile();
940941
}
941-
//
942+
// BTX
943+
void BitcoinGUI::showConfEditor()
944+
{
945+
GUIUtil::openBTXConfigfile();
946+
}
942947

943948
void BitcoinGUI::showHelpMessageClicked()
944949
{

src/qt/bitcoingui.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ class BitcoinGUI : public QMainWindow
132132
QAction* openRPCConsoleAction = nullptr;
133133
// Dash
134134
QAction *openMNConfEditorAction = nullptr;
135-
//
135+
// BTX
136+
QAction *openConfEditorAction = nullptr;
136137
QAction* openAction = nullptr;
137138
QAction* showHelpMessageAction = nullptr;
138139

@@ -303,7 +304,7 @@ private Q_SLOTS:
303304
//-//void showRepair();
304305

305306
/** Open external (default) editor with dash.conf */
306-
//-//void showConfEditor();
307+
void showConfEditor();
307308
/** Open external (default) editor with masternode.conf */
308309
void showMNConfEditor();
309310
/** Show folder with wallet backups in default file browser */

src/qt/guiutil.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,26 @@ void openMNConfigfile()
456456
QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathConfig)));
457457
}
458458
//
459+
// Dash
460+
461+
//BTX BEGIN
462+
void openBTXConfigfile()
463+
{
464+
boost::filesystem::path pathConfig2 = GetConfigFile(BITCOIN_CONF_FILENAME);
465+
466+
/* Create the file */
467+
boost::filesystem::ofstream configFile(pathConfig2, std::ios_base::app);
468+
469+
if (!configFile.good())
470+
return;
471+
472+
configFile.close();
473+
474+
/* Open masternode.conf with the associated application */
475+
if (fs::exists(pathConfig2))
476+
QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathConfig2)));
477+
}
478+
////BTX END
459479

460480
ToolTipToRichTextFilter::ToolTipToRichTextFilter(int _size_threshold, QObject *parent) :
461481
QObject(parent),

src/qt/guiutil.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ namespace GUIUtil
154154
// Dash
155155
// Open masternode.conf
156156
void openMNConfigfile();
157+
// Open bitcore.conf
158+
void openBTXConfigfile();
157159
//
158160

159161
/** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text

0 commit comments

Comments
 (0)