client: Components.ConversationActions: Update buttons when account updated

- Revert back !783
- Handle update on account setter
- Fix #1198
This commit is contained in:
Cédric Bellegarde 2023-07-10 16:46:22 +02:00 committed by Niels De Graef
parent 98eb063398
commit 41931d0add
2 changed files with 11 additions and 4 deletions

View file

@ -1900,7 +1900,6 @@ public class Application.MainWindow :
);
this.conversation_list_actions.update_trash_button(show_trash);
this.conversation_headerbar.full_actions.update_trash_button(show_trash);
this.conversation_headerbar.compact_actions.update_trash_button(show_trash);
}
private async void update_context_dependent_actions(bool sensitive) {

View file

@ -25,9 +25,18 @@ public class Components.ConversationActions : Gtk.Box {
}
}
public int selected_conversations { get; set; default = 1; }
public int selected_conversations { get; set; }
public Geary.Account account { get; set; }
private Geary.Account _account;
public Geary.Account account {
get {
return this._account;
}
set {
this._account = value;
this.update_conversation_buttons();
}
}
[GtkChild] private unowned Gtk.Box response_buttons { get; }
@ -58,7 +67,6 @@ public class Components.ConversationActions : Gtk.Box {
"mark_message_menu"
);
this.update_conversation_buttons();
this.notify["selected-conversations"].connect(() => update_conversation_buttons());
this.notify["service-provider"].connect(() => update_conversation_buttons());
this.mark_message_button.popover = new Gtk.Popover.from_model(null, mark_menu);