GNOME Bugzilla – Bug 738187
Allow select-replies through message menu
Last modified: 2014-10-24 12:41:38 UTC
In bug #712912, we introduced select-replies, but only through the header bar button and the shortcut. This was not enabled for replies through the message menu. This was triggered by considering the case where text in one message is selected and "reply" is activated via another message's menu. Obviously, select-reply shouldn't happen then, and it was decided to never select-reply from these menus to avoid confusion. But on reconsideration, I don't think there's much danger of confusion. We should allow select-replies through this message if the selection is in the same message.
Created attachment 288876 [details] [review] Allow select-reply through message menu This leaves us with a bit of duplication between the on_*_message() and on_*_message_action() methods. I tried to combine them into one method with a nullable callback, but Vala wouldn't accept that as an acceptible callback for the action.
Review of attachment 288876 [details] [review]: Could this be refactored something like this? on_reply_to_message(message) { create_reply_forward_widget(ComposeType.REPLY, message); } on_reply_all_message(message) { create_reply_forward_widget(ComposeType.REPLY_ALL, message); } on_forward_message() { // you get the idea } create_reply_forward_widget(compose-type, message) { // get selected message, get quote, then call create_compose_widget } I'd be fine then replacing these 3 on_ calls with closures as signal handlers, if that makes sense. I think the on_*_message_action calls could be refactored as well using a similar technique. But I don't think all six could be refactored to use a single common helper method without some additional flags that would probably overcomplicate the problem.
Created attachment 289002 [details] [review] Allow select-reply through message menu It turns out that it's fairly easy to send all six calls through the same path. I've added a commit explaining what's going on at the beginning; I can also try to explain the logic if you think it's not obvious. If I were writing this from scratch, I'd probably use closures, but I don't think there's much of an advantage in replacing the method calls now.
Review of attachment 289002 [details] [review]: Very nice. Commit!
Attachment 289002 [details] pushed as da881c3 - Allow select-reply through message menu