Commit graph

87 commits

Author SHA1 Message Date
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
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
6f66b6c566 Disable some code that will break when ConversationViewer loses it web_view. 2016-10-04 10:58:17 +11:00
Michael James Gratton
69d7e242ec Remove ActionAdaptor and related code, made redundant by 17f7ec2. 2016-09-25 18:12:24 +10:00
Michael James Gratton
17f7ec265e Replace application-scoped GtkAction with GActions.
* src/client/application/geary-application.vala (GearyApplication): Move
  action names, entries and callbacks from GearyController to here. Add a
  new mailto action that expects an argument, make compose just open a
  blank composer.

* src/client/application/geary-controller.vala (GearyController): Add
  ::compose() and ::compose_mailto() methods to support app actions.
2016-09-25 01:10:07 +10:00
Michael James Gratton
6b58da6b99 Fix delay showing composer for accounts with large numbers of messages.
* src/client/application/geary-controller.vala
  (GearyController::create_compose_widget_async): Load draft manager and
  email entry completion model asynchronously after the UI has been made
  visible.

* src/client/composer/composer-widget.vala (ComposerWidget): Rename
  set_entry_completions to load_entry_completions, make loading
  async. Make open_draft_manager_async and load_entry_completions public
  so they can be invoked by the controller.

* src/client/composer/contact-list-store.vala (ContactListStore): Load
  contacts asynchronously in smaller batches, so the UI
  remains responsive.
2016-09-23 23:58:38 +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
295a14243c Convert from using AccountInformation.email to an id - client changes.
* src/engine/api/geary-account-information.vala (AccountInformation):
  Add a display_name property, use that in the client wherever a unique
  name for an account has to be shown to the user. Update all other cases
  to use `id` or `primary_mailbox`.

* src/client/accounts/add-edit-page.vala: Add id property, use that when
  determining if an account is new or is being edited.

* src/client/accounts/account-dialog-account-list-pane.vala
  (AccountDialogAccountListPane): Add the account's id to the list model,
  use that instead of the email address as the primary key.
2016-07-19 17:28:24 +10:00
Michael James Gratton
a81cc78bb0 Fix some build issues arising from user config/data dir split. Bug 741883. 2016-07-12 15:55:27 +10:00
Oskar Viljasaar
b3b2d58c76 Add a helper function to copy over configuration and use it. Bug 741883
The function is called just before the engine gets started, so
hopefully just before any files are read by Geary.
2016-07-12 15:45:11 +10:00
Oskar Viljasaar
f80f52fbe6 Use built-in GTK signals for the search bar
- Make use of the "search-changed" signal to handle user input, this
lets us get rid of the built-in timeout mechanism. This reduces the
timeout from 250ms to 150ms after user input before doing the search
though.

- Use the "activate" and "stop-search" signals for the entry. This
lets us remove our handling of key events.

https://bugzilla.gnome.org/show_bug.cgi?id=720993
2016-07-05 01:08:08 +10:00
Michael James Gratton
f8acc74eaa Make all account types support archiving. Bug 766912.
Move Geary.FolderSupport.Archive interface and implementation from
OtherFolder to GenericFolder, so both Y! and Outlook services get archive
support.

* src/client/components/main-toolbar.vala
  (MainToolbar::update_trash_button): Renamed from
  update_trash_archive_buttons, only bother to update the archive
  state. Update call sites.

* src/engine/api/geary-account.vala (Geary.Account): Remove
  can_support_archive property and constructor arg, update subclasses to
  not pass it through.

* src/engine/imap-engine/imap-engine-generic-folder.vala (GenericFolder):
  Extend Geary.FolderSupport.Archive, copy implementation from
  OtherFolder.

* src/engine/imap-engine/other/imap-engine-other-folder.vala
  (OtherFolder): Remove Geary.FolderSupport.Archive parent class and
  implementation.
2016-06-05 18:42:10 +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
c86af16ecf Remove some more artifacts from the old gear menu. Bug 759980. 2016-05-30 00:18:24 +10:00
Michael James Gratton
66928f73f6 Enable L/M keyboard shortcut for label/moving messages. Fixes Bug 731737.
* help/C/shortcuts.page: Document new shortcuts.

* src/client/application/geary-controller.vala: Add shortcuts for copy
  and move actions.

