[geary/wip/747627-drafts-not-saved-0.11: 2/4] Update Close and Save button state as draft status changes. Bug 747627.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/747627-drafts-not-saved-0.11: 2/4] Update Close and Save button state as draft status changes. Bug 747627.
- Date: Thu, 15 Dec 2016 00:19:49 +0000 (UTC)
commit 2d94dd0091726e44e76fc5bec993ad6c3bd3aa5f
Author: Michael James Gratton <mike vee net>
Date: Tue Sep 20 11:25:51 2016 +1000
Update Close and Save button state as draft status changes. Bug 747627.
* src/client/composer/composer-widget.vala (ComposerWidget): Disable
the Close and Save button when closing the draft manager, enable it and
managed its visibility when opening the manager.
src/client/composer/composer-widget.vala | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala
index 3363fd0..62c502d 100644
--- a/src/client/composer/composer-widget.vala
+++ b/src/client/composer/composer-widget.vala
@@ -1377,11 +1377,14 @@ public class ComposerWidget : Gtk.EventBox {
throws Error {
this.draft_save_text = "";
yield close_draft_manager_async(cancellable);
-
- if (!account.information.save_drafts)
+
+ Gtk.Action close_and_save = this.actions.get_action(ACTION_CLOSE_SAVE);
+ if (!this.account.information.save_drafts) {
+ close_and_save.set_visible(false);
return;
-
- draft_manager = new Geary.App.DraftManager(account);
+ }
+
+ this.draft_manager = new Geary.App.DraftManager(account);
try {
yield this.draft_manager.open_async(editing_draft_id, cancellable);
} catch (Error err) {
@@ -1392,9 +1395,13 @@ public class ComposerWidget : Gtk.EventBox {
throw err;
}
connect_to_draft_manager();
+
+ close_and_save.set_visible(true);
+ close_and_save.set_sensitive(true);
}
private async void close_draft_manager_async(Cancellable? cancellable) throws Error {
+ this.actions.get_action(ACTION_CLOSE_SAVE).set_sensitive(false);
if (this.draft_manager == null)
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]