Ask before deleting a subscription

Fixes #120
This commit is contained in:
mailchuck 2015-11-19 19:28:32 +01:00
parent 5b07d8800a
commit e62b9b59e6
Signed by untrusted user who does not match committer: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -3380,6 +3380,8 @@ class MyForm(settingsmixin.SMainWindow):
self.click_pushButtonAddSubscription() self.click_pushButtonAddSubscription()
def on_action_SubscriptionsDelete(self): def on_action_SubscriptionsDelete(self):
if QtGui.QMessageBox.question(self, "Delete subscription?", _translate("MainWindow", "If you delete the subscription, messages that you already received will become inaccessible. Maybe you can consider disabling the subscription instead. Disabled subscriptions will not receive new messages, but you can still view messages you already received.\n\nAre you sure you want to delete the subscription?"), QMessageBox.Yes|QMessageBox.No) != QMessageBox.Yes:
return
address = self.getCurrentAccount() address = self.getCurrentAccount()
sqlExecute('''DELETE FROM subscriptions WHERE address=?''', sqlExecute('''DELETE FROM subscriptions WHERE address=?''',
address) address)