1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-keygen synced 2026-06-16 03:44:56 +02:00

gui/src/MainWindow: Add menu item to switch between FIO/EOS key prefixes.

This commit is contained in:
Henrik Hautakoski 2021-05-07 13:40:47 +02:00
parent 6bd84b1d8d
commit 7fb1774359
2 changed files with 26 additions and 2 deletions

View file

@ -26,12 +26,14 @@
#include <QGridLayout>
#include <QStackedWidget>
#include "gui_text.h"
#include "Settings.hpp"
#include "GenerateWindow.hpp"
#include "SearchWindow.hpp"
#include "MainWindow.hpp"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow (parent)
QMainWindow (parent),
m_fio_action (nullptr)
{
// Create sub windows and stacked widget.
m_stacked = new QStackedWidget();
@ -40,10 +42,21 @@ QMainWindow (parent)
setCentralWidget(m_stacked);
// Menu bar.
// Add to menu bar.
menuBar()->addAction("Generate", this, SLOT(switchToGenerate()));
menuBar()->addAction("Search", this, SLOT(switchToSearch()));
// Settings
m_fio_action = new QAction("FIO Keys", this);
m_fio_action->setCheckable(true);
connect(m_fio_action, SIGNAL(triggered()), this, SLOT(fioKeysCheckboxChanged()));
QMenu *settings_menu = menuBar()->addMenu("Settings");
settings_menu->addAction(m_fio_action);
// About
menuBar()->addAction("About", this, SLOT(showAbout()));
}
@ -63,3 +76,8 @@ void MainWindow::showAbout()
EOSIOKEYGEN_GUI_TEXT_ABOUT_TITLE,
EOSIOKEYGEN_GUI_TEXT_ABOUT_BODY);
}
void MainWindow::fioKeysCheckboxChanged()
{
Settings::setGenerateFioKeys(m_fio_action ? m_fio_action->isChecked() : false);
}

View file

@ -24,6 +24,8 @@
#ifndef MAIN_WINDOW_H
#define MAIN_WINDOW_H
#include <QAction>
#include <QPointer>
#include <QMainWindow>
class QStackedWidget;
@ -44,9 +46,13 @@ private slots :
void showAbout();
void fioKeysCheckboxChanged();
private :
QStackedWidget* m_stacked;
QPointer<QAction> m_fio_action;
};
#endif /* MAIN_WINDOW_H */