aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrating89us <45968869+rating89us@users.noreply.github.com>2021-08-23 18:09:22 +0200
committerselsta <selsta@sent.at>2023-02-12 23:25:49 +0100
commit198dfb338cb26177763b5fff835a3740b0a4f0c5 (patch)
tree8e5608e824fde049ef9c0a5a37fd44c87dc6611a /src
parentb7ba9437d8cca6df4ecff7f5ae38a53cac5e26b2 (diff)
downloadmonzero-gui-198dfb338cb26177763b5fff835a3740b0a4f0c5.tar.gz
monzero-gui-198dfb338cb26177763b5fff835a3740b0a4f0c5.tar.xz
monzero-gui-198dfb338cb26177763b5fff835a3740b0a4f0c5.zip
wizard: redesign seed page
- move mnemonic seed - restore height into a separate page - pdf template - seed verification - responsive UI - accessibility
Diffstat (limited to 'src')
-rw-r--r--src/main/oshelper.cpp18
-rw-r--r--src/main/oshelper.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/src/main/oshelper.cpp b/src/main/oshelper.cpp
index 8294dd3c..469f3842 100644
--- a/src/main/oshelper.cpp
+++ b/src/main/oshelper.cpp
@@ -160,6 +160,18 @@ QList<QString> OSHelper::grabQrCodesFromScreen() const
return codes;
}
+bool OSHelper::openFile(const QString &filePath) const
+{
+ QString canonicalFilePath = QFileInfo(filePath).canonicalFilePath();
+ QUrl url = QUrl::fromLocalFile(canonicalFilePath);
+ if (!url.isValid())
+ {
+ qWarning() << "Malformed file path" << canonicalFilePath << url.errorString();
+ return false;
+ }
+ return QDesktopServices::openUrl(url);
+}
+
bool OSHelper::openContainingFolder(const QString &filePath) const
{
QString canonicalFilePath = QFileInfo(filePath).canonicalFilePath();
@@ -313,3 +325,9 @@ quint8 OSHelper::getNetworkTypeFromFile(const QString &keysPath) const
}
return getNetworkTypeAndAddressFromFile(walletPath).first;
}
+
+void OSHelper::openSeedTemplate() const
+{
+ QFile::copy(":/wizard/template.pdf", QDir::tempPath() + "/seed_template.pdf");
+ openFile(QDir::tempPath() + "/seed_template.pdf");
+}
diff --git a/src/main/oshelper.h b/src/main/oshelper.h
index eca1f2c7..d789471d 100644
--- a/src/main/oshelper.h
+++ b/src/main/oshelper.h
@@ -46,6 +46,7 @@ public:
Q_INVOKABLE void createDesktopEntry() const;
Q_INVOKABLE QString downloadLocation() const;
Q_INVOKABLE QList<QString> grabQrCodesFromScreen() const;
+ Q_INVOKABLE bool openFile(const QString &filePath) const;
Q_INVOKABLE bool openContainingFolder(const QString &filePath) const;
Q_INVOKABLE QString openSaveFileDialog(const QString &title, const QString &folder, const QString &filename) const;
Q_INVOKABLE QString temporaryFilename() const;
@@ -53,6 +54,7 @@ public:
Q_INVOKABLE bool removeTemporaryWallet(const QString &walletName) const;
Q_INVOKABLE bool isCapsLock() const;
Q_INVOKABLE quint8 getNetworkTypeFromFile(const QString &keysPath) const;
+ Q_INVOKABLE void openSeedTemplate() const;
static std::pair<quint8, QString> getNetworkTypeAndAddressFromFile(const QString &wallet);
private: