From d6b2677825cbb423e2099563c16321c3e23d7899 Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Sun, 20 Nov 2011 15:50:38 +0100 Subject: Imported Upstream version 0.3.1 --- src/themes/theme.vala | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/themes/theme.vala') diff --git a/src/themes/theme.vala b/src/themes/theme.vala index fa6f55a..284e1ef 100644 --- a/src/themes/theme.vala +++ b/src/themes/theme.vala @@ -71,8 +71,6 @@ public class Theme : GLib.Object { this.inactive_slice_layers = new Gee.ArrayList(); this.directory = dir; - - this.load(); } ///////////////////////////////////////////////////////////////////// @@ -80,7 +78,7 @@ public class Theme : GLib.Object { /// explicitly. ///////////////////////////////////////////////////////////////////// - public void load() { + public bool load() { this.center_layers.clear(); this.active_slice_layers.clear(); this.inactive_slice_layers.clear(); @@ -90,15 +88,15 @@ public class Theme : GLib.Object { Xml.Doc* themeXML = Xml.Parser.parse_file(path); if (themeXML == null) { - warning("Error parsing theme: \"" + path + "\" not found!"); - return; + warning("Failed to add theme: \"" + path + "\" not found!"); + return false; } Xml.Node* root = themeXML->get_root_element(); if (root == null) { delete themeXML; - warning("Invalid theme \"" + this.directory + "\": theme.xml is empty!"); - return; + warning("Failed to add theme: \"theme.xml\" is empty!"); + return false; } this.parse_root(root); @@ -107,6 +105,8 @@ public class Theme : GLib.Object { Xml.Parser.cleanup(); this.radius *= max_zoom; + + return true; } ///////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 60560a030fda3c539ff9dc1563b9926414a193da Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Sat, 21 Jan 2012 19:07:09 +0100 Subject: Imported Upstream version 0.4.0 --- src/themes/theme.vala | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/themes/theme.vala') diff --git a/src/themes/theme.vala b/src/themes/theme.vala index 284e1ef..269a574 100644 --- a/src/themes/theme.vala +++ b/src/themes/theme.vala @@ -55,6 +55,7 @@ public class Theme : GLib.Object { public int caption_height {get; private set; default=100;} public double caption_position {get; private set; default=0.0;} public Color caption_color {get; private set; default=new Color();} + public Icon preview_icon {get; private set; default=new Icon("gnome-pie", 36);} public Gee.ArrayList center_layers {get; private set;} public Gee.ArrayList active_slice_layers {get; private set;} @@ -82,6 +83,8 @@ public class Theme : GLib.Object { this.center_layers.clear(); this.active_slice_layers.clear(); this.inactive_slice_layers.clear(); + + this.preview_icon = new Icon(this.directory + "/preview.png", 36); Xml.Parser.init(); string path = this.directory + "/theme.xml"; -- cgit v1.2.3