Browse Source

Add version string

duke
Aditya Kulkarni 5 years ago
parent
commit
0d4d05b336
  1. 2
      ui/mkdockerwinlinux.sh
  2. 1
      ui/mkrelease.sh
  3. 4
      ui/papersapling.pro
  4. 17
      ui/qtlib/src/main.cpp
  5. 4
      ui/src/main.cpp
  6. 3
      ui/src/mainwindow.cpp
  7. 9
      ui/src/mainwindow.ui
  8. 2
      ui/src/qrcodelabel.cpp
  9. 2
      ui/src/version.h
  10. 12
      ui/src/wallet.ui

2
ui/mkdockerwinlinux.sh

@ -54,3 +54,5 @@ make -j4
strip release/zecpaperwalletui.exe
cp release/zecpaperwalletui.exe artifacts/Windows-zecpaperwallet-v$APP_VERSION
# Cleanup before exiting
make distclean

1
ui/mkrelease.sh

@ -76,7 +76,6 @@ cargo build --release
# For Windows and Linux, build via docker
docker run --rm -v $(pwd)/..:/opt/zecpaperwallet rust/zecpaperwallet:v0.2 bash -c "cd /opt/zecpaperwallet/cli && cargo build --release --target x86_64-unknown-linux-musl && cargo build --release --target x86_64-pc-windows-gnu && cargo build --release --target aarch64-unknown-linux-gnu"
# Come back and package everything
cd ../ui

4
ui/papersapling.pro

@ -49,7 +49,9 @@ HEADERS += \
src/qrcode/BitBuffer.hpp \
src/qrcode/QrCode.hpp \
src/qrcode/QrSegment.hpp \
qtlib/src/zecpaperrust.h
src/version.h \
qtlib/src/zecpaperrust.h
FORMS += \
src/about.ui \

17
ui/qtlib/src/main.cpp

@ -1,17 +0,0 @@
#include <iostream>
#include <cstring>
#include "zecpaperrust.h"
using namespace std;
int main() {
char * from_rust = rust_generate_wallet(true, 1, 1, "user-provided-entropy");
auto stri = string(from_rust);
rust_free_string(from_rust);
cout << stri << endl;
rust_save_to_pdf(stri.c_str(), "output.pdf");
return 0;
}

4
ui/src/main.cpp

@ -1,4 +1,5 @@
#include "mainwindow.h"
#include "version.h"
#include <QApplication>
int main(int argc, char *argv[])
@ -16,6 +17,9 @@ int main(int argc, char *argv[])
QApplication a(argc, argv);
MainWindow w;
w.setWindowTitle(QString("zecpaperwallet ") + APP_VERSION);
w.show();
return a.exec();

3
ui/src/mainwindow.cpp

@ -3,6 +3,7 @@
#include "precompiled.h"
#include "mainwindow.h"
#include "version.h"
#include "ui_mainwindow.h"
#include "ui_wallet.h"
#include "ui_about.h"
@ -163,7 +164,7 @@ MainWindow::MainWindow(QWidget *parent) :
QDialog ad(this);
Ui_AboutDialog d;
d.setupUi(&ad);
d.lblVersion->setText(QString("zecpaperwallet ") + APP_VERSION + "(" + APP_BUILD_DATE + ")");
SaveRestore(&ad);
ad.exec();

9
ui/src/mainwindow.ui

@ -110,6 +110,9 @@
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustToContents</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
@ -118,8 +121,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>889</width>
<height>428</height>
<width>907</width>
<height>654</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout"/>
@ -134,7 +137,7 @@
<x>0</x>
<y>0</y>
<width>927</width>
<height>39</height>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">

2
ui/src/qrcodelabel.cpp

@ -21,7 +21,7 @@ void QRCodeLabel::resizeEvent(QResizeEvent*)
QPixmap QRCodeLabel::scaledPixmap() const {
QPixmap pm(size());
pm.fill(Qt::white);
pm.fill(Qt::transparent);
QPainter painter(&pm);
qrcodegen::QrCode qr = qrcodegen::QrCode::encodeText(str.toUtf8().constData(), qrcodegen::QrCode::Ecc::LOW);

2
ui/src/version.h

@ -0,0 +1,2 @@
#define APP_VERSION "0.1"
#define APP_BUILD_DATE "20 Jun 2019"

12
ui/src/wallet.ui

@ -129,6 +129,12 @@
</item>
<item row="2" column="3">
<widget class="QRCodeLabel" name="qrPrivateKey">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TextLabel</string>
</property>
@ -136,6 +142,12 @@
</item>
<item row="0" column="0">
<widget class="QRCodeLabel" name="qrAddress">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="mouseTracking">
<bool>false</bool>
</property>

Loading…
Cancel
Save