mirror of
				https://git.wownero.com/wowlet/wowlet.git
				synced 2024-08-15 01:03:14 +00:00 
			
		
		
		
	TxConfDialog: detect churn transaction
This commit is contained in:
		
							parent
							
								
									58c9c1a006
								
							
						
					
					
						commit
						3987569d55
					
				
					 4 changed files with 34 additions and 2 deletions
				
			
		| 
						 | 
					@ -21,6 +21,7 @@ TxConfDialog::TxConfDialog(AppContext *ctx, PendingTransaction *tx, const QStrin
 | 
				
			||||||
    ui->setupUi(this);
 | 
					    ui->setupUi(this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ui->label_warning->setText("You are about to send a transaction.\nVerify the information below.");
 | 
					    ui->label_warning->setText("You are about to send a transaction.\nVerify the information below.");
 | 
				
			||||||
 | 
					    ui->label_note->hide();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    QString preferredCur = config()->get(Config::preferredFiatCurrency).toString();
 | 
					    QString preferredCur = config()->get(Config::preferredFiatCurrency).toString();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -46,10 +47,18 @@ TxConfDialog::TxConfDialog(AppContext *ctx, PendingTransaction *tx, const QStrin
 | 
				
			||||||
    ui->label_fee->setText(QString("%1 (%2 %3)").arg(amounts[1], amounts_fiat[1], preferredCur));
 | 
					    ui->label_fee->setText(QString("%1 (%2 %3)").arg(amounts[1], amounts_fiat[1], preferredCur));
 | 
				
			||||||
    ui->label_total->setText(QString("%1 (%2 %3)").arg(amounts[2], amounts_fiat[2], preferredCur));
 | 
					    ui->label_total->setText(QString("%1 (%2 %3)").arg(amounts[2], amounts_fiat[2], preferredCur));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    auto subaddressIndex = m_ctx->currentWallet->subaddressIndex(address);
 | 
				
			||||||
 | 
					    QString addressExtra;
 | 
				
			||||||
 | 
					    if (subaddressIndex.first >= 0) {
 | 
				
			||||||
 | 
					        ui->label_note->setText("Note: this is a churn transaction.");
 | 
				
			||||||
 | 
					        ui->label_note->show();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ui->label_address->setText(ModelUtils::displayAddress(address, 2));
 | 
					    ui->label_address->setText(ModelUtils::displayAddress(address, 2));
 | 
				
			||||||
    ui->label_address->setFont(ModelUtils::getMonospaceFont());
 | 
					    ui->label_address->setFont(ModelUtils::getMonospaceFont());
 | 
				
			||||||
    ui->label_address->setToolTip(address);
 | 
					    ui->label_address->setToolTip(address);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ui->buttonBox->button(QDialogButtonBox::Ok)->setText("Send");
 | 
					    ui->buttonBox->button(QDialogButtonBox::Ok)->setText("Send");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    connect(ui->btn_Advanced, &QPushButton::clicked, this, &TxConfDialog::setShowAdvanced);
 | 
					    connect(ui->btn_Advanced, &QPushButton::clicked, this, &TxConfDialog::setShowAdvanced);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,8 +6,8 @@
 | 
				
			||||||
   <rect>
 | 
					   <rect>
 | 
				
			||||||
    <x>0</x>
 | 
					    <x>0</x>
 | 
				
			||||||
    <y>0</y>
 | 
					    <y>0</y>
 | 
				
			||||||
    <width>844</width>
 | 
					    <width>612</width>
 | 
				
			||||||
    <height>248</height>
 | 
					    <height>288</height>
 | 
				
			||||||
   </rect>
 | 
					   </rect>
 | 
				
			||||||
  </property>
 | 
					  </property>
 | 
				
			||||||
  <property name="windowTitle">
 | 
					  <property name="windowTitle">
 | 
				
			||||||
| 
						 | 
					@ -24,6 +24,16 @@
 | 
				
			||||||
     </property>
 | 
					     </property>
 | 
				
			||||||
    </widget>
 | 
					    </widget>
 | 
				
			||||||
   </item>
 | 
					   </item>
 | 
				
			||||||
 | 
					   <item>
 | 
				
			||||||
 | 
					    <widget class="QLabel" name="label_note">
 | 
				
			||||||
 | 
					     <property name="text">
 | 
				
			||||||
 | 
					      <string>note</string>
 | 
				
			||||||
 | 
					     </property>
 | 
				
			||||||
 | 
					     <property name="wordWrap">
 | 
				
			||||||
 | 
					      <bool>true</bool>
 | 
				
			||||||
 | 
					     </property>
 | 
				
			||||||
 | 
					    </widget>
 | 
				
			||||||
 | 
					   </item>
 | 
				
			||||||
   <item>
 | 
					   <item>
 | 
				
			||||||
    <layout class="QHBoxLayout" name="horizontalLayout">
 | 
					    <layout class="QHBoxLayout" name="horizontalLayout">
 | 
				
			||||||
     <item>
 | 
					     <item>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -150,6 +150,15 @@ QString Wallet::address(quint32 accountIndex, quint32 addressIndex) const
 | 
				
			||||||
    return QString::fromStdString(m_walletImpl->address(accountIndex, addressIndex));
 | 
					    return QString::fromStdString(m_walletImpl->address(accountIndex, addressIndex));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					QPair<int, int> Wallet::subaddressIndex(const QString &address) const
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    std::pair<uint32_t, uint32_t> i;
 | 
				
			||||||
 | 
					    if (!m_walletImpl->subaddressIndex(address.toStdString(), i)) {
 | 
				
			||||||
 | 
					        return QPair<int, int>(-1, -1);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return QPair<int, int>(i.first, i.second);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
QString Wallet::path() const
 | 
					QString Wallet::path() const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    return QDir::toNativeSeparators(QString::fromStdString(m_walletImpl->path()));
 | 
					    return QDir::toNativeSeparators(QString::fromStdString(m_walletImpl->path()));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -139,6 +139,10 @@ public:
 | 
				
			||||||
    //! returns wallet's public address
 | 
					    //! returns wallet's public address
 | 
				
			||||||
    Q_INVOKABLE QString address(quint32 accountIndex, quint32 addressIndex) const;
 | 
					    Q_INVOKABLE QString address(quint32 accountIndex, quint32 addressIndex) const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    //! returns the subaddress index (major, minor) of the address
 | 
				
			||||||
 | 
					    // (-1, -1) if address does not belong to wallet
 | 
				
			||||||
 | 
					    Q_INVOKABLE QPair<int, int> subaddressIndex(const QString &address) const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //! returns wallet file's path
 | 
					    //! returns wallet file's path
 | 
				
			||||||
    QString path() const;
 | 
					    QString path() const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue