From c3b87b404d803e2eaa6bf179b2bb370c874ffa75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Mon, 25 May 2020 20:17:19 +0200 Subject: New upstream version 0.30.10 --- .../shotwell/GoogleAuthenticator.vala | 4 +- .../shotwell/ShotwellAuthenticatorFactory.vala | 4 +- plugins/common/Resources.vala | 2 +- plugins/common/WebAuthenticationPane.vala | 45 ++++++++++++++++++++- plugins/shotwell-publishing/PhotosPublisher.vala | 2 +- plugins/shotwell-publishing/YouTubePublishing.vala | 2 +- plugins/shotwell-publishing/youtube.png | Bin 1083 -> 560 bytes .../youtube_publishing_options_pane.ui | 28 +++---------- 8 files changed, 57 insertions(+), 30 deletions(-) (limited to 'plugins') diff --git a/plugins/authenticator/shotwell/GoogleAuthenticator.vala b/plugins/authenticator/shotwell/GoogleAuthenticator.vala index 5b38ee6..a607cd0 100644 --- a/plugins/authenticator/shotwell/GoogleAuthenticator.vala +++ b/plugins/authenticator/shotwell/GoogleAuthenticator.vala @@ -371,6 +371,7 @@ namespace Publishing.Authenticator.Shotwell.Google { host.set_config_string("refresh_token", session.refresh_token); this.authenticated(); + web_auth_pane.clear(); } @@ -387,7 +388,7 @@ namespace Publishing.Authenticator.Shotwell.Google { try { txn.execute(); } catch (Spit.Publishing.PublishingError err) { - host.post_error(err); + host.post_error(err); } } @@ -420,6 +421,7 @@ namespace Publishing.Authenticator.Shotwell.Google { Idle.add (() => { this.authenticate(); return false; }); } + web_auth_pane.clear(); host.post_error(err); } diff --git a/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala b/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala index 36fb290..759822c 100644 --- a/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala +++ b/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala @@ -29,11 +29,11 @@ namespace Publishing.Authenticator { case "facebook": return new Shotwell.Facebook.Facebook(host); case "youtube": - return new Shotwell.Google.Google("https://gdata.youtube.com/", _("You are not currently logged into YouTube.\n\nYou must have already signed up for a Google account and set it up for use with YouTube to continue. You can set up most accounts by using your browser to log into the YouTube site at least once."), host); + return new Shotwell.Google.Google("https://www.googleapis.com/auth/youtube", _("You are not currently logged into YouTube.\n\nYou must have already signed up for a Google account and set it up for use with YouTube to continue. You can set up most accounts by using your browser to log into the YouTube site at least once.\n\nShotwell uses the YouTube API services https://developers.google.com/youtube for accessing your YouTube channel and upload the videos. By using Shotwell to access YouTube, you agree to be bound to the YouTube Terms of Service as available at https://www.youtube.com/t/terms\n\nShotwell's privacy policy regarding the use of data related to your Google account in general and YouTube in particular can be found in our online services privacy policy\n\nFor Google's own privacy policy, please refer to https://policies.google.com/privacy"), host); case "tumblr": return new Shotwell.Tumblr.Tumblr(host); case "google-photos": - return new Shotwell.Google.Google("https://www.googleapis.com/auth/photoslibrary", _("You are not currently logged into Google Photos.\n\nYou must have already signed up for a Google account and set it up for use with Google Photos.\n\nYou will have to authorize Shotwell to link to your Google Photos account."), host); + return new Shotwell.Google.Google("https://www.googleapis.com/auth/photoslibrary", _("You are not currently logged into Google Photos.\n\nYou must have already signed up for a Google account and set it up for use with Google Photos. Shotwell uses the Google Photos API services https://developers.google.com/photos/ for all interaction with your Google Photos data.You will have to grant access Shotwell to your Google Photos library.\n\nShotwell's privacy policy regarding the use of data related to your Google account in general and Google Photos in particular can be found in our online services privacy policyFor Google's own privacy policy, please refer to https://policies.google.com/privacy"), host); default: return null; } diff --git a/plugins/common/Resources.vala b/plugins/common/Resources.vala index ecbf2f8..16306f2 100644 --- a/plugins/common/Resources.vala +++ b/plugins/common/Resources.vala @@ -58,7 +58,7 @@ public Gdk.Pixbuf[]? load_from_resource (string resource_path) { Gdk.Pixbuf? icon = null; try { debug ("Loading icon from %s", resource_path); - icon = new Gdk.Pixbuf.from_resource_at_scale (resource_path, 24, 24, true); + icon = new Gdk.Pixbuf.from_resource_at_scale (resource_path, -1, 24, true); } catch (Error error) { warning ("Couldn't load icon set from %s: %s", resource_path, error.message); } diff --git a/plugins/common/WebAuthenticationPane.vala b/plugins/common/WebAuthenticationPane.vala index 43afe65..669e339 100644 --- a/plugins/common/WebAuthenticationPane.vala +++ b/plugins/common/WebAuthenticationPane.vala @@ -8,23 +8,63 @@ using Spit.Publishing; namespace Shotwell.Plugins.Common { public abstract class WebAuthenticationPane : Spit.Publishing.DialogPane, Object { public DialogPane.GeometryOptions preferred_geometry { - get; construct; default = DialogPane.GeometryOptions.NONE; + get; construct; default = DialogPane.GeometryOptions.COLOSSAL_SIZE; } public string login_uri { owned get; construct; } public Error load_error { get; private set; default = null; } private WebKit.WebView webview; + private Gtk.Widget widget; + private Gtk.Entry entry; + + public void clear() { + try { + debug("Clearing the data of WebKit..."); + this.webview.get_website_data_manager().clear.begin(WebKit.WebsiteDataTypes.ALL, (GLib.TimeSpan)0); + } catch (Error e) { + // Do nothing + message("Failed to clear data: %s", e.message); + } + } public override void constructed () { base.constructed (); + var box = new Gtk.Box(Gtk.Orientation.VERTICAL, 4); + this.widget = box; + this.entry = new Gtk.Entry(); + this.entry.editable = false; + this.entry.get_style_context().add_class("flat"); + this.entry.get_style_context().add_class("read-only"); + box.pack_start (entry, false, false, 6); + this.webview = new WebKit.WebView (); this.webview.get_settings ().enable_plugins = false; this.webview.load_changed.connect (this.on_page_load_changed); this.webview.load_failed.connect (this.on_page_load_failed); this.webview.context_menu.connect ( () => { return false; }); + this.webview.decide_policy.connect (this.on_decide_policy); + this.webview.bind_property("uri", this.entry, "text", GLib.BindingFlags.DEFAULT); + box.pack_end (this.webview); + } + + private bool on_decide_policy(WebKit.PolicyDecision decision, WebKit.PolicyDecisionType type) { + switch (type) { + case WebKit.PolicyDecisionType.NEW_WINDOW_ACTION: { + var navigation = (WebKit.NavigationPolicyDecision) decision; + var action = navigation.get_navigation_action(); + var uri = action.get_request().uri; + decision.ignore(); + AppInfo.launch_default_for_uri_async.begin(uri, null); + return true; + } + default: + break; + } + + return false; } public abstract void on_page_load (); @@ -78,7 +118,7 @@ namespace Shotwell.Plugins.Common { } public Gtk.Widget get_widget() { - return this.webview; + return this.widget; } public void on_pane_installed () { @@ -86,6 +126,7 @@ namespace Shotwell.Plugins.Common { } public void on_pane_uninstalled() { + this.clear(); } } } diff --git a/plugins/shotwell-publishing/PhotosPublisher.vala b/plugins/shotwell-publishing/PhotosPublisher.vala index ce5e505..5f46470 100644 --- a/plugins/shotwell-publishing/PhotosPublisher.vala +++ b/plugins/shotwell-publishing/PhotosPublisher.vala @@ -47,7 +47,7 @@ internal class PublishingParameters { return target_album_name; } - public void set_target_album_name(string target_album_name) { + public void set_target_album_name(string? target_album_name) { this.target_album_name = target_album_name; } diff --git a/plugins/shotwell-publishing/YouTubePublishing.vala b/plugins/shotwell-publishing/YouTubePublishing.vala index 87f1959..e50d17a 100644 --- a/plugins/shotwell-publishing/YouTubePublishing.vala +++ b/plugins/shotwell-publishing/YouTubePublishing.vala @@ -99,7 +99,7 @@ internal class YouTubeAuthorizer : GData.Authorizer, Object { } public bool is_authorized_for_domain(GData.AuthorizationDomain domain) { - return true; + return domain.scope.has_suffix ("auth/youtube"); } public void process_request(GData.AuthorizationDomain? domain, diff --git a/plugins/shotwell-publishing/youtube.png b/plugins/shotwell-publishing/youtube.png index 214e1de..3793ff0 100644 Binary files a/plugins/shotwell-publishing/youtube.png and b/plugins/shotwell-publishing/youtube.png differ diff --git a/plugins/shotwell-publishing/youtube_publishing_options_pane.ui b/plugins/shotwell-publishing/youtube_publishing_options_pane.ui index cdf82af..47f75a1 100644 --- a/plugins/shotwell-publishing/youtube_publishing_options_pane.ui +++ b/plugins/shotwell-publishing/youtube_publishing_options_pane.ui @@ -1,6 +1,7 @@ - - + + + True False @@ -19,22 +20,7 @@ False True 4 - 1 - - - - - True - False - 8 - 64 - videos will appear in -(populated in the application code.) - - - False - True - 2 + 0 @@ -81,7 +67,7 @@ False True 4 - 3 + 1 @@ -97,7 +83,6 @@ _Logout - False True True True @@ -113,7 +98,6 @@ _Publish - False True True True @@ -130,7 +114,7 @@ False True - 4 + 2 -- cgit v1.2.3