Skip to content

Commit 7024d90

Browse files
committed
Add links in QT version
1 parent a1ccbbe commit 7024d90

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

src/qt/neuraigui.cpp

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,12 +494,35 @@ void NeuraiGUI::createActions()
494494
showHelpMessageAction->setMenuRole(QAction::NoRole);
495495
showHelpMessageAction->setStatusTip(tr("Show the %1 help message to get a list with possible Neurai command-line options").arg(tr(PACKAGE_NAME)));
496496

497+
/** Links menu actions */
498+
websiteAction = new QAction(tr("&Website"), this);
499+
websiteAction->setStatusTip(tr("Open Neurai website"));
500+
explorerAction = new QAction(tr("&Explorer"), this);
501+
explorerAction->setStatusTip(tr("Open Neurai explorer"));
502+
webWalletAction = new QAction(tr("&WebWallet"), this);
503+
webWalletAction->setStatusTip(tr("Open Neurai web wallet"));
504+
bGridAction = new QAction(tr("&BGrid"), this);
505+
bGridAction->setStatusTip(tr("Open BGrid"));
506+
telegramAction = new QAction(tr("&Telegram"), this);
507+
telegramAction->setStatusTip(tr("Open Neurai Telegram group"));
508+
twitterAction = new QAction(tr("&X (Twitter)"), this);
509+
twitterAction->setStatusTip(tr("Open Neurai X (Twitter) page"));
510+
497511
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
498512
connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked()));
499513
connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
500514
connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked()));
501515
connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden()));
502516
connect(showHelpMessageAction, SIGNAL(triggered()), this, SLOT(showHelpMessageClicked()));
517+
518+
/** Connect link actions */
519+
connect(websiteAction, SIGNAL(triggered()), this, SLOT(openWebsite()));
520+
connect(explorerAction, SIGNAL(triggered()), this, SLOT(openExplorer()));
521+
connect(webWalletAction, SIGNAL(triggered()), this, SLOT(openWebWallet()));
522+
connect(bGridAction, SIGNAL(triggered()), this, SLOT(openBGrid()));
523+
connect(telegramAction, SIGNAL(triggered()), this, SLOT(openTelegram()));
524+
connect(twitterAction, SIGNAL(triggered()), this, SLOT(openTwitter()));
525+
503526
connect(openRPCConsoleAction, SIGNAL(triggered()), this, SLOT(showDebugWindow()));
504527
connect(openWalletRepairAction, SIGNAL(triggered()), this, SLOT(showWalletRepair()));
505528
// Get restart command-line parameters and handle restart
@@ -571,6 +594,14 @@ void NeuraiGUI::createMenuBar()
571594
help->addSeparator();
572595
help->addAction(aboutAction);
573596
help->addAction(aboutQtAction);
597+
598+
QMenu *links = appMenuBar->addMenu(tr("&Links"));
599+
links->addAction(websiteAction);
600+
links->addAction(explorerAction);
601+
links->addAction(webWalletAction);
602+
links->addAction(bGridAction);
603+
links->addAction(telegramAction);
604+
links->addAction(twitterAction);
574605
}
575606

576607
void NeuraiGUI::createToolBars()
@@ -1893,4 +1924,35 @@ void NeuraiGUI::getLatestVersion()
18931924
{
18941925
versionRequest->setUrl(QUrl("https://api.github.com/repos/NeuraiProject/Neurai/releases"));
18951926
networkVersionManager->get(*versionRequest);
1927+
}
1928+
1929+
/** Link opening slots */
1930+
void NeuraiGUI::openWebsite()
1931+
{
1932+
QDesktopServices::openUrl(QUrl("https://neurai.org"));
1933+
}
1934+
1935+
void NeuraiGUI::openExplorer()
1936+
{
1937+
QDesktopServices::openUrl(QUrl("https://neuraiexplorer.com"));
1938+
}
1939+
1940+
void NeuraiGUI::openWebWallet()
1941+
{
1942+
QDesktopServices::openUrl(QUrl("https://webwallet.neurai.org"));
1943+
}
1944+
1945+
void NeuraiGUI::openBGrid()
1946+
{
1947+
QDesktopServices::openUrl(QUrl("https://bgrid.org"));
1948+
}
1949+
1950+
void NeuraiGUI::openTelegram()
1951+
{
1952+
QDesktopServices::openUrl(QUrl("https://t.me/neuraiproject"));
1953+
}
1954+
1955+
void NeuraiGUI::openTwitter()
1956+
{
1957+
QDesktopServices::openUrl(QUrl("https://x.com/neuraiproject"));
18961958
}

src/qt/neuraigui.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ class NeuraiGUI : public QMainWindow
127127
QAction *openAction = nullptr;
128128
QAction *showHelpMessageAction = nullptr;
129129

130+
/** Links menu actions */
131+
QAction *websiteAction = nullptr;
132+
QAction *explorerAction = nullptr;
133+
QAction *webWalletAction = nullptr;
134+
QAction *bGridAction = nullptr;
135+
QAction *telegramAction = nullptr;
136+
QAction *twitterAction = nullptr;
137+
130138
/** XNA START */
131139
QAction *transferAssetAction = nullptr;
132140
QAction *createAssetAction = nullptr;
@@ -295,6 +303,14 @@ private Q_SLOTS:
295303
void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
296304
#endif
297305

306+
/** Open external links */
307+
void openWebsite();
308+
void openExplorer();
309+
void openWebWallet();
310+
void openBGrid();
311+
void openTelegram();
312+
void openTwitter();
313+
298314
/** Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHidden is true */
299315
void showNormalIfMinimized(bool fToggleHidden = false);
300316
/** Simply calls showNormalIfMinimized(true) for use in SLOT() macro */

0 commit comments

Comments
 (0)