[geary] Fix compilation for Gtk3.14 and older setups. Bug 775452
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary] Fix compilation for Gtk3.14 and older setups. Bug 775452
- Date: Tue, 6 Dec 2016 05:00:29 +0000 (UTC)
commit d4acac034d597fdc17c621001a4ebf6442b65839
Author: Gautier Pelloux-Prayer <gautier+git damsy net>
Date: Thu Dec 1 15:58:12 2016 +0100
Fix compilation for Gtk3.14 and older setups. Bug 775452
src/client/components/main-window.vala | 7 ++++++-
src/client/components/search-bar.vala | 3 ---
src/client/composer/composer-widget.vala | 17 ++++++++++++-----
src/client/composer/spell-check-popover.vala | 2 +-
.../conversation-viewer/conversation-message.vala | 4 ++--
src/client/util/util-date.vala | 2 +-
6 files changed, 22 insertions(+), 13 deletions(-)
---
diff --git a/src/client/components/main-window.vala b/src/client/components/main-window.vala
index 6dbf84e..8842aa9 100644
--- a/src/client/components/main-window.vala
+++ b/src/client/components/main-window.vala
@@ -145,7 +145,12 @@ public class MainWindow : Gtk.ApplicationWindow {
else
debug("Error parsing css on lines %u-%u: %s", start, end, error.message);
});
- provider.load_from_resource(@"/org/gnome/Geary/geary.css");
+ try {
+ File file = File.new_for_uri(@"resource:///org/gnome/Geary/geary.css");
+ provider.load_from_file(file);
+ } catch (Error e) {
+ error("Could not load CSS: %s", e.message);
+ }
}
private void setup_layout(Configuration config) {
diff --git a/src/client/components/search-bar.vala b/src/client/components/search-bar.vala
index 4275a00..4cbd90d 100644
--- a/src/client/components/search-bar.vala
+++ b/src/client/components/search-bar.vala
@@ -24,9 +24,6 @@ public class SearchBar : Gtk.SearchBar {
search_entry.search_changed.connect(() => {
search_text_changed(search_entry.text);
});
- search_entry.stop_search.connect(() => {
- search_entry.text = "";
- });
search_entry.activate.connect(() => {
search_text_changed(search_entry.text);
});
diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala
index 16939b5..9f64f9a 100644
--- a/src/client/composer/composer-widget.vala
+++ b/src/client/composer/composer-widget.vala
@@ -714,6 +714,17 @@ public class ComposerWidget : Gtk.EventBox {
}
}
+ // This code is in a separate method due to https://bugzilla.gnome.org/show_bug.cgi?id=742621
+ // connect_to_draft_manager() is simply for symmetry. When above bug is fixed, this code can
+ // be moved back into open/close methods
+ private void disconnect_from_draft_manager() {
+ this.draft_manager.notify[Geary.App.DraftManager.PROP_DRAFT_STATE]
+ .disconnect(on_draft_state_changed);
+ this.draft_manager.notify[Geary.App.DraftManager.PROP_CURRENT_DRAFT_ID]
+ .disconnect(on_draft_id_changed);
+ this.draft_manager.fatal.disconnect(on_draft_manager_fatal);
+ }
+
/**
* Creates and opens the composer's draft manager.
*/
@@ -1433,11 +1444,7 @@ public class ComposerWidget : Gtk.EventBox {
if (this.draft_manager == null)
return;
- this.draft_manager.notify[Geary.App.DraftManager.PROP_DRAFT_STATE]
- .disconnect(on_draft_state_changed);
- this.draft_manager.notify[Geary.App.DraftManager.PROP_CURRENT_DRAFT_ID]
- .disconnect(on_draft_id_changed);
- this.draft_manager.fatal.disconnect(on_draft_manager_fatal);
+ disconnect_from_draft_manager();
// drop ref even if close failed
try {
diff --git a/src/client/composer/spell-check-popover.vala b/src/client/composer/spell-check-popover.vala
index 5b40d89..0ff1287 100644
--- a/src/client/composer/spell-check-popover.vala
+++ b/src/client/composer/spell-check-popover.vala
@@ -62,7 +62,7 @@ public class SpellCheckPopover {
if (country_name != null)
label_text += " (" + country_name + ")";
Gtk.Label label = new Gtk.Label(label_text);
- label.set_xalign(0.0f);
+ GtkUtil.set_label_xalign(label, 0.0f);
label.set_size_request(-1, 24);
box.pack_start(label, false, false);
diff --git a/src/client/conversation-viewer/conversation-message.vala
b/src/client/conversation-viewer/conversation-message.vala
index bd3f545..03f8840 100644
--- a/src/client/conversation-viewer/conversation-message.vala
+++ b/src/client/conversation-viewer/conversation-message.vala
@@ -58,7 +58,7 @@ public class ConversationMessage : Gtk.Grid {
Gtk.Label primary = new Gtk.Label(null);
primary.ellipsize = Pango.EllipsizeMode.END;
- primary.set_xalign(0.0f);
+ GtkUtil.set_label_xalign(primary, 0.0f);
primary.get_style_context().add_class(PRIMARY_CLASS);
if (type == Type.FROM) {
primary.get_style_context().add_class(FROM_CLASS);
@@ -70,7 +70,7 @@ public class ConversationMessage : Gtk.Grid {
Gtk.Label secondary = new Gtk.Label(null);
secondary.ellipsize = Pango.EllipsizeMode.END;
- secondary.set_xalign(0.0f);
+ GtkUtil.set_label_xalign(secondary, 0.0f);
secondary.get_style_context().add_class(Gtk.STYLE_CLASS_DIM_LABEL);
secondary.set_text(address.address);
address_parts.add(secondary);
diff --git a/src/client/util/util-date.vala b/src/client/util/util-date.vala
index 57cd1fc..a1ec7e9 100644
--- a/src/client/util/util-date.vala
+++ b/src/client/util/util-date.vala
@@ -164,7 +164,7 @@ private string pretty_print_coarse(CoarseDate coarse_date, ClockFormat clock_for
return _("Now");
case CoarseDate.MINUTES:
- return ngettext("%dm ago", "%dm ago", (ulong) (diff / TimeSpan.MINUTE)).printf(diff /
TimeSpan.MINUTE);
+ return ngettext("%dm ago", "%dm ago", (ulong) (diff / TimeSpan.MINUTE)).printf((int) (diff /
TimeSpan.MINUTE));
case CoarseDate.HOURS:
int rounded = (int) Math.round((double) diff / TimeSpan.HOUR);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]