Use a Gtk.InfoBar for displaying the draft button.
* src/client/conversation-viewer/conversation-message.vala: Add draft
infobar template child, edit_draft signal. Remove unused draft-related
code.
(ConversationMessage::ConversationMessage): Add new is_draft ctor
param, when true show the draft infobar.
(ConversationMessage::on_draft_response): New handler for when the edit
draft button on the infobar is clicked.
* src/client/conversation-viewer/conversation-viewer.vala: Remove
edit_draft signal, make a lame attemppt to work out if a message is a
draft and pass that through to ConversationMessage.
* src/client/application/geary-controller.vala: Hook up on_edit_draft
handler to added conversation messages.
* ui/conversation-message.ui: Added draft infobar.
* src/client/conversation-viewer/conversation-message.vala: Add template
child widgets for displayed attachment UI, add signal for when user
activates an attachment.
(ConversationMessage::ConversationMessage): Ensure the attachment UI
is visible when there are displayed attachments.
(ConversationMessage::start_loading): New method for async loading of
message content, use just for attachments for now.
(ConversationMessage::on_attachments_view_activated): Handle activation
signal for specific attachments.
(ConversationMessage::load_attachments): Load attachments from the
message into the new UI.
(ConversationMessage::load_attachment_icon): Load icons for the
attachments UI from the attachment itself if an image, else from the
icon theme.
* src/client/application/geary-controller.vala: Hook up
attachment_activated signal to conversation messages.
* src/client/conversation-viewer/conversation-viewer.vala
(ConversationViewer::add_message): Ensure message loading starts after
new conversation messages are added to the window hierarchy.
* ui/conversation-message.ui: Add an attachments box, with an icon view
for displayed attachments.
* src/client/components/main-window.vala: Adjust theme CSS style to
account for new widget classes. Fix style for last row in the convo
listbox.
* src/client/conversation-viewer/conversation-message.vala: Decouple
updating message state and updating message flags. Prefix CSS classes
with "geary_" to prevent class name clashes.
* src/client/conversation-viewer/conversation-viewer.vala: Manually
maintain a CSS class on the last row of the convo listbox to work
around Bug 764710. Prefix CSS classes with "geary_" to prevent class
name clashes.
(ConversationViewer::on_update_flags): Renamed from update_flags since
it is only ever called as a signal handler. Remove most of the work -
it is now done by ConversationMessage.
Having two buttons means we don't need to change the image and handler
when clicked, just manage their visbility.
* src/client/conversation-viewer/conversation-message.vala
(ConversationMessage): Add both a star and unstar template child,
update their state as the message's state changes.
* ui/conversation-message.ui: Rename flag button to "star", add new
unstar button.
* src/client/conversation-viewer/conversation-message.vala
(ConversationMessage::ConversationMessage): Remove old "empty" theme CSS
class, just set header boxes to be visible when setting their text.
* ui/conversation-message.ui: Default header box visibility to off.
* ui/conversation-message.ui: Split out preview labels from existing
header box and create a new preview box for them.
* src/client/components/main-window.vala (MainWindow::set_styling): Use
style-defined names to allow us to specify message row backgrounds better.
* src/client/conversation-viewer/conversation-message.vala
(ConversationMessage): Update GTK composite template children
properties and visible state when showing/hiding the body, set new
preview/header box label texts.
* src/client/conversation-viewer/conversation-viewer.vala
(ConversationViewer::do_embedded_composer,
ConversationViewer::add_message): Don't add 'frame' class to conversation
list rows, we're styling it explicitly now.
Use a GtkInfoBar to display to the user the message and related buttons
instead of the message-inline HTML approach. Still needs some additional
work to save per-message loading and displaying images from same sender
in convo when "Always Show" is chosen.
* src/client/conversation-viewer/conversation-message.vala: Reenable
remote image related code, remove HTML-based UI management code.
* src/client/components/main-window.vala (MainWindow::set_styling):
Add some theme CSS to style the remote images infobar.
* ui/conversation-message.ui: Add the remote images infobar.
The embedded composer is now added to the the conversation list
box. Still needs some work to fix focus and scrolling issues, also to
insert the composer in the right place in the list.
* src/client/components/main-window.vala (MainWindow::set_styling):
Adjust theme CSS to make padding around embedded coposer not so
terrible. Fix style for embedded headerbar.
* src/client/composer/composer-embed.vala: Don't attempt to up-manage
it's parent's state, since the parent has a much better idea of how
best to do that. Instead of passing in a ConversationViewer, just pass
in a Gtk.ScrolledWindow that needs to be adjusted as the embededded
editor and add some signals needed by the ConversationViewer. Reenabled
some code needed to get scroll event passthrough working.
* src/client/conversation-viewer/conversation-viewer.vala: Remove old
embedded composer code. Adjust conversation_listbox callbacks to handle
the embedded composer being present.
(ConversationViewer::get_selected_message): Fixed to actually return a
message.
(ConversationViewer::do_embedded_composer): New method to set up an
embedded composer.
* src/client/application/geary-controller.vala
(GearyController::create_compose_widget_async): Call new
ConversationViewer::do_embedded_composer to let it set up a new
embedded composer when needed.
Display attached+un-embedded composer as an additional ConversationViewer
stack page, although it realy should be broken as its own top-level
widget - there's already too much state in ConversationViewer.
* src/client/conversation-viewer/conversation-viewer.vala: Remove old
composer boxes code. Add new ViewState enum, property and methods to
define and manipulate the current view state - either conversation or
composer.
(do_conversation): New method to put the viewer in conversation mode.
(do_compose): New method to put the viewer in compose mode, hook up the
composer widget, and handle ConversationListView selection management
for now.
(on_folder_selected, on_conversation_count_changed,
on_conversations_selected): Ensure these methods do the right thing
depending on the viewer's current view state.
(set_paned_composer): Replaced by ::do_compose, fixed call sites.
(show_multiple_selected): Minor code clean up - moved down to a more
appropriate location.
* src/client/composer/composer-box.vala (ComposerBox): Don't attempt to
up-manage it's parent's state, since the parent has a much better idea
of how best to do that. Likewise move code to manage previous
ConversationList selection out, provide signal so the a more
appropriate class can manage it instead.
* src/client/composer/composer-container.vala: Add some method comments.
* ui/conversation-viewer.ui: Add new page to the stack for the composer.
Requires GTK+ 3.12.
* src/client/conversation-viewer/conversation-message.vala
(ConversationMessage::link_selected): Added to pass through successful
link clicks to the message_viewer, hook it up to the web_view.
(ConversationMessage::load_message_body): Hook up WebKit event handler
for when links are clicked, so phishing links can be intercepted.
(ConversationMessage::on_link_clicked_self): Use a popover to display
phishing warning, recursively check link's offset parent's when
calculating box position, escape link text/href before using it as
markup.
* src/client/conversation-viewer/conversation-viewer.vala
(ConversationViewer::add_message): Ensure unhandled mouse clicks o the
web_view are not used to activate the message's ListBoxRow.
* ui/conversation-message.ui: Add popover (GTK+ 3.12) for phishing links.
* src/client/conversation-viewer/conversation-viewer.vala: Convert to a
GtkStack. Use a GTK template for constructing the UI. Remove WebView
and any DOM-related code. Replace the enum DisplayMode and hence the
HTML spinner and HTML user message with widgets in the stack. Remove
all menus since they're all message specific and will need to be
re-implemented for ConversationViewer. Comment out composer related
code for the moment.
* src/client/application/geary-controller.vala
(GearyController::conversations_selected): Make both conversations and
current_folder arguments non-nullable, since it doesn't make any sense
for there not to be any and simplifies handler impls.
(GearyController::on_conversations_selected): Don't fire when there
isn't a current folder.
* src/client/components/main-window.vala (MainWindow::set_styling): Add
CSS theme code for the the conversation message list.
(MainWindow::create_layout): Remove GtkFrame, just add the
ConversationViewer instance directly.
* ui/conversation-viewer.ui: New GtkBuilder template for
ConversationViewer, implemented as a GtkStack containing widgets for
displaying the loading spinner, conversation as a GtkListBox, and label
for user messages.
* ui/CMakeLists.txt, po/POTFILES.in: Added new UI files.
The new widget is designed to be added to a ListBox like container, and
can display both a summary and the complete message, a'la the traditional
Geary ConversationView.
Most features are currently disabled, but it does handle hiding/showing
the message body using a single WebKit.WebView. All code from
ConversationViewer relating to DOM manipulation as been copied over, all
but that which was needed to display the message has been commentd out.
* src/client/conversation-viewer/conversation-message.vala: Source code
for new widget.
* src/client/components/main-window.vala: Add CSS theme code for
ConversationMessage.
* ui/conversation-message.ui: GtkBuilder template for new widget.
* ui/conversation-message-menu.ui: GtkBuilder for the message menu. This
is a separate file since GTK+ 3.10 doesn't support GtkPopoverMenu and I
can't build it using Glade otherwise.
* src/CMakeLists.txt: Added new source file.
* po/POTFILES.in, ui/CMakeLists.txt: Added new UI files.
* src/client/composer/composer-widget.vala (ComposerWidget): Add action
and callback that simply does a normal attachment for now.
* ui/composer-widget.ui: Add insert image button to the composer toobar.
* src/client/application/geary-application.vala (GearyApplication): Set
the resource_base_path to comply with the expected modern app id, so
the app menu will be automatically loaded.
* ui/CMakeLists.txt: Replace app_menu.interface with gtk/menus.ui. Don't
try ot copy interface files now that there aren't any.
* gtk/menus.ui: Replaces app_menu.interface.
Now using these instead of the old composer's actions. This led to quite
some changes:
* Use GLib.ActionEntry instead of Gtk.ActionEntry in
composer-widget.vala
* Action names can now be specified in the UI files.
* Use templates for the ComposerHeaderBar. Remove
Pillbar as superclass, since that was no longer necessary.
* Merge ComposerToolbar into ComposerWidget.
* Since actions can now be parameterized, some methods could be
merged (e.g. font size methods).
* The menu button in the composer now automatically uses a popover.
* Some methods and classes really deserved more comments.
* necessary POTFILES.in changes
Signed-off-by: Niels De Graef <nielsdegraef@gmail.com>
Bug 720335
* src/client/composer/spell-check-popover.vala
Implemented a GtkPopover allowing the user to select a
subset of the currently installed dictionaries for the spell
checking in the composer widget.
* src/client/util/util-international-vala
Added detection of installed dictionaries and proper
translation of the available languages. This requires
Enchant as an additional dependency.
* src/client/application/geary-config.vala
Added keys spell-check-visible-languages and
spell-check-languages in GSettings.
* src/client/application/geary-controller.vala
(GearyController::create_actions): Remove uneeded calls to
add_accelerator - just remove them for dups ot move them to the action
definition. Ensure they are defined in accelerators.ui so they are
bound to their accelerators regarcdless of having a visible proxy.
Bug 764812
* src/client/components/main-window.vala (MainWindow::set_styling): Merge
CSS blocks. Fix Gtk.Frame styling rules for Gtk3.20, making them also
apply to the frame's border node instead of the frame node. Remove
redundant rules. Add a prefix for CSS class names so to avoid name
collisions.
* src/client/composer/composer-box.vala (ComposerBox::ComposerBox): Add a
CSS class to the composer box, add prefix to the full-pane class.
* ui/composer.glade: Add a class to the composer's frame so that can be
styled.
* src/CMakeLists.txt: Bump target GLib to min required for
GtkTemplate. Pass resources XML file to valac.
* ui/CMakeLists.txt: Copy both the generated resources XML file and the
resources themselves to the CMake binary directory, since valac expects
the UI files to be in the same directory as the resource XML.
* debian/control: Chase GLib version bump.
First, create a composer action corresponding to the app menu, instead
of reusing the one from the controller. Second, create the menu from a
MenuModel, instead of from a UIManager, so we can have many of them.
https://bugzilla.gnome.org/show_bug.cgi?id=746504
This ensures that we only have a single close button for the main window
at any time, and it always closes the whole application. The composer
gets a default close button only when detached.
The orientation is set in the preferences dialog. There are new
configuration keys to track the pane positions, and a bit of code that
will set them the first time based on the current settings.
https://bugzilla.gnome.org/show_bug.cgi?id=714793
If the server supports sending and receiving messages from additional
email addresses, those addresses can now be added to Geary. It will
allow the user to send new messages and replies from those additional
addresses and recognizes them as "Me" in the conversation list.