MCPcopy Create free account
hub / github.com/ElementsProject/elements / createActions

Method createActions

src/qt/bitcoingui.cpp:245–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245void BitcoinGUI::createActions()
246{
247 QActionGroup *tabGroup = new QActionGroup(this);
248 connect(modalOverlay, &ModalOverlay::triggered, tabGroup, &QActionGroup::setEnabled);
249
250 overviewAction = new QAction(platformStyle->SingleColorIcon(":/icons/overview"), tr("&Overview"), this);
251 overviewAction->setStatusTip(tr("Show general overview of wallet"));
252 overviewAction->setToolTip(overviewAction->statusTip());
253 overviewAction->setCheckable(true);
254 overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1));
255 tabGroup->addAction(overviewAction);
256
257 sendCoinsAction = new QAction(platformStyle->SingleColorIcon(":/icons/send"), tr("&Send"), this);
258 sendCoinsAction->setStatusTip(tr("Send coins to a %1 address").arg("Liquid"));
259 sendCoinsAction->setToolTip(sendCoinsAction->statusTip());
260 sendCoinsAction->setCheckable(true);
261 sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2));
262 tabGroup->addAction(sendCoinsAction);
263
264 receiveCoinsAction = new QAction(platformStyle->SingleColorIcon(":/icons/receiving_addresses"), tr("&Receive"), this);
265 receiveCoinsAction->setStatusTip(tr("Request payments (generates QR codes and %1 addresses)").arg("Liquid"));
266 receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip());
267 receiveCoinsAction->setCheckable(true);
268 receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3));
269 tabGroup->addAction(receiveCoinsAction);
270
271 historyAction = new QAction(platformStyle->SingleColorIcon(":/icons/history"), tr("&Transactions"), this);
272 historyAction->setStatusTip(tr("Browse transaction history"));
273 historyAction->setToolTip(historyAction->statusTip());
274 historyAction->setCheckable(true);
275 historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
276 tabGroup->addAction(historyAction);
277
278#ifdef ENABLE_WALLET
279 // These showNormalIfMinimized are needed because Send Coins and Receive Coins
280 // can be triggered from the tray menu, and need to show the GUI to be useful.
281 connect(overviewAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
282 connect(overviewAction, &QAction::triggered, this, &BitcoinGUI::gotoOverviewPage);
283 connect(sendCoinsAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
284 connect(sendCoinsAction, &QAction::triggered, [this]{ gotoSendCoinsPage(); });
285 connect(receiveCoinsAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
286 connect(receiveCoinsAction, &QAction::triggered, this, &BitcoinGUI::gotoReceiveCoinsPage);
287 connect(historyAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
288 connect(historyAction, &QAction::triggered, this, &BitcoinGUI::gotoHistoryPage);
289#endif // ENABLE_WALLET
290
291 quitAction = new QAction(tr("E&xit"), this);
292 quitAction->setStatusTip(tr("Quit application"));
293 quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
294 quitAction->setMenuRole(QAction::QuitRole);
295 aboutAction = new QAction(tr("&About %1").arg(PACKAGE_NAME), this);
296 aboutAction->setStatusTip(tr("Show information about %1").arg(PACKAGE_NAME));
297 aboutAction->setMenuRole(QAction::AboutRole);
298 aboutAction->setEnabled(false);
299 aboutQtAction = new QAction(tr("About &Qt"), this);
300 aboutQtAction->setStatusTip(tr("Show information about Qt"));
301 aboutQtAction->setMenuRole(QAction::AboutQtRole);
302 optionsAction = new QAction(tr("&Options…"), this);

Callers

nothing calls this directly

Calls 11

QKeySequenceClass · 0.85
SingleColorIconMethod · 0.80
closeWalletMethod · 0.80
currentWalletModelMethod · 0.80
createMethod · 0.80
closeAllWalletsMethod · 0.80
setEnabledMethod · 0.45
clearMethod · 0.45
listWalletDirMethod · 0.45
emptyMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected