Commit b05381ab authored by Lucas Beeler's avatar Lucas Beeler

Improves plug-in icons. Adds service-specific icons for publishing plugins and...

Improves plug-in icons. Adds service-specific icons for publishing plugins and defines a generic plugin icon.
parent 205217ee
......@@ -182,7 +182,9 @@ ICON_FILES = \
two-stars.svg \
videos-page.png \
zoom-in.png \
zoom-out.png
zoom-out.png \
slideshow-extension-point.png \
generic-plugin.png
HELP_FILES = \
edit-adjustments.page \
......
......@@ -27,4 +27,28 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc.,
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;
}
}
......@@ -3,6 +3,13 @@ PLUGINS := \
shotwell-transitions \
shotwell-publishing
PLUGINS_RC := \
plugins/shotwell-publishing/facebook.png \
plugins/shotwell-publishing/flickr.png \
plugins/shotwell-publishing/picasa.png \
plugins/shotwell-publishing/youtube.png \
plugins/shotwell-transitions/slideshow-plugin.png
EXTRA_PLUGINS := \
shotwell-publishing-extras
......
......@@ -5,6 +5,15 @@
*/
public class FacebookService : Object, Spit.Pluggable, Spit.Publishing.Service {
private const string ICON_FILENAME = "facebook.png";
private static Gdk.Pixbuf[] icon_pixbuf_set = null;
public FacebookService(GLib.File resource_directory) {
if (icon_pixbuf_set == null)
icon_pixbuf_set = Resources.load_icon_set(resource_directory.get_child(ICON_FILENAME));
}
public int get_pluggable_interface(int min_host_interface, int max_host_interface) {
return Spit.negotiate_interfaces(min_host_interface, max_host_interface,
Spit.Publishing.CURRENT_INTERFACE);
......@@ -27,6 +36,7 @@ public class FacebookService : Object, Spit.Pluggable, Spit.Publishing.Service {
info.website_url = Resources.WEBSITE_URL;
info.is_license_wordwrapped = false;
info.license = Resources.LICENSE;
info.icons = icon_pixbuf_set;
}
public void activation(bool enabled) {
......
......@@ -5,6 +5,15 @@
*/
public class FlickrService : Object, Spit.Pluggable, Spit.Publishing.Service {
private const string ICON_FILENAME = "flickr.png";
private static Gdk.Pixbuf[] icon_pixbuf_set = null;
public FlickrService(GLib.File resource_directory) {
if (icon_pixbuf_set == null)
icon_pixbuf_set = Resources.load_icon_set(resource_directory.get_child(ICON_FILENAME));
}
public int get_pluggable_interface(int min_host_interface, int max_host_interface) {
return Spit.negotiate_interfaces(min_host_interface, max_host_interface,
Spit.Publishing.CURRENT_INTERFACE);
......@@ -27,6 +36,7 @@ public class FlickrService : Object, Spit.Pluggable, Spit.Publishing.Service {
info.website_url = Resources.WEBSITE_URL;
info.is_license_wordwrapped = false;
info.license = Resources.LICENSE;
info.icons = icon_pixbuf_set;
}
public void activation(bool enabled) {
......
......@@ -5,6 +5,15 @@
*/
public class PicasaService : Object, Spit.Pluggable, Spit.Publishing.Service {
private const string ICON_FILENAME = "picasa.png";
private static Gdk.Pixbuf[] icon_pixbuf_set = null;
public PicasaService(GLib.File resource_directory) {
if (icon_pixbuf_set == null)
icon_pixbuf_set = Resources.load_icon_set(resource_directory.get_child(ICON_FILENAME));
}
public int get_pluggable_interface(int min_host_interface, int max_host_interface) {
return Spit.negotiate_interfaces(min_host_interface, max_host_interface,
Spit.Publishing.CURRENT_INTERFACE);
......@@ -27,6 +36,7 @@ public class PicasaService : Object, Spit.Pluggable, Spit.Publishing.Service {
info.website_url = Resources.WEBSITE_URL;
info.is_license_wordwrapped = false;
info.license = Resources.LICENSE;
info.icons = icon_pixbuf_set;
}
public Spit.Publishing.Publisher create_publisher(Spit.Publishing.PluginHost host) {
......
......@@ -5,6 +5,15 @@
*/
public class YouTubeService : Object, Spit.Pluggable, Spit.Publishing.Service {
private const string ICON_FILENAME = "youtube.png";
private static Gdk.Pixbuf[] icon_pixbuf_set = null;
public YouTubeService(GLib.File resource_directory) {
if (icon_pixbuf_set == null)
icon_pixbuf_set = Resources.load_icon_set(resource_directory.get_child(ICON_FILENAME));
}
public int get_pluggable_interface(int min_host_interface, int max_host_interface) {
return Spit.negotiate_interfaces(min_host_interface, max_host_interface,
Spit.Publishing.CURRENT_INTERFACE);
......@@ -27,6 +36,7 @@ public class YouTubeService : Object, Spit.Pluggable, Spit.Publishing.Service {
info.website_url = Resources.WEBSITE_URL;
info.is_license_wordwrapped = false;
info.license = Resources.LICENSE;
info.icons = icon_pixbuf_set;
}
public Spit.Publishing.Publisher create_publisher(Spit.Publishing.PluginHost host) {
......
......@@ -10,11 +10,15 @@ extern const string _VERSION;
private class ShotwellPublishingCoreServices : Object, Spit.Module {
private Spit.Pluggable[] pluggables = new Spit.Pluggable[0];
public ShotwellPublishingCoreServices() {
pluggables += new FacebookService();
pluggables += new PicasaService();
pluggables += new FlickrService();
pluggables += new YouTubeService();
// we need to get a module file handle because our pluggables have to load resources from the
// module file directory
public ShotwellPublishingCoreServices(GLib.File module_file) {
GLib.File resource_directory = module_file.get_parent();
pluggables += new FacebookService(resource_directory);
pluggables += new PicasaService(resource_directory);
pluggables += new FlickrService(resource_directory);
pluggables += new YouTubeService(resource_directory);
}
public unowned string get_module_name() {
......@@ -40,7 +44,7 @@ public Spit.Module? spit_entry_point(Spit.EntryPointParams *params) {
params->host_max_spit_interface, Spit.CURRENT_INTERFACE);
return (params->module_spit_interface != Spit.UNSUPPORTED_INTERFACE)
? new ShotwellPublishingCoreServices() : null;
? new ShotwellPublishingCoreServices(params->module_file) : null;
}
// valac wants a default entry point, so valac gets a default entry point
......
......@@ -8,6 +8,10 @@
using Spit;
private class CrumbleEffectDescriptor : ShotwellTransitionDescriptor {
public CrumbleEffectDescriptor(GLib.File resource_directory) {
base(resource_directory);
}
public override unowned string get_id() {
return "org.yorba.shotwell.transitions.crumble";
}
......
......@@ -8,6 +8,10 @@
using Spit;
private class FadeEffectDescriptor : ShotwellTransitionDescriptor {
public FadeEffectDescriptor(GLib.File resource_directory) {
base(resource_directory);
}
public override unowned string get_id() {
return "org.yorba.shotwell.transitions.fade";
}
......
......@@ -8,6 +8,10 @@
using Spit;
private class SlideEffectDescriptor : ShotwellTransitionDescriptor {
public SlideEffectDescriptor(GLib.File resource_directory) {
base(resource_directory);
}
public override unowned string get_id() {
return "org.yorba.shotwell.transitions.slide";
}
......
......@@ -8,11 +8,13 @@ extern const string _VERSION;
private class ShotwellTransitions : Object, Spit.Module {
private Spit.Pluggable[] pluggables = new Spit.Pluggable[0];
public ShotwellTransitions() {
pluggables += new FadeEffectDescriptor();
pluggables += new SlideEffectDescriptor();
pluggables += new CrumbleEffectDescriptor();
public ShotwellTransitions(GLib.File module_file) {
GLib.File resource_directory = module_file.get_parent();
pluggables += new FadeEffectDescriptor(resource_directory);
pluggables += new SlideEffectDescriptor(resource_directory);
pluggables += new CrumbleEffectDescriptor(resource_directory);
}
public unowned string get_module_name() {
......@@ -38,7 +40,7 @@ public Spit.Module? spit_entry_point(Spit.EntryPointParams *params) {
params->host_max_spit_interface, Spit.CURRENT_INTERFACE);
return (params->module_spit_interface != Spit.UNSUPPORTED_INTERFACE)
? new ShotwellTransitions() : null;
? new ShotwellTransitions(params->module_file) : null;
}
// This is here to keep valac happy.
......@@ -47,6 +49,15 @@ private void dummy_main() {
// Base class for all transition descriptors in this module
public abstract class ShotwellTransitionDescriptor : Object, Spit.Pluggable, Spit.Transitions.Descriptor {
private const string ICON_FILENAME = "slideshow-plugin.png";
private static Gdk.Pixbuf[] icon_pixbuf_set = null;
public ShotwellTransitionDescriptor(GLib.File resource_directory) {
if (icon_pixbuf_set == null)
icon_pixbuf_set = Resources.load_icon_set(resource_directory.get_child(ICON_FILENAME));
}
public int get_pluggable_interface(int min_host_interface, int max_host_interface) {
return Spit.negotiate_interfaces(min_host_interface, max_host_interface,
Spit.Transitions.CURRENT_INTERFACE);
......@@ -65,6 +76,7 @@ public abstract class ShotwellTransitionDescriptor : Object, Spit.Pluggable, Spi
info.website_url = Resources.WEBSITE_URL;
info.is_license_wordwrapped = false;
info.license = Resources.LICENSE;
info.icons = icon_pixbuf_set;
}
public void activation(bool enabled) {
......
......@@ -75,6 +75,8 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc.,
public const string APP_ICONS[] = { ICON_APP, ICON_APP16, ICON_APP24 };
public const string ICON_ABOUT_LOGO = "shotwell-street.jpg";
public const string ICON_GENERIC_PLUGIN = "generic-plugin.png";
public const string ICON_SLIDESHOW_EXTENSION_POINT = "slideshow-extension-point";
public const string ICON_RATING_REJECTED = "rejected.svg";
public const string ICON_RATING_ONE = "one-star.svg";
public const string ICON_RATING_TWO = "two-stars.svg";
......
......@@ -83,7 +83,8 @@ public class ManifestWidgetMediator {
about_dialog.copyright = info.copyright;
about_dialog.license = info.license;
about_dialog.wrap_license = info.is_license_wordwrapped;
about_dialog.logo = (info.icons != null && info.icons.length > 0) ? info.icons[0] : null;
about_dialog.logo = (info.icons != null && info.icons.length > 0) ? info.icons[0] :
Resources.get_icon(Resources.ICON_GENERIC_PLUGIN);
about_dialog.program_name = get_pluggable_name(id);
about_dialog.translator_credits = info.translators;
about_dialog.version = info.version;
......@@ -203,7 +204,7 @@ private class ManifestListView : Gtk.TreeView {
icon = (info.icons != null && info.icons.length > 0)
? info.icons[0]
: Resources.get_icon(Resources.ICON_APP, ICON_SIZE);
: Resources.get_icon(Resources.ICON_GENERIC_PLUGIN, ICON_SIZE);
Gtk.TreeIter plugin_iter;
store.append(out plugin_iter, category_iter);
......
......@@ -13,7 +13,7 @@ public void init() throws Error {
core_ids += "org.yorba.shotwell.transitions.slide";
Plugins.register_extension_point(typeof(Spit.Transitions.Descriptor), _("Slideshow Transitions"),
Resources.ICON_CAMERAS, core_ids);
Resources.ICON_SLIDESHOW_EXTENSION_POINT, core_ids);
TransitionEffectsManager.init();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment