mirror of
https://github.com/eosswedenorg/antelope-keygen
synced 2026-07-04 12:03:41 +02:00
gui/src/MainWindow: Add menu item to switch between FIO/EOS key prefixes.
This commit is contained in:
parent
6bd84b1d8d
commit
7fb1774359
2 changed files with 26 additions and 2 deletions
|
|
@ -26,12 +26,14 @@
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QStackedWidget>
|
#include <QStackedWidget>
|
||||||
#include "gui_text.h"
|
#include "gui_text.h"
|
||||||
|
#include "Settings.hpp"
|
||||||
#include "GenerateWindow.hpp"
|
#include "GenerateWindow.hpp"
|
||||||
#include "SearchWindow.hpp"
|
#include "SearchWindow.hpp"
|
||||||
#include "MainWindow.hpp"
|
#include "MainWindow.hpp"
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent) :
|
MainWindow::MainWindow(QWidget *parent) :
|
||||||
QMainWindow (parent)
|
QMainWindow (parent),
|
||||||
|
m_fio_action (nullptr)
|
||||||
{
|
{
|
||||||
// Create sub windows and stacked widget.
|
// Create sub windows and stacked widget.
|
||||||
m_stacked = new QStackedWidget();
|
m_stacked = new QStackedWidget();
|
||||||
|
|
@ -40,10 +42,21 @@ QMainWindow (parent)
|
||||||
|
|
||||||
setCentralWidget(m_stacked);
|
setCentralWidget(m_stacked);
|
||||||
|
|
||||||
// Menu bar.
|
// Add to menu bar.
|
||||||
|
|
||||||
menuBar()->addAction("Generate", this, SLOT(switchToGenerate()));
|
menuBar()->addAction("Generate", this, SLOT(switchToGenerate()));
|
||||||
menuBar()->addAction("Search", this, SLOT(switchToSearch()));
|
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()));
|
menuBar()->addAction("About", this, SLOT(showAbout()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -63,3 +76,8 @@ void MainWindow::showAbout()
|
||||||
EOSIOKEYGEN_GUI_TEXT_ABOUT_TITLE,
|
EOSIOKEYGEN_GUI_TEXT_ABOUT_TITLE,
|
||||||
EOSIOKEYGEN_GUI_TEXT_ABOUT_BODY);
|
EOSIOKEYGEN_GUI_TEXT_ABOUT_BODY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::fioKeysCheckboxChanged()
|
||||||
|
{
|
||||||
|
Settings::setGenerateFioKeys(m_fio_action ? m_fio_action->isChecked() : false);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@
|
||||||
#ifndef MAIN_WINDOW_H
|
#ifndef MAIN_WINDOW_H
|
||||||
#define MAIN_WINDOW_H
|
#define MAIN_WINDOW_H
|
||||||
|
|
||||||
|
#include <QAction>
|
||||||
|
#include <QPointer>
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
|
|
||||||
class QStackedWidget;
|
class QStackedWidget;
|
||||||
|
|
@ -44,9 +46,13 @@ private slots :
|
||||||
|
|
||||||
void showAbout();
|
void showAbout();
|
||||||
|
|
||||||
|
void fioKeysCheckboxChanged();
|
||||||
|
|
||||||
private :
|
private :
|
||||||
|
|
||||||
QStackedWidget* m_stacked;
|
QStackedWidget* m_stacked;
|
||||||
|
|
||||||
|
QPointer<QAction> m_fio_action;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* MAIN_WINDOW_H */
|
#endif /* MAIN_WINDOW_H */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue