diff --git a/po/POTFILES.in b/po/POTFILES.in index 6ab344dc..f66a91f2 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -9,7 +9,6 @@ src/client/accounts/accounts-editor.vala src/client/accounts/accounts-editor-add-pane.vala src/client/accounts/accounts-editor-edit-pane.vala src/client/accounts/accounts-editor-list-pane.vala -src/client/accounts/accounts-editor-remove-pane.vala src/client/accounts/accounts-editor-row.vala src/client/accounts/accounts-editor-servers-pane.vala src/client/accounts/accounts-manager.vala diff --git a/src/client/accounts/accounts-editor-add-pane.vala b/src/client/accounts/accounts-editor-add-pane.vala index a4a333cd..468e348f 100644 --- a/src/client/accounts/accounts-editor-add-pane.vala +++ b/src/client/accounts/accounts-editor-add-pane.vala @@ -526,7 +526,7 @@ private abstract class Accounts.EntryRow : AddPaneRow { this.value.text = initial_value ?? ""; this.value.placeholder_text = placeholder ?? ""; - this.value.width_chars = 32; + this.value.width_chars = 16; this.undo = new Components.EntryUndo(this.value); } diff --git a/src/client/accounts/accounts-editor-edit-pane.vala b/src/client/accounts/accounts-editor-edit-pane.vala index 2722db6e..405dc7ba 100644 --- a/src/client/accounts/accounts-editor-edit-pane.vala +++ b/src/client/accounts/accounts-editor-edit-pane.vala @@ -217,7 +217,28 @@ internal class Accounts.EditorEditPane : [GtkCallback] private void on_remove_account_clicked() { if (!this.editor.accounts.is_goa_account(account)) { - this.editor.push(new EditorRemovePane(this.editor, this.account)); + var button = new Gtk.Button.with_mnemonic(_("Remove Account")); + button.get_style_context().add_class(Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); + button.show(); + + var dialog = new Gtk.MessageDialog(this.editor, + Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, + Gtk.MessageType.WARNING, + Gtk.ButtonsType.NONE, + _("Remove Account: %s"), + account.primary_mailbox.address); + dialog.secondary_text = _("This will remove it from Geary and delete locally cached email data from your computer. Nothing will be deleted from your service provider."); + + dialog.add_button (_("_Cancel"), Gtk.ResponseType.CANCEL); + dialog.add_action_widget(button, Gtk.ResponseType.ACCEPT); + + dialog.response.connect((response_id) => { + if (response_id == Gtk.ResponseType.ACCEPT) + this.editor.remove_account(this.account); + + dialog.destroy(); + }); + dialog.show(); } } @@ -376,7 +397,9 @@ private class Accounts.MailboxRow : AccountRow { public MailboxRow(Geary.AccountInformation account, Geary.RFC822.MailboxAddress mailbox) { - base(account, "", new Gtk.Label("")); + var label = new Gtk.Label(""); + label.ellipsize = Pango.EllipsizeMode.END; + base(account, "", label); this.mailbox = mailbox; enable_drag(); diff --git a/src/client/accounts/accounts-editor-remove-pane.vala b/src/client/accounts/accounts-editor-remove-pane.vala deleted file mode 100644 index 2a6844cd..00000000 --- a/src/client/accounts/accounts-editor-remove-pane.vala +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2018-2019 Michael Gratton - * - * This software is licensed under the GNU Lesser General Public License - * (version 2.1 or later). See the COPYING file in this distribution. - */ - -/** - * An account editor pane for removing an account from the client. - */ -[GtkTemplate (ui = "/org/gnome/Geary/accounts_editor_remove_pane.ui")] -internal class Accounts.EditorRemovePane : Gtk.Grid, EditorPane, AccountPane { - - - /** {@inheritDoc} */ - internal weak Accounts.Editor editor { get; set; } - - /** {@inheritDoc} */ - internal Geary.AccountInformation account { get ; protected set; } - - /** {@inheritDoc} */ - internal Gtk.Widget initial_widget { - get { return this.remove_button; } - } - - /** {@inheritDoc} */ - internal bool is_operation_running { get; protected set; default = false; } - - /** {@inheritDoc} */ - internal GLib.Cancellable? op_cancellable { - get; protected set; default = null; - } - - [GtkChild] - private Gtk.HeaderBar header; - - [GtkChild] - private Gtk.Label warning_label; - - [GtkChild] - private Gtk.Button remove_button; - - - public EditorRemovePane(Editor editor, Geary.AccountInformation account) { - this.editor = editor; - this.account = account; - - this.warning_label.set_text( - this.warning_label.get_text().printf(account.display_name) - ); - - connect_account_signals(); - } - - ~EditorRemovePane() { - disconnect_account_signals(); - } - - /** {@inheritDoc} */ - internal Gtk.HeaderBar get_header() { - return this.header; - } - - [GtkCallback] - private void on_remove_button_clicked() { - this.editor.remove_account(this.account); - } - - [GtkCallback] - private void on_back_button_clicked() { - this.editor.pop(); - } - -} diff --git a/src/client/meson.build b/src/client/meson.build index 56a07fa4..4c4a1365 100644 --- a/src/client/meson.build +++ b/src/client/meson.build @@ -38,7 +38,6 @@ client_vala_sources = files( 'accounts/accounts-editor-add-pane.vala', 'accounts/accounts-editor-edit-pane.vala', 'accounts/accounts-editor-list-pane.vala', - 'accounts/accounts-editor-remove-pane.vala', 'accounts/accounts-editor-row.vala', 'accounts/accounts-editor-servers-pane.vala', 'accounts/accounts-signature-web-view.vala', diff --git a/ui/accounts_editor.ui b/ui/accounts_editor.ui index 4e23cdd5..04581e8d 100644 --- a/ui/accounts_editor.ui +++ b/ui/accounts_editor.ui @@ -5,7 +5,7 @@