Commit graph

243 commits

Author SHA1 Message Date
Michael James Gratton
ea8a9c992c Reenable and update code for editing draft messages.
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.
2016-10-04 10:58:17 +11:00
Michael James Gratton
b5270e3740 Reenable and update code for displayed attachments.
* 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.
2016-10-04 10:58:17 +11:00
Michael James Gratton
9e7fee035a Tidy up ConversationMessage styling and state management.
* 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.
2016-10-04 10:58:17 +11:00
Michael James Gratton
9e9e007974 Use two different buttons in ConversationMessage to show starred state.
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.
2016-10-04 10:58:17 +11:00
Michael James Gratton
83457ca048 Make collapsed ConversationMessage message boxes a bit lighter. 2016-10-04 10:58:17 +11:00
Michael James Gratton
0f64460c90 Don't display ConversationMessage header boxes when header not present.
* 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.
2016-10-04 10:58:17 +11:00
Michael James Gratton
21be64fe01 Add attachment icon back to the message viewer. 2016-10-04 10:58:17 +11:00
Michael James Gratton
89a1dc8c88 Style the ConversationViewer user message with CSS rather than a class. 2016-10-04 10:58:17 +11:00
Michael James Gratton
d0dc003772 Clean up message header UI, tranitions and style a bit.
* 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.
2016-10-04 10:58:17 +11:00
Michael James Gratton
22e67655ac Reenable and update code for inline message image display.
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.
2016-10-04 10:58:17 +11:00
Michael James Gratton
69a53d9db9 Reenable and update code for embedded message composer.
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.
2016-10-04 10:58:17 +11:00
Michael James Gratton
5184a38fe8 Reenable and update code for attached, full pane message composer.
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.
2016-10-04 10:58:17 +11:00
Michael James Gratton
3bf173881c Renable and update code for clicking on links in messages.
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.
2016-10-04 10:58:17 +11:00
Michael James Gratton
b29d83e546 Convert ConversationViewer to a Stack with a ListBox, remove its WebView.
* 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.
2016-10-04 10:58:17 +11:00
Michael James Gratton
64aa037c04 Add new ConversationMessage widget to display a single message with a WebView.
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.
2016-10-04 10:58:17 +11:00
Michael James Gratton
8191ed4298 Add Insert Image button, action and hander to composer. Bug 712995.
* 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.
2016-10-04 10:35:49 +11:00
Michael James Gratton
e6c6e7c013 Update help text for move/label shortcuts in manual/help overlay.
Make it describe the result of the action, not the UI effect.
2016-10-04 09:54:06 +11:00
Gautier Pelloux-Prayer
87be2285ce Add shortcuts window. Bug 764926 2016-10-04 09:41:50 +11:00
Michael James Gratton
159c119b92 Ensure all new account/login placeholder text strings are translatable.
Bug 771930.
2016-09-26 16:34:42 +10:00
Piotr Drąg
0d5dd3d20a Replace single quotes with double quotes in menus.ui
Double quotes are more friendly to some l10n tools.
2016-09-24 18:13:40 +02:00
Michael James Gratton
a3e0e474e7 Use GtkApplication built-in for loading app menu.
* 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.
2016-09-25 01:05:29 +10:00
Niels De Graef
56c10aca94 Fix for the context menu. Bug 770356.
Signed-off-by: Niels De Graef <nielsdegraef@gmail.com>
2016-09-21 15:02:31 +10:00
Niels De Graef
ebd788968b Use GLib.Actions in the composer. Bug 770356.
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>
2016-09-21 15:02:18 +10:00
Michael James Gratton
521c0c4332 Set composer indent icons in UI file, now that GTK handles RTL. Bug 769533. 2016-08-06 11:40:35 +10:00
Niels De Graef
7e446b1580 Use Popover for Move/Label menu. Bug 767431.
Signed-off-by: Niels De Graef <nielsdegraef@gmail.com>
2016-06-20 15:27:41 +10:00
Michael James Gratton
2838631bd5 Add missing copyright header to ui/geary.css. Bug 767814. 2016-06-19 19:25:46 +10:00
Niels De Graef
a4b004b548 Separate CSS file and better parsing errors. Bug 767814
Signed-off-by: Niels De Graef <nielsdegraef@gmail.com>
2016-06-19 19:20:52 +10:00
Leonardo Robol
cae4b443c6 Added support to change the spell-checking language.
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.
2016-06-09 15:36:39 +10:00
Michael James Gratton
32a7f76360 Hook up attach file shortcut, add it to user guide. Bug 743565. 2016-06-09 00:21:44 +10:00
Robert Schroll
2592d7fceb Add accelerator to attach files to composer
https://bugzilla.gnome.org/show_bug.cgi?id=743565
2016-06-09 00:21:44 +10:00
Michael James Gratton
10362b5a64 Tidy up main window accelerator setup.
* 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.
2016-05-30 09:37:12 +10:00
Michael James Gratton
af94c20f9b Sort main window accelerators definition. 2016-05-30 00:40:36 +10:00
Michael James Gratton
c86af16ecf Remove some more artifacts from the old gear menu. Bug 759980. 2016-05-30 00:18:24 +10:00
Michael James Gratton
54ba285ab8 Clean up shortcuts and shortcut docs. Closes Bug 766987.
* src/client/application/geary-controller.vala: Remove prefs and accounts
  shortcuts.

