Commit f73012ba authored by Lucas Beeler's avatar Lucas Beeler

Simplified names in the publishing API; fixed a problem with Facebook logout...

Simplified names in the publishing API; fixed a problem with Facebook logout that should've been in my previous commit but wasn't. ;-)
parent 8beb0362
......@@ -7,7 +7,7 @@
extern Soup.Message soup_form_request_new_from_multipart(string uri, Soup.Multipart multipart);
extern void qsort(void *p, size_t num, size_t size, GLib.CompareFunc func);
public class FacebookService : Object, Spit.Pluggable, Spit.Publishing.PublishingService {
public class FacebookService : Object, Spit.Pluggable, Spit.Publishing.Service {
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_API_VERSION);
......@@ -113,10 +113,10 @@ public class FacebookPublisher : Spit.Publishing.Publisher, GLib.Object {
private FacebookRESTSession session = null;
private WebAuthenticationPane web_auth_pane = null;
private Spit.Publishing.ProgressCallback progress_reporter = null;
private weak Spit.Publishing.PublishingService service = null;
private weak Spit.Publishing.Service service = null;
private bool running = false;
public FacebookPublisher(Spit.Publishing.PublishingService service,
public FacebookPublisher(Spit.Publishing.Service service,
Spit.Publishing.PluginHost host) {
debug("FacebookPublisher instantiated.");
this.service = service;
......@@ -290,6 +290,7 @@ public class FacebookPublisher : Spit.Publishing.Publisher, GLib.Object {
invalidate_persistent_session();
running = false;
start();
}
......@@ -587,7 +588,7 @@ public class FacebookPublisher : Spit.Publishing.Publisher, GLib.Object {
host.post_error(err);
}
public Spit.Publishing.PublishingService get_service() {
public Spit.Publishing.Service get_service() {
return service;
}
......@@ -1218,7 +1219,7 @@ internal class FacebookCreateAlbumTransaction : FacebookRESTTransaction {
}
}
internal class WebAuthenticationPane : Spit.Publishing.PublishingDialogPane, Object {
internal class WebAuthenticationPane : Spit.Publishing.DialogPane, Object {
private WebKit.WebView webview = null;
private Gtk.VBox pane_widget = null;
private Gtk.ScrolledWindow webview_frame = null;
......@@ -1284,8 +1285,8 @@ internal class WebAuthenticationPane : Spit.Publishing.PublishingDialogPane, Obj
return pane_widget;
}
public Spit.Publishing.PublishingDialogPane.GeometryOptions get_preferred_geometry() {
return Spit.Publishing.PublishingDialogPane.GeometryOptions.RESIZABLE;
public Spit.Publishing.DialogPane.GeometryOptions get_preferred_geometry() {
return Spit.Publishing.DialogPane.GeometryOptions.RESIZABLE;
}
public void on_pane_installed() {
......@@ -1296,7 +1297,7 @@ internal class WebAuthenticationPane : Spit.Publishing.PublishingDialogPane, Obj
}
}
internal class PublishingOptionsPane : Spit.Publishing.PublishingDialogPane, GLib.Object {
internal class PublishingOptionsPane : Spit.Publishing.DialogPane, GLib.Object {
private LegacyPublishingOptionsPane wrapped = null;
public signal void logout();
......@@ -1319,8 +1320,8 @@ internal class PublishingOptionsPane : Spit.Publishing.PublishingDialogPane, GLi
return wrapped;
}
public Spit.Publishing.PublishingDialogPane.GeometryOptions get_preferred_geometry() {
return Spit.Publishing.PublishingDialogPane.GeometryOptions.NONE;
public Spit.Publishing.DialogPane.GeometryOptions get_preferred_geometry() {
return Spit.Publishing.DialogPane.GeometryOptions.NONE;
}
public void on_pane_installed() {
......
......@@ -25,7 +25,7 @@ public interface Publisher : GLib.Object {
VIDEO = 1 << 1
}
public abstract PublishingService get_service();
public abstract Service get_service();
public abstract MediaType get_supported_media();
......@@ -37,7 +37,7 @@ public interface Publisher : GLib.Object {
public abstract void stop();
}
public interface PublishingDialogPane : GLib.Object {
public interface DialogPane : GLib.Object {
public enum GeometryOptions {
NONE = 0,
EXTENDED_SIZE = 1 << 0,
......@@ -61,8 +61,8 @@ public delegate void LoginCallback();
public interface PluginHost : GLib.Object, Spit.HostInterface {
public enum ButtonMode {
CLOSE,
CANCEL
CLOSE = 0,
CANCEL = 1
}
public abstract void post_error(Error err);
......@@ -71,7 +71,7 @@ public interface PluginHost : GLib.Object, Spit.HostInterface {
public abstract Publisher get_publisher();
public abstract void install_dialog_pane(Spit.Publishing.PublishingDialogPane pane,
public abstract void install_dialog_pane(Spit.Publishing.DialogPane pane,
ButtonMode mode = ButtonMode.CANCEL);
public abstract void install_static_message_pane(string message,
......@@ -113,7 +113,7 @@ public interface Publishable : GLib.Object {
public abstract Spit.Publishing.Publisher.MediaType get_media_type();
}
public interface PublishingService : Object, Spit.Pluggable {
public interface Service : Object, Spit.Pluggable {
public abstract Spit.Publishing.Publisher create_publisher(Spit.Publishing.PluginHost host);
}
......
......@@ -19,7 +19,7 @@ public class PublisherWrapperInteractor : ServiceInteractor, Spit.Publishing.Pub
this.old_api_dialog = old_api_dialog;
}
public Spit.Publishing.PublishingService get_service() {
public Spit.Publishing.Service get_service() {
return wrapped.get_service();
}
......@@ -81,7 +81,7 @@ public class DialogInteractorWrapper : PublishingDialog, Spit.HostInterface,
this.plugin_host = plugin_host;
}
public void install_dialog_pane(Spit.Publishing.PublishingDialogPane pane,
public void install_dialog_pane(Spit.Publishing.DialogPane pane,
Spit.Publishing.PluginHost.ButtonMode button_mode) {
debug("DialogInteractorWrapper: install_pane( ): invoked.");
......@@ -332,11 +332,11 @@ public class GlueFactory {
// load publishing services from plug-ins
Gee.Collection<Spit.Pluggable> pluggables = Plugins.get_pluggables_for_type(
typeof(Spit.Publishing.PublishingService));
typeof(Spit.Publishing.Service));
debug("Publising API Glue: discovered %d pluggable publishing services.", pluggables.size);
Spit.Publishing.PublishingService? facebook_service = null;
Spit.Publishing.Service? facebook_service = null;
foreach (Spit.Pluggable pluggable in pluggables) {
int pluggable_interface = pluggable.get_pluggable_interface(
Spit.Publishing.CURRENT_API_VERSION, Spit.Publishing.CURRENT_API_VERSION);
......@@ -347,8 +347,8 @@ public class GlueFactory {
continue;
}
Spit.Publishing.PublishingService service =
(Spit.Publishing.PublishingService) pluggable;
Spit.Publishing.Service service =
(Spit.Publishing.Service) pluggable;
debug("Publishing API Glue: discovered pluggable publishing service '%s'.",
service.get_pluggable_name());
if (service.get_id() == "org.yorba.shotwell.publishing.facebook")
......
......@@ -14,12 +14,12 @@ public class ConcretePublishingHost : Plugins.StandardHostInterface,
private const double STATUS_UPLOAD_FRACTION = 0.7;
private PublishingDialog dialog = null;
private Spit.Publishing.PublishingDialogPane current_pane = null;
private Spit.Publishing.DialogPane current_pane = null;
private Spit.Publishing.Publisher active_publisher = null;
private Publishable[] publishables = null;
private LoginCallback current_login_callback = null;
public ConcretePublishingHost(PublishingService service, PublishingDialog dialog,
public ConcretePublishingHost(Service service, PublishingDialog dialog,
Publishable[] publishables) {
base(service, "sharing");
this.dialog = dialog;
......@@ -63,7 +63,7 @@ public class ConcretePublishingHost : Plugins.StandardHostInterface,
set_button_mode(Spit.Publishing.PluginHost.ButtonMode.CANCEL);
}
public void install_dialog_pane(Spit.Publishing.PublishingDialogPane pane,
public void install_dialog_pane(Spit.Publishing.DialogPane pane,
Spit.Publishing.PluginHost.ButtonMode button_mode) {
debug("Publishing.PluginHost: install_dialog_pane( ): invoked.");
......@@ -75,14 +75,14 @@ public class ConcretePublishingHost : Plugins.StandardHostInterface,
dialog.install_pane(pane.get_widget());
Spit.Publishing.PublishingDialogPane.GeometryOptions geometry_options =
Spit.Publishing.DialogPane.GeometryOptions geometry_options =
pane.get_preferred_geometry();
if ((geometry_options & PublishingDialogPane.GeometryOptions.EXTENDED_SIZE) != 0)
if ((geometry_options & DialogPane.GeometryOptions.EXTENDED_SIZE) != 0)
dialog.set_large_window_mode();
else
dialog.set_standard_window_mode();
if ((geometry_options & PublishingDialogPane.GeometryOptions.RESIZABLE) != 0)
if ((geometry_options & DialogPane.GeometryOptions.RESIZABLE) != 0)
dialog.set_free_sizable_window_mode();
else
dialog.clear_free_sizable_window_mode();
......
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