summaryrefslogtreecommitdiff
path: root/src/walletwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/walletwidget.cpp')
-rw-r--r--src/walletwidget.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/walletwidget.cpp b/src/walletwidget.cpp
index 56188c95..c7100a4d 100644
--- a/src/walletwidget.cpp
+++ b/src/walletwidget.cpp
@@ -38,6 +38,7 @@
#include <QHBoxLayout>
#include <QString>
+
WalletWidget::WalletWidget(QWidget *parent)
: QWidget(parent)
, m_label( new QLabel(this) )
@@ -59,7 +60,6 @@ WalletWidget::WalletWidget(QWidget *parent)
// layout
QGridLayout *layout = new QGridLayout(this);
- layout->setMargin(0);
layout->addWidget(closeButton,0,0);
layout->addWidget(m_label,0,1);
layout->addWidget(rememberButton,0,2);
@@ -79,6 +79,7 @@ WalletWidget::~WalletWidget()
void WalletWidget::rememberData()
{
emit saveFormDataAccepted(m_key);
+ destroy();
}
@@ -92,6 +93,17 @@ void WalletWidget::neverRememberData()
void WalletWidget::notNowRememberData()
{
emit saveFormDataRejected (m_key);
+ destroy();
+}
+
+
+void WalletWidget::destroy()
+{
+ if (parentWidget() && parentWidget()->layout())
+ {
+ parentWidget()->layout()->removeWidget(this);
+ }
+ this->deleteLater();
}