Browse Source

Merge pull request #40 from MyHush/denio

fix theme error, fix  Fix a phishing vulnerability for memos, Redo Zcash uri parsing to use QUrlQuery, add serbian translation
pull/41/head
Denio 5 years ago
committed by GitHub
parent
commit
07f062d32d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      application.qrc
  2. BIN
      res/silentdragonlite_hr.qm
  3. 1833
      res/silentdragonlite_hr.ts
  4. BIN
      res/silentdragonlite_sr.qm
  5. 1936
      res/silentdragonlite_sr.ts
  6. 17
      silentdragon-lite.pro
  7. 2
      src/mainwindow.cpp
  8. 38
      src/settings.cpp
  9. 2
      src/txtablemodel.cpp

12
application.qrc

@ -13,12 +13,12 @@
<file>res/logobig.gif</file>
</qresource>
<qresource prefix="/translations">
<file>res/zec_qt_wallet_de.qm</file>
<file>res/zec_qt_wallet_es.qm</file>
<file>res/zec_qt_wallet_fr.qm</file>
<file>res/zec_qt_wallet_pt.qm</file>
<file>res/zec_qt_wallet_it.qm</file>
<file>res/zec_qt_wallet_hr.qm</file>
<file>res/silentdragonlite_de.qm</file>
<file>res/silentdragonlite_es.qm</file>
<file>res/silentdragonlite_fr.qm</file>
<file>res/silentdragonlite_pt.qm</file>
<file>res/silentdragonlite_it.qm</file>
<file>res/silentdragonlite_hr.qm</file>
</qresource>
<qresource prefix="/css">
<file>res/css/blue.css</file>

BIN
res/silentdragonlite_hr.qm

Binary file not shown.

1833
res/silentdragonlite_hr.ts

File diff suppressed because it is too large

BIN
res/silentdragonlite_sr.qm

Binary file not shown.

1936
res/silentdragonlite_sr.ts

File diff suppressed because it is too large

17
silentdragon-lite.pro

@ -116,14 +116,15 @@ FORMS += \
src/recurringmultiple.ui
TRANSLATIONS = res/zec_qt_wallet_es.ts \
res/zec_qt_wallet_fr.ts \
res/zec_qt_wallet_de.ts \
res/zec_qt_wallet_pt.ts \
res/zec_qt_wallet_it.ts \
res/zec_qt_wallet_zh.ts \
res/zec_qt_wallet_hr.ts \
res/zec_qt_wallet_tr.ts
TRANSLATIONS = res/silentdragonlite_es.ts \
res/silentdragonlite_fr.ts \
res/silentdragonlite_de.ts \
res/silentdragonlite_pt.ts \
res/silentdragonlite_it.ts \
res/silentdragonlite_zh.ts \
res/silentdragonlite_hr.ts \
res/silentdragonlite_sr.ts \
res/silentdragonlite_tr.ts
include(singleapplication/singleapplication.pri)
DEFINES += QAPPLICATION_CLASS=QApplication

2
src/mainwindow.cpp

@ -886,6 +886,7 @@ void MainWindow::setupTransactionsTab() {
if (!memo.isEmpty()) {
QMessageBox mb(QMessageBox::Information, tr("Memo"), memo, QMessageBox::Ok, this);
mb.setTextFormat(Qt::PlainText);
mb.setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
mb.exec();
}
@ -934,6 +935,7 @@ void MainWindow::setupTransactionsTab() {
if (!memo.isEmpty()) {
menu.addAction(tr("View Memo"), [=] () {
QMessageBox mb(QMessageBox::Information, tr("Memo"), memo, QMessageBox::Ok, this);
mb.setTextFormat(Qt::PlainText);
mb.setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
mb.exec();
});

38
src/settings.cpp

@ -292,27 +292,23 @@ PaymentURI Settings::parseURI(QString uri) {
ans.error = "Could not understand address";
return ans;
}
uri = uri.right(uri.length() - ans.addr.length());
if (!uri.isEmpty()) {
uri = uri.right(uri.length() - 1); // Eat the "?"
QStringList args = uri.split("&");
for (QString arg: args) {
QStringList kv = arg.split("=");
if (kv.length() != 2) {
ans.error = "No value argument was seen";
return ans;
}
if (kv[0].toLower() == "amt" || kv[0].toLower() == "amount") {
ans.amt = kv[1];
} else if (kv[0].toLower() == "memo" || kv[0].toLower() == "message" || kv[0].toLower() == "msg") {
ans.memo = QUrl::fromPercentEncoding(kv[1].toUtf8());
} else {
// Ignore unknown fields, since some developers use it to pass extra data.
}
}
uri = uri.right(uri.length() - ans.addr.length()-1); // swallow '?'
QUrlQuery query(uri);
// parse out amt / amount
if (query.hasQueryItem("amt")) {
ans.amt = query.queryItemValue("amt");
} else if (query.hasQueryItem("amount")) {
ans.amt = query.queryItemValue("amount");
}
// parse out memo / msg / message
if (query.hasQueryItem("memo")) {
ans.memo = query.queryItemValue("memo");
} else if (query.hasQueryItem("msg")) {
ans.memo = query.queryItemValue("msg");
} else if (query.hasQueryItem("message")) {
ans.memo = query.queryItemValue("message");
}
return ans;

2
src/txtablemodel.cpp

@ -137,7 +137,7 @@ QVariant TxTableModel::data(const QModelIndex &index, int role) const {
return Settings::paymentURIPretty(Settings::parseURI(memo));
} else {
return modeldata->at(index.row()).type +
(memo.isEmpty() ? "" : " tx memo: \"" + memo + "\"");
(memo.isEmpty() ? "" : " tx memo: \"" + memo.toHtmlEscaped() + "\"");
}
} else {
return concatMultipleMemos(dat);

Loading…
Cancel
Save