* src/client/components/pill-toolbar.vala (PillBar::create_menu_button):
  Hook up the button's related action to invoke the button's popup menu,
  taking care not to cause an infinte loop.
  (PillBar::setup_button): Connect to the related_action's tooltip notify
  signal via a local variable rather than via the button, so it does not
  get lost when it changes for Gtk.MenuButton actions.
2016-05-29 23:25:49 +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
18755f6d7a Fix app & desktop becoming unresponsive when clicking the gear menu.
When the shell is not showing the app menu, we are adding a gear menu and
using that for the app menu to work around an issue in Mint Cinnamon
always showing a menu bar when an app menu was present. However under
gnome-shell, this causes both Geary and gnome-shell to both start fully
consuming the CPU when the gear menu was activated.

Perhaps GtkApplication{Window} was notifying or querying shell about the
state of the actions since they are in the in the "app" namespace, but
shell not knowing or caring about them was returning an error, causing
Geary to retry?

Removing the gear menu and letting GTK+ add its own app menu to the
header when shell is not showing it fixes the issue.

We could load the app_menu actions into the "win" namespace, but that
would require adding yet more workarounds (at least a duplicate
app_menu.ui file or something else similary sucky) for someone else's bug
and for users that will never see or need the fix.

Bug 759980.

* src/client/application/geary-controller.vala: Always set the
  application's app_menu.

* src/client/components/main-toolbar.vala,
  src/client/composer/composer-headerbar.vala: Remove gear menu.

* src/client/components/main-window.vala: Set show-menubar to false
  so we either get the shell managed app-menu or GTK managed one
  in the header bar.
2016-05-18 19:49:24 +10:00
Michael James Gratton
56dedd7db7 Ensure main window contents are shown when presented from application.
Bug 763961.

* src/client/application/geary-application.vala
  (GearyApplication::present): Always call show_all on the main window
  since if started hidden, it won't have had that called on it.

* src/client/application/geary-controller.vala:
  (GearyController::on_indicator_activated_application,
   GearyController::on_indicator_activated_composer,
   GearyController::on_indicator_activated_inbox): Always call show_all
  on the main window since if started hidden, it won't have had that
  called on it.
2016-05-09 09:31:38 -04:00
Adam Dingle
654e513f9c Transfer Yorba copyrights to Software Freedom Conservancy 2016-05-06 08:33:37 -04: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
d33e3e7229 Simplify icon handling a bit.
When implementing bug 765359, it appears that Geary is doing too much
work to load icons. Simplify it a bit.

* src/client/components/icon-factory.vala (IconFactory): Don't bother
  loading an application icon, it's easier and works better to just use
  an icon name where needed. Don't bother adding all of the icons/*x*
  directories to the icon theme search path, just make the icon's
  directory hierarchy follow the XDG/hicolor spec and add the base
  directory. Remove now-redundant code.

* src/client/application/geary-controller.vala: Set the default icon name
  for all geary windows.
  (GearyController:on_about()): Set the name for the icon in the About
  dialog.

* src/client/components/main-window.vala (ApplicationWindow): Don't
  bother loading icons for the window, just use the new default.

* src/client/notification/libnotify.vala: Don't bother passing the
  application icon through for error notifications, an icon name has
  already been set.

* icons/*x*/geary.png: Move to a new directory hierarchy that follows the
  hicolor spec.