* ui/app_menu.interface: Remove prefs and accounts shortcuts

* help/C/shortcuts.page: Capitalise J/K, remove prefs and accounts
  shortcuts.
2016-05-29 22:24:19 +10:00
Michael James Gratton
1886e17f38 Remove use of Gtk.Misc ::xpad and ::ypad. Bug 713991. 2016-05-21 12:45:13 +10:00
Michael James Gratton
19dde8912b Remove only remaining use of emblem-system-symbolic icon name.
Bug 765837.
2016-05-21 11:18:31 +10:00
Yosef Or Boczko
0da3cb9d26 Use margin-{start,end} instead of margin-{left,right}: Close bgo #730611 2016-05-20 16:42:45 +10:00
Michael James Gratton
8491cd50bc Remove GTK+ 3.14 check when setting widget CSS, modernise it a bit.
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.
2016-05-20 16:29:35 +10:00
Michael James Gratton
8f00a51b13 Replace Yorba links with GNOME links, remove donate menu, update dpkg blurb.
Thanks for all the fish, Yorba.

Bug 765656.
2016-05-05 07:49:27 -04:00
Michael James Gratton
119f939ec8 Enable use of GtkTemplate attributes in vala source files.
* 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.
2016-04-09 17:30:29 -04:00
Michael James Gratton
2a6120ba49 Generate GResource source code, add it to the build. 2016-04-09 17:30:29 -04:00
Michael James Gratton
298fa60d1f Remove unused message.glade UI file and references to it. 2016-04-09 17:30:29 -04:00
Robert Schroll
bbfa2c6308 Remove references to toolbar_menu.ui
https://bugzilla.gnome.org/show_bug.cgi?id=746504
2015-03-20 19:21:24 -04:00
Robert Schroll
98be06db89 Avoid critical errors when creating multiple application menus
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
2015-03-20 18:50:31 -04:00
Jim Nelson
57dec8cdba Disambiguate composer strings with gettext context: Bug #746076 2015-03-12 11:54:42 -07:00
Robert Schroll
36f316868a Provide custom close-and-save and close-and-discard buttons for composer
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.
2015-03-11 18:15:30 -04:00
Yosef Or Boczko
244c197c15 Mark another string as translatable 2015-03-11 02:35:07 +02:00
Robert Schroll
4139076509 Allow changing orientation of left paned
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
2015-03-10 19:08:59 -04:00
Charles Lindsay
12704542b3 Support multiple ("alternate") email addresses per acct: Bug #714922
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.
2015-03-04 17:26:44 -08:00
Robert Schroll
0400e431a0 Use symbolic close button on find bar
https://bugzilla.gnome.org/show_bug.cgi?id=744924
2015-02-24 21:19:43 -05:00