2 #include "ui_revealtxdialog.h"
9 #include <QDesktopServices>
11 #include <QPushButton>
15 QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint),
20 ui->pushButtonCopyID->setStyleSheet(
"background:transparent;");
21 ui->pushButtonCopyID->setIcon(QIcon(
":/icons/editcopy"));
22 connect(
ui->pushButtonCopyID, SIGNAL(clicked()),
this, SLOT(
copyID()));
24 ui->pushButtonCopyAddr->setStyleSheet(
"background:transparent;");
25 ui->pushButtonCopyAddr->setIcon(QIcon(
":/icons/editcopy"));
26 connect(
ui->pushButtonCopyAddr, SIGNAL(clicked()),
this, SLOT(
copyAddress()));
28 ui->pushButtonCopyPrivKey->setStyleSheet(
"background:transparent;");
29 ui->pushButtonCopyPrivKey->setIcon(QIcon(
":/icons/editcopy"));
30 connect(
ui->pushButtonCopyPrivKey, SIGNAL(clicked()),
this, SLOT(
copyPrivateKey()));
32 ui->pushButtonCopyTxAmount->setStyleSheet(
"background:transparent;");
33 ui->pushButtonCopyTxAmount->setIcon(QIcon(
":/icons/editcopy"));
34 connect(
ui->pushButtonCopyTxAmount, SIGNAL(clicked()),
this, SLOT(
copyTxAmount()));
36 ui->pushButtonCopyTxFee->setStyleSheet(
"background:transparent;");
37 ui->pushButtonCopyTxFee->setIcon(QIcon(
":/icons/editcopy"));
38 connect(
ui->pushButtonCopyTxFee, SIGNAL(clicked()),
this, SLOT(
copyTxFee()));
40 ui->pushButtonCopyTxPaymentID->setStyleSheet(
"background:transparent;");
41 ui->pushButtonCopyTxPaymentID->setIcon(QIcon(
":/icons/editcopy"));
42 connect(
ui->pushButtonCopyTxPaymentID, SIGNAL(clicked()),
this, SLOT(
copyTxPaymentID()));
44 ui->pushButtonCopyTxRingSize->setStyleSheet(
"background:transparent;");
45 ui->pushButtonCopyTxRingSize->setIcon(QIcon(
":/icons/editcopy"));
46 connect(
ui->pushButtonCopyTxRingSize, SIGNAL(clicked()),
this, SLOT(
copyTxRingSize()));
48 ui->pushButtonOpenTXID->setStyleSheet(
"background:transparent;");
49 ui->pushButtonOpenTXID->setIcon(QIcon(
":/icons/eye"));
52 ui->buttonBox->button(QDialogButtonBox::Reset)->setText(
"Delete Transaction?");
53 connect(
ui->buttonBox->button(QDialogButtonBox::Reset), SIGNAL(clicked()),
this, SLOT(
deleteTransaction()));
63 ui->lblTxID->setText(strId);
68 ui->lblAddress->setText(strAddr);
73 ui->lblPrivateKey->setText(strPrivKey);
79 ui->lblTxAmount->setText(amount.append(
" PRCY"));
91 ui->pushButtonCopyTxPaymentID->hide();
93 ui->lblTxPaymentID->hide();
95 ui->lblTxPaymentID->setText(QString::number(paymentID));
100 ui->lblTxRingSize->setText(QString::number(ringSize));
109 QClipboard *clipboard = QApplication::clipboard();
110 clipboard->setText(
ui->lblTxID->text());
114 QClipboard *clipboard = QApplication::clipboard();
115 clipboard->setText(
ui->lblAddress->text());
119 QClipboard *clipboard = QApplication::clipboard();
120 clipboard->setText(
ui->lblPrivateKey->text());
124 QClipboard *clipboard = QApplication::clipboard();
125 clipboard->setText(
ui->lblTxAmount->text());
129 QClipboard *clipboard = QApplication::clipboard();
130 clipboard->setText(
ui->lblTxFee->text());
134 QClipboard *clipboard = QApplication::clipboard();
135 clipboard->setText(
ui->lblTxPaymentID->text());
139 QClipboard *clipboard = QApplication::clipboard();
140 clipboard->setText(
ui->lblTxRingSize->text());
148 URL =
"https://explorer.prcycoin.com/tx/";
150 URL =
"https://testnet.prcycoin.com/tx/";
152 QDesktopServices::openUrl(QUrl(URL.append(
ui->lblTxID->text())));
157 bool hideSuccess =
settings.value(
"fHideDeleteSuccess",
false).toBool();
159 QMessageBox::StandardButton reply;
160 reply = QMessageBox::question(
this, tr(
"Are You Sure?"),
161 tr(
"Are you sure you would like to delete this transaction from the local wallet?\n\nNote: They can only be restored from backup or rescan."),
162 QMessageBox::Yes|QMessageBox::No);
163 if (reply == QMessageBox::Yes) {
165 if (
ui->lblTxAmount->text() ==
"5000.00000000 PRCY") {
166 QMessageBox::StandardButton doubleCheck;
167 doubleCheck = QMessageBox::question(
this, tr(
"Potential Masternode Collateral Detected!"),
168 tr(
"Potential Masternode Collateral Detected!\nAre you sure?\n\nNote: They can only be restored from backup or rescan."),
169 QMessageBox::Yes|QMessageBox::No);
170 if (doubleCheck == QMessageBox::No) {
177 hash.
SetHex(
ui->lblTxID->text().toStdString().c_str());
182 msgBox.setWindowTitle(tr(
"Invalid or non-wallet transaction id"));
183 msgBox.setIcon(QMessageBox::Critical);
184 msgBox.setText(tr(
"Invalid or non-wallet transaction id."));
192 msgBox.setWindowTitle(tr(
"Unable to delete transaction id"));
193 msgBox.setIcon(QMessageBox::Critical);
194 msgBox.setText(tr(
"Unable to delete transaction id."));
202 QCheckBox *cb =
new QCheckBox(tr(
"Do not show successful confirmation again"));
203 QPushButton *okButton = msgBox.addButton(tr(
"OK"), QMessageBox::ActionRole);
204 msgBox.setCheckBox(cb);
207 msgBox.setWindowTitle(tr(
"Success!"));
208 msgBox.setIcon(QMessageBox::Information);
209 msgBox.setText(tr(
"Transaction ID successfully deleted."));
212 if (msgBox.clickedButton() == okButton) {
213 if (cb->isChecked()) {
214 settings.setValue(
"fHideDeleteSuccess",
true);
216 settings.setValue(
"fHideDeleteSuccess",
false);
228 if (event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Delete) {
231 }
else if (event->key() == Qt::Key_Escape) {
234 }
else if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {