Commit graph

2645 commits

Author SHA1 Message Date
Michael James Gratton
4bdffedff4 Set an explcit minimum version requirmeent for libsoup. 2016-10-04 10:58:17 +11:00
Michael James Gratton
05b320bae1 Fix possible crit loading an avatar for a cancelled conversation load. 2016-10-04 10:58:17 +11:00
Michael James Gratton
e0b956b64d Minor GTK and HTML CSS tweaks. 2016-10-04 10:58:17 +11:00
Michael James Gratton
d32676d5f5 Dismiss link popover when a link is activated. 2016-10-04 10:58:17 +11:00
Michael James Gratton
ea49c21abb Don't consider collapsed emails for find prefil/reply quoting. 2016-10-04 10:58:17 +11:00
Michael James Gratton
842dab862d Fix reply/forward toobar buttons not being enabled for search folder. 2016-10-04 10:58:17 +11:00
Michael James Gratton
755b390772 Don't re-load folder when changing to the same one. 2016-10-04 10:58:17 +11:00
Michael James Gratton
61d46ed71b Fix a possible critical error. 2016-10-04 10:58:17 +11:00
Michael James Gratton
44d2faa401 Fix a crit warning when switching folders. 2016-10-04 10:58:17 +11:00
Michael James Gratton
0a48e7b00d Fix build after shoddy rebase. 2016-10-04 10:58:17 +11:00
Michael James Gratton
2119ccdd5c Minor code tidy. 2016-10-04 10:58:17 +11:00
Michael James Gratton
4e6d072b9b Don't show info bars on show all. 2016-10-04 10:58:17 +11:00
Michael James Gratton
d157fa0472 Clean up the conversation find implementation a bit.
* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer): Move notify::search-mode-enabled handler to UI
  file, remove old unused FSM code.
2016-10-04 10:58:17 +11:00
Michael James Gratton
67fbd08691 Implement "Search for messages from" for email addresses. 2016-10-04 10:58:17 +11:00
Michael James Gratton
1fab9ad273 Tidy up conversation viewer widget signal handling a bit.
* src/client/application/geary-controller.vala: Remove unneeded manual
  conversation list and email signal disconnects - let the object's
  finalisers do it. Replace one- or two-line, single-use signal handlers
  with lambdas.

* src/client/conversation-viewer/conversation-email.vala
  (ConversationEmail): Removed signal handlers that were simply proxying
  through from ConversationMessage, update call sites to connect to the
  message's signals directly.

* src/client/conversation-viewer/conversation-message.vala: Replace one-
  or two-line, single-use signal handlers with lambdas.
2016-10-04 10:58:17 +11:00
Michael James Gratton
dca845d840 Reimplement in-conversation find.
* src/client/application/geary-controller.vala (GearyController): Remove
  ACTION_FIND_NEXT_IN_CONVERSATION and
  ACTION_FIND_PREVIOUS_IN_CONVERSATION arctions and callbacks since they
  will be taken care of by the search entry & search bar buttons, and
  remove from accelerators.ui. Add ACTION_TOGGLE_FIND action to handle
  toggling find bar in the same way as the search bar.

* src/client/components/main-toolbar.vala (MainToolbar): Add new button
  and infrastrcuture for toggling the find bar.

* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer): Convert ::conversation_page to be grid, add new
  ::conversation_scroller property for the scrollbar, update call
  sites. Add props for accessing find widgets, remove old find methods
  and add callbacks for handling find start, change, etc.

* src/client/conversation-viewer/conversation-email.vala,
  src/client/conversation-viewer/conversation-message.vala: Add methods
  for accessing selected text for find.

* src/client/conversation-viewer/conversation-listbox.vala
  (ConversationListBox::highlight_search_terms): Updated to return a flag
  specifiying whether any search results were found, and to
  expand/collapse messsages depending on whether they have any.

* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage::highlight_search_terms): Keep track of how many
  results were found, and return that.

* ui/conversation-viewer.ui: Convert conversation_page to be a grid, add
  a search bar and search widgets to it, and move conversation
  ScrolledWindow to it.
2016-10-04 10:58:17 +11:00
Michael James Gratton
1874be9424 Tidy up the ConversationListBox API for accessing reply target email.
* src/client/conversation-viewer/conversation-listbox.vala
  (ConversationListBox): Convert RO ::reply_target prop into a method,
  reimplement to use new ::get_selection_view method. Fix call sites.

* src/client/conversation-viewer/conversation-email.vala
  (ConversationEmail): Rename ::get_body_selection to
  ::get_selection_for_quoting to make it clear that what the returned
  selection is to be used for. Fix call sites.
2016-10-04 10:58:17 +11:00
Michael James Gratton
99e0f689a8 Highlight unread emails in convo viewer. 2016-10-04 10:58:17 +11:00
Michael James Gratton
b2a43bfa67 Really(?) fix DOM node crit warning when ConversationMessage finalised. 2016-10-04 10:58:17 +11:00
Michael James Gratton
a9fe56cc87 Fix ConversationListStore instances never being finalised.
* src/client/conversation-list/conversation-list-store.vala (ListStore):
  Make ::on_sort static to avoid a circular ref. Remove some signal handler
  disconnects that weren't a problem.
2016-10-04 10:58:17 +11:00
Michael James Gratton
16e3bf016b Replace the conversation list store's model on folder change.
Rather than keeping a single conversation list model instance around -
attaching and adding conversations then clearing and detaching
conversation viewers, simply remove the old model instance and add a new
one.

This also allows the ConversationListStore::is_clearing property to be
removed, fixing a related critical warning, and simply unhooking the
selection-changed signal handler instead when changing the model.

* src/client/components/main-window.vala (MainWindow): Remove props that
  are now dynamically managed. When the conversation monitor changes,
  replace the ConversationListView's model, update progress listeners.

* src/client/conversation-list/conversation-list-view.vala
  (ConversationListView): Remove list store property since the parent
  class already maintains it. Override ::get_model() and ::set_model() to
  use ConversationListStore instances, manage signals on model instances
  when they are set/unset.

* src/client/conversation-list/conversation-list-store.vala
  (ConversationListStore): Replae destructor with an explict destroy
  method that ensures the object is cleaned up enough to actualy be
  finalised. Remove use of is_clearing in ::on_selection_changed() to fix
  critical warning.
2016-10-04 10:58:17 +11:00
Michael James Gratton
b0a27c4389 Fix some bugs in AggregateProgressMonitor when removing monitors.
* src/engine/api/geary-progress-monitor.vala (ProgressMonitor): Send a
  start signal if an added monitor is already running, send a finish
  signal if in progress and the the last removed monitor is as well.
2016-10-04 10:58:17 +11:00
Michael James Gratton
94cfa29c9e Set GTK CSS classes on conversation email for sent, starred and unread. 2016-10-04 10:58:17 +11:00
Michael James Gratton
7825e90d08 (Re-)fix crash when displaying exceptionally large messages.
* src/client/conversation-viewer/conversation-web-view.vala: Go back to
  clamping the window height until some better solution is found.
2016-10-04 10:58:17 +11:00
Michael James Gratton
3d1b208327 Fix lack of padding around GMail blockquotes. 2016-10-04 10:58:17 +11:00
Michael James Gratton
9c813eaacb Replace Gtk.IconView with FlowBox for displaying email attachments. 2016-10-04 10:58:17 +11:00
Michael James Gratton
a2644f243a Fix missing space between message avatar and headers. 2016-10-04 10:58:17 +11:00
Michael James Gratton
4b862dc470 Fix compile error. 2016-10-04 10:58:17 +11:00
Michael James Gratton
9953ef3235 Fix massive memory leak due to some convo widgets never being freed. 2016-10-04 10:58:17 +11:00
Michael James Gratton
580f1b921e Fix 0px elements being rendered as 1px boxes. 2016-10-04 10:58:17 +11:00
Michael James Gratton
b03c0add14 Convert new convo widgets to use Gtk.Grid instead of Box. 2016-10-04 10:58:17 +11:00
Michael James Gratton
599da42d18 Move managing toolbar mesage buttons from convo viewer to controller.
* src/client/application/geary-controller.vala (GearyController): Update
  message button state when updating ConversationViewer state.
  (GearyController::on_conversations_selected): Move logic for handling
  different numbers of selected conversations from ConversationViewer
  here, so that message button state can be updated when the selection
  count changes.

* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer): Add ::is_composer_visible property, methods for
  showing empty/muiple conversations selected UI.
2016-10-04 10:58:17 +11:00
Michael James Gratton
edf1bf01d3 Fix inline JPEGs being corrupted when converted to data URIs.
* src/engine/rfc822/rfc822-message.vala (mime_part_to_memory_buffer):
  Only do text processing on a part's stream if UTF-8 is requested.
2016-10-04 10:58:17 +11:00
Michael James Gratton
f3f22ca5d3 Fix some inline parts not being visible.
* src/client/conversation-viewer/conversation-email.vala
  (load_attachments): Check for attachment and inline elements that have
  not been included inline and add them as attachments.

* src/engine/rfc822/rfc822-message.vala (construct_body_from_mime_parts):
  Only pass parts marked as inline to the inline replacer.
2016-10-04 10:58:17 +11:00
Michael James Gratton
640e8fdbc6 Workaround wide convo InfoBars being too wide for small screens.
* ui/conversation-email.ui, ui/conversation-message.ui: Ellipsie labels
  on InfoBars so they can shrink.