* icons/CMakeLists.txt: Updated to use new paths to the icons.
2016-04-28 14:22:21 -04:00
Michael James Gratton
fe928afbdc Load UI resources as GResources, not from the file system. 2016-04-09 17:30:29 -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
Robert Schroll
32740bb151 Add label for DELETE_MESSAGE, for conversation list context menu
https://bugzilla.gnome.org/show_bug.cgi?id=746406
2015-03-18 16:34:29 -04:00
Jim Nelson
bee2cfd796 Disconnect from UI/Engine signals when closing app
This prevents a lot of extraneous (and often erroring) operations
when Geary closes, particularly due to the conversation and folder
list selections changing as items are removed.
2015-03-13 15:38:27 -07:00
Robert Schroll
5162914697 Move search entry out of header bar and into dedicated search bar 2015-03-11 18:15:30 -04:00
Robert Schroll
f33b0bd956 Split main toolbar into two halves
https://bugzilla.gnome.org/show_bug.cgi?id=743960
2015-03-11 18:15:30 -04:00
Timo Kluck
f46f0d92aa Shortcut keys for nav to next/previous conversation: Bug #714434 2015-03-05 17:23:04 -08:00
Jim Nelson
7494fa57d2 Additional debug logging at app shutdown for bug #745561
Hopefully these messages will give us some idea where in the shutdown
code the application sometimes hangs.
2015-03-05 15:55:05 -08:00
Jim Nelson
329b1350a9 Capitalize Trash in tooltip as it is cap'd elsewhere 2015-02-12 18:00:08 -08:00
Jim Nelson
29448cab65 Update copyright to 2015 2015-02-06 12:43:33 -08:00
Jim Nelson
354e2edbf8 Undo Archive/Trash/Move: Bug #721828
For now, the undo stack is 1-deep with no redo facility, which mimics
Gmail's facility.  We can consider later offering a more involved
undo stack, but would like to try this out for now and work out the
kinks before becoming more aggressive.
2015-02-05 17:57:27 -08:00
Jim Nelson
e526528543 Improved sorting and Gtk.ListStore manipulations & lookup: Bug #713190
Although this doesn't solve the problems described in the bug, there
was some perceived improvement in reducing the occurrence.  These
changes also clean up the code, being verbose about distinguishing
between sorting by sent date (i.e. the Date: header field) and
received date (i.e. in EmailProperties, i.e. IMAP's INTERNALDATE).
There was one comparator that did not have a proper stabilizer; that's
fixed here as well.
2015-02-02 17:40:31 -08:00
Robert Schroll
787e92e731 Host new composers in ComposerBox, not in ComposerEmbed
This allows us to avoid messing with the state of the conversation
viewer when we're composing a new message.  Instead, we hide it
completely and show only the ComposerBox.

The styling of paned composer is changed to resemble that of the inline
composers. Because of restrictions on what styles are available for
various widgets, the ComposerBox becomes a Gtk.Frame, and its border
simulates the margin while some padding and an inset shadow simulate the
border. I haven't figured out how to do an outset box-shadow.

https://bugzilla.gnome.org/show_bug.cgi?id=743670
2015-02-02 16:38:28 -05:00
Jim Nelson
d4cc681e91 Retry commands properly if connection lost: Bug #714540
If a command fails due to a hard error (connection dropped, network
loss, etc.), the command is preserved in the in-memory Folder queue
and retried when the connection is reestablished.  This makes Geary
more robust and resistant to simple errors due to connection loss,
i.e. archiving a message and having it return later because the
archive command was dropped and, when the connection reestablished,
the message "reappears" because it's still on the server.

Note that this is *not* offline mode or a replacement for it, merely
a way to make Geary more robust when a user's connection is flaky.
2015-01-26 17:07:10 -08:00
Jim Nelson
ed5914e468 Improved connection reestablishment for IMAP folders: Bug #713972
This patch drastically improves network connection handling and
reestablishment.  In particular, the ImapEngine.Folder's open_count
wasn't always properly maintained (in the engine and the client)
causing connection reestablishment issues.  Also, prior code attempted
to deduce when to reestablish a connection based on the type of Error
encountered.  Now, as long as the Folder's open_count is greater than
zero, reestablishment will be attempted (with a back-off algorithm and
special cases in the ClientSessionManager preventing continual login,
i.e. when credentials are bad).

ClientSessionManager also has a back-off algorithm when it's adjusting
its session pool and uses the NetworkMonitor to detect when the host
is simply unavailable due to the network being unavailable (to prevent
continuous retries).

In addition to the above bug, this patch solves the following tickets:
  Bug #714595
  Bug #725959
  Bug #712960
2015-01-22 17:11:39 -08:00
Robert Schroll
09582736b8 Properly restore state of drafts
We do this heuristically, by noting which messages it is in reply to and
seeing if it matches the unmodified reply or reply all states.  This
isn't perfect; notably forwarded messages are picked up.

We hide the existing draft in the conversation viewer as soon as we open
the composer.  We also ensure that future versions of this draft will
also be hidden.  The list of emails to be hidden is cleared when the
conversation viewer is, so we query all open composers at this point to
see which email ids should be hidden.

https://bugzilla.gnome.org/show_bug.cgi?id=743067
2015-01-16 16:39:19 -08:00
Robert Schroll
2d1d2ed31c Allow quotes from multiple messages in a single reply
When replying to a message, we use the existing inline composer if it
already references the message we're replying to, or if we're replying
with a quote.  Replies without quotes get made into new composers.

When adding a new message as a reply in a composer, we add the relevant
addresses to the to and cc lines, based on the current reply type.  We
remove duplicates, and don't include any to addresses as cc.  We also
keep track of a total to and total cc list, which gets swapped in if a
reply action is to change the reply type.

We keep track of all the replied-to message ids and include all of them
in the In-Reply-To header.  However, the References header only includes
message ids from the first message replied to.  This is because RFC 2822
requires this header to represent a single lineage, which we cannot
guarantee if we're replying to different branches of the conversation.
2015-01-14 13:18:21 -08:00
Robert Schroll
4b644cc4bd Allow only a single inline composer at a time
Also, set the detached state after creating the window to get the
toolbar in the correct state.
2015-01-14 13:18:21 -08:00
Jim Nelson
09a15914da Update Archive/Trash/Delete/Empty buttons on toolbar: Bug #742686
With the Empty button now attached to Archive/Trash/Delete, it's now
less lopsided for only Archive to have a label.  This removes the
label from Trash/Delete (which also makes it more innocuous when the
user presses Shift a lot, i.e. while editing in the inline composer),
which in turns simplifies building the main toolbar.
2015-01-13 14:42:34 -08:00
Jim Nelson
260436e92c Empty Trash and Empty Spam: Bug #714809, Bug #725260
Trash and Spam folders may now be emptied by Geary.  A user warning is
presented, as the operation cannot be undone and deletes mail on the
server, not just locally.
2015-01-13 13:48:16 -08:00
Jim Nelson
533ab75ee3 Improved search experience: Bug #720361
This introduces a new full-text search algorithm that attempts to
curb the effects of overstemming in the Porter Snowball stemmer.
The FTS table will be regenerated with this update.

The crux of this new algorithm is a configurable heuristic that
reduces stemmed matching.  The configuration is not available via the
UI (I suspect it will only confuse users) but can be changed by power
users via GSettings.  More information is available at:

https://wiki.gnome.org/Apps/Geary/FullTextSearchStrategy
2014-12-16 12:26:31 -08:00
Robert Roth
86316e18bd Use common icon names and "mail-" prefix: Bug #713454 2014-10-28 13:20:00 -07:00
Robert Schroll
da881c3262 Allow select-reply through message menu
Only use selection as quote if it is in the message whose message menu
was used.

https://bugzilla.gnome.org/show_bug.cgi?id=738187
2014-10-24 08:36:38 -04:00
Jim Nelson
9013140c70 Present Welcome dialog if Geary re-run while visible: Bug #720360
If the Welcome dialog (used to create the initial account) is visible
and Geary was re-run, an empty main window would appear.  This is due
to the Welcome dialog hiding the main window until the first account
is created.  Now, if Geary is re-run the Welcome dialog is presented
to the user.

This may possibly solve bug #737811.
2014-10-21 15:00:23 -07:00
Robert Schroll
db6b48ed26 Add selected text as quote in existing reply
This happens only if it's not changing the reply type.  This helps in
the case where you are switching the reply and haven't de-selected text
that was previously quoted.

https://bugzilla.gnome.org/show_bug.cgi?id=712912
2014-10-08 18:02:40 -04:00
Robert Schroll
fac79c7fed Use selected text in quotes when available
https://bugzilla.gnome.org/show_bug.cgi?id=712912
2014-10-08 18:02:40 -04:00
Robert Schroll
4d38f66ecb Choose the message to reply to based on selection
If part of a message is selected, that will be the replied-to message.
If parts of multiple messages are selected, or nothing is selected, the
last email will be replied to.

https://bugzilla.gnome.org/show_bug.cgi?id=712912
2014-10-08 18:02:40 -04:00
Robert Schroll
9f37ef720f Check for inline composers before archive or trash
https://bugzilla.gnome.org/show_bug.cgi?id=733340
2014-08-31 23:33:57 -04:00
Robert Schroll
44d6e2a4dd Check for inline compositions before switching conversation from notification
https://bugzilla.gnome.org/show_bug.cgi?id=733430
2014-08-31 23:33:57 -04:00