set theme for create and restore process #135
This commit is contained in:
@@ -26,8 +26,49 @@ auto dirwalletbackupfirst = QDir(QStandardPaths::writableLocation(QStandardPaths
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void FirstTimeWizard::slot_change_theme(const QString& theme_name)
|
||||||
|
|
||||||
|
{
|
||||||
|
Settings::getInstance()->set_theme_name(theme_name);
|
||||||
|
|
||||||
|
|
||||||
|
// Include css
|
||||||
|
QString saved_theme_name;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
saved_theme_name = Settings::getInstance()->get_theme_name();
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
saved_theme_name = "Dark";
|
||||||
|
}
|
||||||
|
|
||||||
|
QFile qFile(":/css/res/css/" + saved_theme_name +".css");
|
||||||
|
if (qFile.open(QFile::ReadOnly))
|
||||||
|
{
|
||||||
|
QString styleSheet = QLatin1String(qFile.readAll());
|
||||||
|
this->setStyleSheet(""); // resets styles, makes app restart unnecessary
|
||||||
|
this->setStyleSheet(styleSheet);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
FirstTimeWizard::FirstTimeWizard(bool dangerous, QString server)
|
FirstTimeWizard::FirstTimeWizard(bool dangerous, QString server)
|
||||||
{
|
{
|
||||||
|
// Include css
|
||||||
|
QString theme_name;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
theme_name = Settings::getInstance()->get_theme_name();
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
theme_name = "Dark";
|
||||||
|
}
|
||||||
|
this->slot_change_theme(theme_name);
|
||||||
|
|
||||||
setWindowTitle("New wallet wizard");
|
setWindowTitle("New wallet wizard");
|
||||||
this->dangerous = dangerous;
|
this->dangerous = dangerous;
|
||||||
this->server = server;
|
this->server = server;
|
||||||
@@ -139,11 +180,12 @@ NewOrRestorePage::NewOrRestorePage(FirstTimeWizard *parent) : QWizardPage(parent
|
|||||||
form.radioRestoreWallet->setEnabled(true);
|
form.radioRestoreWallet->setEnabled(true);
|
||||||
form.radioNewWallet->setEnabled(true);
|
form.radioNewWallet->setEnabled(true);
|
||||||
form.radioNewWallet->setChecked(true);
|
form.radioNewWallet->setChecked(true);
|
||||||
|
parent->button(QWizard::NextButton)->setEnabled(false);
|
||||||
|
|
||||||
|
|
||||||
int length = passphrase.length();
|
int length = passphrase.length();
|
||||||
|
|
||||||
char *sequence = NULL;
|
char *sequence = NULL;
|
||||||
sequence = new char[length+1];
|
sequence = new char[length+1];
|
||||||
strncpy(sequence, passphrase.toUtf8(), length +1);
|
strncpy(sequence, passphrase.toUtf8(), length +1);
|
||||||
|
|
||||||
|
|||||||
@@ -17,14 +17,18 @@ class FirstTimeWizard: public QWizard
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
FirstTimeWizard(bool dangerous, QString server);
|
FirstTimeWizard(bool dangerous, QString server);
|
||||||
|
|
||||||
QString getSeed();
|
QString getSeed();
|
||||||
void setSeed(QString Seed);
|
|
||||||
QString _seed;
|
|
||||||
QString getBirthday();
|
QString getBirthday();
|
||||||
void setBirthday(QString Birthday);
|
|
||||||
QString _birthday;
|
QString _birthday;
|
||||||
|
QString _seed;
|
||||||
|
void setSeed(QString Seed);
|
||||||
|
void setBirthday(QString Birthday);
|
||||||
void cancelEvent();
|
void cancelEvent();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void slot_change_theme(const QString& themeName);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int nextId() const;
|
int nextId() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user