From 91967edc2f6ef83c68419e38e97075537adacffe Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Sun, 24 Feb 2019 19:32:50 +0300 Subject: [PATCH 1/2] ui: make sure action entries are set for both composer and editor Bugzilla: https://gitlab.gnome.org/GNOME/geary/issues/263 Signed-off-by: Konstantin Kharlamov --- src/client/composer/composer-widget.vala | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala index 24365816d..c4e43cef6 100644 --- a/src/client/composer/composer-widget.vala +++ b/src/client/composer/composer-widget.vala @@ -826,12 +826,14 @@ public class ComposerWidget : Gtk.EventBox, Geary.BaseInterface { ); this.editor_container.insert_action_group("win", this.editor_actions); - this.composer_actions.change_action_state( - ACTION_SHOW_EXTENDED, false - ); - this.composer_actions.change_action_state( - ACTION_COMPOSE_AS_HTML, this.config.compose_as_html - ); + SimpleActionGroup[] composer_action_entries_users + = {this.editor_actions, this.composer_actions}; + foreach (SimpleActionGroup entries_users in composer_action_entries_users) { + entries_users.change_action_state(ACTION_SHOW_EXTENDED, false); + entries_users.change_action_state( + ACTION_COMPOSE_AS_HTML, this.config.compose_as_html + ); + } get_action(ACTION_CLOSE_AND_SAVE).set_enabled(false); get_action(GearyApplication.ACTION_UNDO).set_enabled(false); -- GitLab From 8f2e4b43bee517fd8839d5783e3dff31988a02e9 Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Sun, 24 Feb 2019 20:30:53 +0300 Subject: [PATCH 2/2] ui: there're multiple actions with the field, use config val instead There are two actions for ACTION_COMPOSE_AS_HTML, and as bug #263 shows, under some circumstances one of them may have wrong value. However the config supposed to always have correct value, so query that instead. Signed-off-by: Konstantin Kharlamov --- src/client/composer/composer-widget.vala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala index c4e43cef6..8b2bf1d68 100644 --- a/src/client/composer/composer-widget.vala +++ b/src/client/composer/composer-widget.vala @@ -2258,9 +2258,7 @@ public class ComposerWidget : Gtk.EventBox, Geary.BaseInterface { // so the user can still select text with a link in it, // without the popover immediately appearing and raining on // their text selection parade. - if (this.pointer_url != null && - this.composer_actions.get_action_state(ACTION_COMPOSE_AS_HTML) - .get_boolean()) { + if (this.pointer_url != null && this.config.compose_as_html) { Gdk.EventButton? button = (Gdk.EventButton) event; Gdk.Rectangle location = Gdk.Rectangle(); location.x = (int) button.x; -- GitLab