From 9a5433750128ae302c9d8c772204d89c2af35ae2 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Mon, 30 Oct 2017 19:00:48 +0100 Subject: [PATCH] fixup 8c0a44e (Added a confirmation dialog before removing an account) --- main/src/ui/manage_accounts/dialog.vala | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main/src/ui/manage_accounts/dialog.vala b/main/src/ui/manage_accounts/dialog.vala index af9686c8..8fbdb630 100644 --- a/main/src/ui/manage_accounts/dialog.vala +++ b/main/src/ui/manage_accounts/dialog.vala @@ -128,10 +128,13 @@ public class Dialog : Gtk.Dialog { private void remove_account(AccountRow account_item) { Gtk.MessageDialog msg = new Gtk.MessageDialog ( this, Gtk.DialogFlags.DESTROY_WITH_PARENT | Gtk.DialogFlags.MODAL, - Gtk.MessageType.WARNING, Gtk.ButtonsType.YES_NO, - _("Delete Account")); - msg.format_secondary_markup(_("Do you really want to delete %s? This action is irreversible!"), account_item.jid_label.get_text()); - if (msg.run() == Gtk.ResponseType.YES) { + Gtk.MessageType.WARNING, Gtk.ButtonsType.OK_CANCEL, + _("Remove account %s?".printf(account_item.jid_label.get_text()))); + msg.secondary_text = "You won't be able to access your conversation history anymore."; // TODO remove history! + Button ok_button = msg.get_widget_for_response(ResponseType.OK) as Button; + ok_button.label = _("Remove"); + ok_button.get_style_context().add_class("destructive-action"); + if (msg.run() == Gtk.ResponseType.OK) { account_list.remove(account_item); account_list.queue_draw(); if (account_item.account.enabled) account_disabled(account_item.account);