diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-04-18 15:42:59 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-04-18 15:42:59 +0200 |
commit | 84a27086bbd9f493128b354300f9c77ccb32a56b (patch) | |
tree | 977cb323f0ac6953f10bc20d84f45ebd5a6d4535 /src/pies/save.vala | |
parent | b683ce2789d95b2e9f221e75adc30efd91cfb901 (diff) |
Imported Upstream version 0.6.0upstream/0.6.0
Diffstat (limited to 'src/pies/save.vala')
-rw-r--r-- | src/pies/save.vala | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/pies/save.vala b/src/pies/save.vala index 60fc0b2..9760cce 100644 --- a/src/pies/save.vala +++ b/src/pies/save.vala @@ -1,25 +1,25 @@ -/* -Copyright (c) 2011 by Simon Schneegans - -This program is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the Free -Software Foundation, either version 3 of the License, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -more details. - -You should have received a copy of the GNU General Public License along with -this program. If not, see <http://www.gnu.org/licenses/>. -*/ +///////////////////////////////////////////////////////////////////////// +// Copyright (c) 2011-2015 by Simon Schneegans +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or (at +// your option) any later version. +// +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. +///////////////////////////////////////////////////////////////////////// using GLib.Math; namespace GnomePie { -///////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////// /// A helper method which saves pies in a configuration file. ///////////////////////////////////////////////////////////////////////// @@ -28,23 +28,23 @@ namespace Pies { ///////////////////////////////////////////////////////////////////// /// Saves all Pies of the PieManager to the pies.conf file. ///////////////////////////////////////////////////////////////////// - + public void save() { message("Saving Pies to \"" + Paths.pie_config + "\"."); - + // initializes the XML-Writer var writer = new Xml.TextWriter.filename(Paths.pie_config); writer.set_indent(true); writer.start_document("1.0"); writer.start_element("pies"); - + // iterate through all Pies foreach (var pie_entry in PieManager.all_pies.entries) { var pie = pie_entry.value; - + // if it's no dynamically created Pie if (pie.id.length == 3) { - int slice_count = 0; + int slice_count = 0; // write all attributes of the Pie writer.start_element("pie"); @@ -52,7 +52,7 @@ namespace Pies { writer.write_attribute("id", pie.id); writer.write_attribute("icon", pie.icon); writer.write_attribute("hotkey", PieManager.get_accelerator_of(pie.id)); - + // and all of it's Actions foreach (var group in pie.action_groups) { // if it's a custom ActionGroup @@ -67,14 +67,14 @@ namespace Pies { writer.write_attribute("command", action.real_command); writer.write_attribute("quickAction", action.is_quickaction ? "true" : "false"); writer.end_element(); - + ++ slice_count; } } else { writer.start_element("group"); writer.write_attribute("type", GroupRegistry.descriptions[group.get_type().name()].id); writer.end_element(); - + slice_count += group.actions.size; } } |