2016-10-04 10:58:17 +11:00
Michael James Gratton
425c60e0a1 Don't clobber avatar loads for second and subsequent convo loads.
* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer::load_conversations): Cancel existig loads before
  launching new avatar loads.
2016-10-04 10:58:17 +11:00
Michael James Gratton
49d3b82440 Minor code cleanup. 2016-10-04 10:58:17 +11:00
Michael James Gratton
7f3baa76b5 Fix most conversation web view height issues.
* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage): Remove ::is_loading_complete prop since it was
  neveer accurate, replace uses with ConversationWebView::is_height_valid
  instead. Hook up unset_controllable_quotes to web_view.size_allocate so
  quotes and their containers have accurate heights.

* src/client/conversation-viewer/conversation-web-view.vala
  (ConversationWebView): Make ::is_height_valid a property in case we
  want to get notify events about it in the future. Don't use an arbirary
  max hieght to determine if the HTML's height is valid, use what it
  thinks its width is instead.
2016-10-04 10:58:17 +11:00
Michael James Gratton
a7570f88f2 Ensure conversation messages min width is low enough for small screens.
* src/client/conversation-viewer/conversation-message.vala
  (AddressFlowBoxChild): Enable ellipsizing the label. Set the alignment
  so labels are correctly aligned at narrow widths. Removed some cruft.

* ui/conversation-message.ui: Ensure long words in subject are
  wrapped. Ensure there's always at least two cols for recipient address
  flow boxes.
2016-10-04 10:58:17 +11:00
Michael James Gratton
9c587bbc6f Always allow last messages in a convo to be expanded.
Sent messages will be appended last to a convo when they get synced, so
they should be able to be expanded.
2016-10-04 10:58:17 +11:00
Michael James Gratton
5ea4b0a051 Prefix CSS classes in message HTML to avoid collisions with HTML messages.
* ui/conversation-web-view.css: Prefix the names of base Geary-internal
  elements with "geary_" to reduce the odds of them colliding with class
  names in HTML messages. Chase the name changes in classes that generate
  them.

* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage): Use constants for class names and
  WebKit.DOMElement::class_list to add/remove them.
2016-10-04 10:58:17 +11:00
Michael James Gratton
b5e7c27c58 Tidy up collapsible quote container style and behaviour.
* src/client/conversation-viewer/conversation-message.vala:
  (ConversationMessage::create_quote_container): Fix unwanted whitespace
  at the top of quote containers by removing newlines from the inner
  HTML used to construct them.
  (ConversationMessage::unset_controllable_quotes): Replace using
  absolute pxiel value for determining whether a quote should be unhidden
  with a percentage of the parent container.

* ui/conversation-web-view.css: Polish and simplify quote container CSS.
2016-10-04 10:58:17 +11:00
Michael James Gratton
18621a2f7f Remove some unused/uneeded message body CSS. 2016-10-04 10:58:17 +11:00
Michael James Gratton
18c83d7bc6 Use app-driven width for conversation web view, not content-driven.
* src/client/conversation-viewer/conversation-web-view.vala: Always
  return 0 as the min/preferred width.
2016-10-04 10:58:17 +11:00
Michael James Gratton
7581f16320 Substantially rework email HTML sanitising and styling.
* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage::clean_html_markup): Ensure all displayed message
  bodies have at least a HTML element, so that the style in
  conversation-web-view.css has something to work on. Load application
  style when sanitising the HTML rather than when the web view has
  loaded.

* src/client/conversation-viewer/conversation-web-view.vala
  (ConversationWebView): Just set user style using WebKit.WebSettings,
  don't try to set application CSS, and remove all associated code.

* ui/conversation-web-view.css: Only trigger CSS 2.1 § 10.6.7 on the HTML
  element, so BODY can be styled as normal by email CSS.
2016-10-04 10:58:17 +11:00
Michael James Gratton
c75719cfe7 Port some changes over from master lost in the last rebase. 2016-10-04 10:58:17 +11:00
Michael James Gratton
440368734d Fix some critical warnings during object destruction.
* src/client/conversation-viewer/conversation-message.vala: Always
  release by setting ::context_menu_element to null after use.

* src/client/conversation-viewer/conversation-viewer.vala: Reset
  ::conversation_timeout_id after its callback has completed.
2016-10-04 10:58:17 +11:00
Michael James Gratton
6190079736 Minor conversation viewer code cleanup. 2016-10-04 10:58:17 +11:00
Michael James Gratton
020ebfd2a6 Fix jumpy focus scrolling on emails bigger than the viewport. 2016-10-04 10:58:17 +11:00
Michael James Gratton
579589f944 Make conversation viewer email flag handling a bit more null-safe. 2016-10-04 10:58:17 +11:00