Commit graph

18 commits

Author SHA1 Message Date
Michael Gratton
29042bb2d8 Move composer classes into their own namespace
Rename all composer classes prefixed with "Composer" so that the prefix
is a namespace instead. This increases the compartmentalisation of the
classes, making `internal` a useful member modifier and makes them
consistent with the code style guide.
2019-11-17 20:00:02 +11:00
Michael Gratton
8000e7ca63 Implement undo support for the composer's text entries
Add EntryUndo objects for each of the To, CC, BCC, Reply-To and subject
entries. Fix EmailEntry to ensure that keyboard shortcuts get processed
when the completion is present. Fix ContactEntryCompleteion to ensure
it does a precision edit when inserting an adresss (i.e. delete+insert
rather than complete replacement) so that it integrates into undo.

Fixes #233
2019-11-07 13:01:16 +11:00
Michael Gratton
cc27bae792 Convert composer email autocomplete to use search for matching
Populate ContactListStore using Geary.ContactStore.search. Simplify
ContactEntryCompletion greatly.
2019-06-13 16:56:03 +10:00
Kristian Klausen
48c93655cf Remove trailing whitespace
find . -name '*.vala' -type f -exec sed -i 's/ *$//g' {} +
The following files was ignored:
test/client/composer/composer-web-view-test.vala
test/engine/util-html-test.vala

Fix #271
2019-02-28 23:05:31 +01:00
Michael James Gratton
7073206c8d Fix client use of MailboxAddress(es).to_rfc822_string().
Turns out the client was in inexplicably using
MailboxAddresses.to_rfc822_string() in a bunch of places to display
emails to users, mostly in the composer. This fixes that.

Followup to b7eea857.

* src/engine/rfc822/rfc822-mailbox-addresses.vala (MailboxAddresses):
  Make list param for default ctor nullable for your testing convenience,
  add a test. Add to_full_display() method that the client should nearly
  always be using to display a list to users, use that in all the places.
  Remove empty param for list_to_string since all but one callers just
  pass in the empty string, which also fixes some stupid regressions
  introduced in commit 178ce351 that causes it actually break
  to_rfc822_string, rather than fix it as claimed, update call sites.
2018-02-01 23:56:23 +10:30
Michael James Gratton
57ca408c53 Fix composer UI brokenness when compiled under vala 0.36.
Don't rely ComposerState::state notify and property bindings firing when
the value hasn't actually changed to update the composer's UI. This is
works around Vala Bug 631267 landing.

* src/client/composer/composer-headerbar.vala (ComposerHeaderbar): Add
  signal and methods to be called explicity on state changes, rather than
  relying on being notified of ComposerWidget::state changing.

* src/client/composer/composer-widget.vala (ComposerWidget): Hook up new
  ComposerHeaderbar signal and method. Remove notify and property
  bindings on ::state property, move related code to new
  ::update_composer_view method and call that as needed. Remove
  overridden ::show_all, because the UI state should now always be
  consistent with ::state. Clean up various methods.

* src/client/composer/email-entry.vala (EmailEntry::EmailEntry): Make
  widget visible by default, since we are no longer calling
  ComposerWidget::show_all().

* src/client/application/geary-controller.vala: Don't call show all on
  new composers, they now manage their visibility properly.

* ui/composer-headerbar.ui: Make toolbar icons visible by default.

* ui/composer-widget.ui: Make toolbar icons visible by default, set Send
  button icon here rather than in the class.
2017-03-04 13:45:17 +11:00
Michael James Gratton
93f65eb60c Fix a crash when sending mail to a conversartion email address.
* src/client/composer/email-entry.vala (EmailEntry::on_changed): Now that
  the completion is being lazily added, we need to check the completion
  is null before using it.
2016-10-08 17:43:21 +11: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
bbf5f073e6 RFC822 Sender header cleanup. Bug 768468.
This patch does a few things:

- Removes any notion of a sender from the Composer, since there's no UI
  for it at the moment and it doesn't do anything when multiple
  addresses are available.
- Converts Geary.Email and the DB use the RFC822 model for the Sender and
  Reply-To headers, and translates between that and the IMAP model only
  once: When dealing with IMAP ENVELOPE.
- Fixes an incorrect assumption about the Sender in the SMTP code.

* src/client/composer/composer-widget.vala (ComposerWidget): Remove all
  mentions of a sender address. Make `from` prop private for setting.

* src/client/composer/email-entry.vala (EmailEntry::validate_addresses):
  Fix crash when address list is null.

* src/engine/api/geary-email.vala (Email, Email::set_originators):
  Convert sender prop/param from a list of RFC822 addresses to a single
  address. Fix call call sites.

* src/engine/imap-db/imap-db-message-addresses.vala (MessageAddresses):
  Convert sender prop from a list of RFC822 addresses to a single
  address. Fix call call sites.
  (MessageAddresses::get_address_from_string): New method for parsing
  single addresses from the DB.

* src/engine/imap-db/imap-db-message-row.vala
  (MessageRow::flatten_address, MessageRow::unflatten_address): New
  un/marshalling methods for single addresses.

* src/engine/imap/api/imap-folder.vala (Folder::fetched_data_to_email):
  Normalise sender and reply-to IMAP ENVELOPE responses to conform with
  RFC 822's expectations.

* src/engine/imap/message/imap-envelope.vala (Envelope): Label reply_to
  prop as being non-null, to conform with IMAP spec.

* src/engine/rfc822/rfc822-mailbox-address.vala (MailboxAddress): Added
  support ctor and methods for parsing and comparing single addresses.

* src/engine/rfc822/rfc822-message.vala (Message::from_composed_email):
  Set the from and sender props directly from the ComposedEmail, set the
  GMimeMessage From and Sender headers correctly based on these.
  (Message::stock_from_gmime): Correctly set the from and sender props
  from the GMimeMessage.

* src/engine/smtp/smtp-client-session.vala
  (ClientSession::send_email_async): Don't require the email sender to be
  non-null — it isn't used and isn't required.
2016-07-25 10:40:50 +10:00
Adam Dingle
654e513f9c Transfer Yorba copyrights to Software Freedom Conservancy 2016-05-06 08:33:37 -04:00
Jim Nelson
29448cab65 Update copyright to 2015 2015-02-06 12:43:33 -08:00
Robert Schroll
6b4d841520 Deal with MailboxAddresses, not strings, in composer 2015-01-14 13:18:21 -08:00
Robert Schroll
f0b6643053 Add ability to switch reply type
The To and CC entries will be updated if none of the recipients have
been modified.  The subject will be updated (invisibly, since this will
only happen to inline or inline-compact composers, where that's hidden),
and the in_reply_to value will be set or unset appropriately.
2014-05-20 16:30:22 -07:00
Robert Schroll
a1bf7070d5 Separate composer widget from composer window
In anticipation of inline composition, we need the composer widget to be
separate from the window in which it lives.  We introduce a new
interface, ComposerContainer, that the thing that holds to
ComposerWidget must implement.

Separate composer widget from composer window

In anticipation of inline composition, we need the composer widget to be
separate from the window in which it lives.  We introduce a new
interface, ComposerContainer, that the thing that holds to
ComposerWidget must implement.

Basic inline composition

Many of the details don't work, or don't work well, but the basics are
in place.

Allow only a single inline composition at a time

With this, we introduce a dialog when you would try to add another.  We
also use this when changing the selected conversation with a composer
open.

Compose new messages inline, with no conversation selected

Hook up composer accelerators only when focus is in composer editor

It would be nice to only activate these accelerators when the composer
has focus generally, but that doesn't seem to be easy to detect.

Only disconnect accelerators if they're connected

Maintain focus when composer is popped out

The selection isn't, though.

Fix Tab focus for embedded composer

There are two things that needed to be fixed: The tab key doesn't
usually advance focus for embedded widgets (huh?), so we handle tab
presses by hand for ComposerWidgets.  Also, the EmailEntrys do their own
tab handling, which needs to know about the composer widget, not the
toplevel widget in the embedded case.

Remove close() from ComposerContainer interface

I don't think it was actually doing anything, and it conflicts with the new close() method of Gtk.Window.
2014-05-20 16:30:21 -07:00
Jim Nelson
dc1445d6f0 Update copyrights to 2014: Closes bgo#722381 2014-02-04 19:01:09 -08:00
Charles Lindsay
910e1c3d0b Update copyright headers; fix #6195
Also removing the erroneous space that had crept in at the end of the
line in most of our header comments.
2013-04-12 12:32:39 -07:00
Robert Schroll
5c98748aa0 Closes #6472 Tab selects current contact in ContactEntry
Signed-off-by: Eric Gregory <eric@yorba.org>
2013-03-06 18:43:33 -08:00
Jim Nelson
a0bafaffb2 Reorganization of client code
This is an attempt to break apart the client into suitable
categories.  The ui directory was being overloaded with every
possible UI class.  This attempts to give some organization going
forward as well as make it easier for new contributors to wade
into the code.
2012-09-07 18:55:38 -07:00
Renamed from src/client/ui/email-entry.vala (Browse further)