Browse Source

Allow deleting local sent Tx history

recurring
Aditya Kulkarni 6 years ago
parent
commit
9694ab7439
  1. 9
      src/mainwindow.cpp
  2. 6
      src/mainwindow.ui
  3. 6
      src/senttxstore.cpp
  4. 2
      src/senttxstore.h
  5. 5
      src/ui_mainwindow.h

9
src/mainwindow.cpp

@ -6,6 +6,7 @@
#include "balancestablemodel.h"
#include "settings.h"
#include "utils.h"
#include "senttxstore.h"
#include "precompiled.h"
@ -49,6 +50,14 @@ MainWindow::MainWindow(QWidget *parent) :
aboutDialog.exec();
});
// Set up delete sent history action
QObject::connect(ui->actionDelete_Sent_History, &QAction::triggered, [=] () {
bool confirm = QMessageBox::information(this, "Delete Sent History?",
"Shielded z-Address sent transactions are stored locally in your wallet. You may delete this saved information safely any time for your privacy.\nDo you want to delete this now?",
QMessageBox::Yes, QMessageBox::No);
if (confirm) SentTxStore::deleteHistory();
});
// Initialize to the balances tab
ui->tabWidget->setCurrentIndex(0);

6
src/mainwindow.ui

@ -720,6 +720,7 @@
<string>File</string>
</property>
<addaction name="actionImport_Private_Keys"/>
<addaction name="actionDelete_Sent_History"/>
<addaction name="actionSettings"/>
<addaction name="separator"/>
<addaction name="actionExit"/>
@ -769,6 +770,11 @@
<string>Check github.com for Updates</string>
</property>
</action>
<action name="actionDelete_Sent_History">
<property name="text">
<string>Delete Sent History</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<tabstops>

6
src/senttxstore.cpp

@ -16,6 +16,12 @@ QString SentTxStore::writeableFile() {
}
}
// delete the sent history.
void SentTxStore::deleteHistory() {
QFile data(writeableFile());
data.remove();
}
QList<TransactionItem> SentTxStore::readSentTxFile() {
QFile data(writeableFile());
if (!data.exists()) {

2
src/senttxstore.h

@ -7,6 +7,8 @@
class SentTxStore {
public:
static void deleteHistory();
static QList<TransactionItem> readSentTxFile();
static void addToSentTx(Tx tx, QString txid);

5
src/ui_mainwindow.h

@ -47,6 +47,7 @@ public:
QAction *actionDonate;
QAction *actionImport_Private_Keys;
QAction *actionCheck_for_Updates;
QAction *actionDelete_Sent_History;
QWidget *centralWidget;
QGridLayout *gridLayout_3;
QTabWidget *tabWidget;
@ -159,6 +160,8 @@ public:
actionImport_Private_Keys->setVisible(false);
actionCheck_for_Updates = new QAction(MainWindow);
actionCheck_for_Updates->setObjectName(QStringLiteral("actionCheck_for_Updates"));
actionDelete_Sent_History = new QAction(MainWindow);
actionDelete_Sent_History->setObjectName(QStringLiteral("actionDelete_Sent_History"));
centralWidget = new QWidget(MainWindow);
centralWidget->setObjectName(QStringLiteral("centralWidget"));
gridLayout_3 = new QGridLayout(centralWidget);
@ -666,6 +669,7 @@ public:
menuBar->addAction(menuBalance->menuAction());
menuBar->addAction(menuHelp->menuAction());
menuBalance->addAction(actionImport_Private_Keys);
menuBalance->addAction(actionDelete_Sent_History);
menuBalance->addAction(actionSettings);
menuBalance->addSeparator();
menuBalance->addAction(actionExit);
@ -690,6 +694,7 @@ public:
actionDonate->setText(QApplication::translate("MainWindow", "Donate", nullptr));
actionImport_Private_Keys->setText(QApplication::translate("MainWindow", "Import Private Keys", nullptr));
actionCheck_for_Updates->setText(QApplication::translate("MainWindow", "Check github.com for Updates", nullptr));
actionDelete_Sent_History->setText(QApplication::translate("MainWindow", "Delete Sent History", nullptr));
groupBox->setTitle(QApplication::translate("MainWindow", "Summary", nullptr));
label->setText(QApplication::translate("MainWindow", "Shielded", nullptr));
balSheilded->setText(QString());

Loading…
Cancel
Save