From 4ea2cc3bd4a7d9b1c54a9d33e6a1cf82e7c8c21d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 23 Jul 2014 09:06:59 +0200 Subject: Imported Upstream version 0.18.1 --- plugins/common/Resources.vala | 54 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 plugins/common/Resources.vala (limited to 'plugins/common/Resources.vala') diff --git a/plugins/common/Resources.vala b/plugins/common/Resources.vala new file mode 100644 index 0000000..bcdc590 --- /dev/null +++ b/plugins/common/Resources.vala @@ -0,0 +1,54 @@ +/* Copyright 2011-2014 Yorba Foundation + * + * This software is licensed under the GNU Lesser General Public License + * (version 2.1 or later). See the COPYING file in this distribution. + */ + +namespace Resources { + +public const string WEBSITE_NAME = _("Visit the Yorba web site"); +public const string WEBSITE_URL = "https://wiki.gnome.org/Apps/Shotwell"; + +public const string LICENSE = """ +Shotwell is free software; you can redistribute it and/or modify it under the +terms of the GNU Lesser General Public License as published by the Free +Software Foundation; either version 2.1 of the License, or (at your option) +any later version. + +Shotwell 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 Lesser General Public License for +more details. + +You should have received a copy of the GNU Lesser General Public License +along with Shotwell; if not, write to the Free Software Foundation, Inc., +51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +"""; + +public const string TRANSLATORS = _("translator-credits"); + +// TODO: modify to load multiple icons +// +// provided all the icons in the set follow a known naming convention (such as iconName_nn.png, +// where 'nn' is a size value in pixels, for example plugins_16.png -- this convention seems +// pretty common in the GNOME world), then this function can be modified to load an entire icon +// set without its interface needing to change, since given one icon filename, we can +// determine the others. +public Gdk.Pixbuf[]? load_icon_set(GLib.File? icon_file) { + Gdk.Pixbuf? icon = null; + try { + icon = new Gdk.Pixbuf.from_file(icon_file.get_path()); + } catch (Error err) { + warning("couldn't load icon set from %s.", icon_file.get_path()); + } + + if (icon_file != null) { + Gdk.Pixbuf[] icon_pixbuf_set = new Gdk.Pixbuf[0]; + icon_pixbuf_set += icon; + return icon_pixbuf_set; + } + + return null; +} + +} -- cgit v1.2.3