Skip to content

Commit c9a1802

Browse files
Merge pull request #454 from mxaddict/patch-3
Added the NavCoin Knowledge Base menu item
2 parents 4df0766 + a163b60 commit c9a1802

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/qt/navcoingui.cpp

+17
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ NavCoinGUI::NavCoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n
129129
signMessageAction(0),
130130
verifyMessageAction(0),
131131
aboutAction(0),
132+
infoAction(0),
132133
receiveCoinsAction(0),
133134
receiveCoinsMenuAction(0),
134135
optionsAction(0),
@@ -419,6 +420,10 @@ void NavCoinGUI::createActions()
419420
aboutAction->setStatusTip(tr("Show information about %1").arg(tr(PACKAGE_NAME)));
420421
aboutAction->setMenuRole(QAction::AboutRole);
421422
aboutAction->setEnabled(false);
423+
infoAction = new QAction(platformStyle->TextColorIcon(":/icons/address-book"), tr("%1 &Knowledge Base").arg(tr(PACKAGE_NAME)), this);
424+
infoAction->setStatusTip(tr("Open the %1 Knowledge Base in your browser").arg(tr(PACKAGE_NAME)));
425+
infoAction->setMenuRole(QAction::NoRole);
426+
infoAction->setEnabled(false);
422427
aboutQtAction = new QAction(platformStyle->TextColorIcon(":/icons/about_qt"), tr("About &Qt"), this);
423428
aboutQtAction->setStatusTip(tr("Show information about Qt"));
424429
aboutQtAction->setMenuRole(QAction::AboutQtRole);
@@ -476,6 +481,7 @@ void NavCoinGUI::createActions()
476481

477482
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
478483
connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked()));
484+
connect(infoAction, SIGNAL(triggered()), this, SLOT(infoClicked()));
479485
connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
480486
connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked()));
481487
connect(cfundProposalsAction, SIGNAL(triggered()), this, SLOT(cfundProposalsClicked()));
@@ -593,6 +599,7 @@ void NavCoinGUI::createMenuBar()
593599
help->addAction(showHelpMessageAction);
594600
help->addSeparator();
595601
help->addAction(aboutAction);
602+
help->addAction(infoAction);
596603
help->addAction(aboutQtAction);
597604
}
598605

@@ -913,6 +920,15 @@ void NavCoinGUI::aboutClicked()
913920
dlg.exec();
914921
}
915922

923+
void NavCoinGUI::infoClicked()
924+
{
925+
if(!clientModel)
926+
return;
927+
928+
QString link = QString("https://info.navcoin.org/");
929+
QDesktopServices::openUrl(QUrl(link));
930+
}
931+
916932
void NavCoinGUI::showDebugWindow()
917933
{
918934
rpcConsole->showNormal();
@@ -1378,6 +1394,7 @@ void NavCoinGUI::showEvent(QShowEvent *event)
13781394
// enable the debug window when the main window shows up
13791395
openRPCConsoleAction->setEnabled(true);
13801396
aboutAction->setEnabled(true);
1397+
infoAction->setEnabled(true);
13811398
optionsAction->setEnabled(true);
13821399
}
13831400

src/qt/navcoingui.h

+3
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ class NavCoinGUI : public QMainWindow
114114
QAction *signMessageAction;
115115
QAction *verifyMessageAction;
116116
QAction *aboutAction;
117+
QAction *infoAction;
117118
QAction *receiveCoinsAction;
118119
QAction *receiveCoinsMenuAction;
119120
QAction *optionsAction;
@@ -257,6 +258,8 @@ private Q_SLOTS:
257258
void cfundPaymentRequestsClicked();
258259
/** Show about dialog */
259260
void aboutClicked();
261+
/** Open NavCoin Knowledge base */
262+
void infoClicked();
260263
/** Show debug window */
261264
void showDebugWindow();
262265
/** Show debug window and set focus to the console */

0 commit comments

Comments
 (0)