Browse Source

payment uri fix and version bump

pull/45/head 0.7.5
Jane Mercer 5 years ago
parent
commit
2bd0b4784c
  1. 4
      src/mainwindow.cpp
  2. 4
      src/settings.cpp
  3. 6
      src/txtablemodel.cpp
  4. 2
      src/version.h

4
src/mainwindow.cpp

@ -819,8 +819,8 @@ void MainWindow::payZcashURI(QString uri, QString myAddr) {
qDebug() << "Recieved URI " << uri; qDebug() << "Recieved URI " << uri;
PaymentURI paymentInfo = Settings::parseURI(uri); PaymentURI paymentInfo = Settings::parseURI(uri);
if (!paymentInfo.error.isEmpty()) { if (!paymentInfo.error.isEmpty()) {
QMessageBox::critical(this, tr("Error paying zcash URI"), QMessageBox::critical(this, tr("Error paying pirate URI"),
tr("URI should be of the form 'zcash:<addr>?amt=x&memo=y") + "\n" + paymentInfo.error); tr("URI should be of the form 'pirate:<addr>?amt=x&memo=y") + "\n" + paymentInfo.error);
return; return;
} }

4
src/settings.cpp

@ -296,12 +296,12 @@ QString Settings::paymentURIPretty(PaymentURI uri) {
PaymentURI Settings::parseURI(QString uri) { PaymentURI Settings::parseURI(QString uri) {
PaymentURI ans; PaymentURI ans;
if (!uri.startsWith("zcash:")) { if (!uri.startsWith("pirate:")) {
ans.error = "Not a Pirate payment URI"; ans.error = "Not a Pirate payment URI";
return ans; return ans;
} }
uri = uri.right(uri.length() - QString("zcash:").length()); uri = uri.right(uri.length() - QString("pirate:").length());
QRegExp re("([a-zA-Z0-9]+)"); QRegExp re("([a-zA-Z0-9]+)");
int pos; int pos;

6
src/txtablemodel.cpp

@ -139,7 +139,7 @@ void TxTableModel::updateAllData() {
if (role == Qt::ToolTipRole) { if (role == Qt::ToolTipRole) {
switch (index.column()) { switch (index.column()) {
case 0: { case 0: {
if (dat.memo.startsWith("zcash:")) { if (dat.memo.startsWith("pirate:")) {
return Settings::paymentURIPretty(Settings::parseURI(dat.memo)); return Settings::paymentURIPretty(Settings::parseURI(dat.memo));
} else { } else {
return modeldata->at(index.row()).type + return modeldata->at(index.row()).type +
@ -161,7 +161,7 @@ void TxTableModel::updateAllData() {
if (role == Qt::DecorationRole && index.column() == 0) { if (role == Qt::DecorationRole && index.column() == 0) {
if (!dat.memo.isEmpty()) { if (!dat.memo.isEmpty()) {
// If the memo is a Payment URI, then show a payment request icon // If the memo is a Payment URI, then show a payment request icon
if (dat.memo.startsWith("zcash:")) { if (dat.memo.startsWith("pirate:")) {
QIcon icon(":/icons/res/paymentreq.gif"); QIcon icon(":/icons/res/paymentreq.gif");
return QVariant(icon.pixmap(16, 16)); return QVariant(icon.pixmap(16, 16));
} else { } else {
@ -224,4 +224,4 @@ QString TxTableModel::getType(int row) const {
QString TxTableModel::getAmt(int row) const { QString TxTableModel::getAmt(int row) const {
return Settings::getDecimalString(modeldata->at(row).amount); return Settings::getDecimalString(modeldata->at(row).amount);
} }

2
src/version.h

@ -1 +1 @@
#define APP_VERSION "0.7.4" #define APP_VERSION "0.7.5"

Loading…
Cancel
Save