summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2020-05-25 20:18:02 +0200
committerJörg Frings-Fürst <debian@jff.email>2020-05-25 20:18:02 +0200
commitd816fb9430b39a5aa7ed1c6ab4fd6ff39e804383 (patch)
treeb33dde0d7d164dabdd09bc86eb655bcb8672abbd /plugins
parent32662cb4e6c60da265aba1e4cc6a5e05e5c7c2d1 (diff)
parent78aeec6a66a80c1494e4f5dec30e9a2f71caef41 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'plugins')
-rw-r--r--plugins/authenticator/shotwell/GoogleAuthenticator.vala4
-rw-r--r--plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala4
-rw-r--r--plugins/common/Resources.vala2
-rw-r--r--plugins/common/WebAuthenticationPane.vala45
-rw-r--r--plugins/shotwell-publishing/PhotosPublisher.vala2
-rw-r--r--plugins/shotwell-publishing/YouTubePublishing.vala2
-rw-r--r--plugins/shotwell-publishing/youtube.pngbin1083 -> 560 bytes
-rw-r--r--plugins/shotwell-publishing/youtube_publishing_options_pane.ui28
8 files changed, 57 insertions, 30 deletions
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 <a href=\"https://developers.google.com/youtube\">https://developers.google.com/youtube</a> 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 <a href=\"https://www.youtube.com/t/terms\">https://www.youtube.com/t/terms</a>\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 <a href=\"help:shotwell/privacy-policy\">online services privacy policy</a>\n\nFor Google's own privacy policy, please refer to <a href=\"https://policies.google.com/privacy\">https://policies.google.com/privacy</a>"), 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 <a href=\"https://developers.google.com/photos/\">https://developers.google.com/photos/</a> 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 <a href=\"help:shotwell/privacy-policy\">online services privacy policy</a>For Google's own privacy policy, please refer to <a href=\"https://policies.google.com/privacy\">https://policies.google.com/privacy</a>"), 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
--- a/plugins/shotwell-publishing/youtube.png
+++ b/plugins/shotwell-publishing/youtube.png
Binary files 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 @@
<?xml version="1.0" encoding="UTF-8"?>
-<interface>
- <!-- interface-requires gtk+ 3.0 -->
+<!-- Generated with glade 3.22.2 -->
+<interface domain="shotwell">
+ <requires lib="gtk+" version="3.22"/>
<object class="GtkBox" id="youtube_pane_widget">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -19,22 +20,7 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">4</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="publish_to_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_top">8</property>
- <property name="margin_bottom">64</property>
- <property name="label" comments="This string does not require translation and may be safely skipped.">videos will appear in
-(populated in the application code.)</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -81,7 +67,7 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">4</property>
- <property name="position">3</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
@@ -97,7 +83,6 @@
<child>
<object class="GtkButton" id="logout_button">
<property name="label" translatable="yes">_Logout</property>
- <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -113,7 +98,6 @@
<child>
<object class="GtkButton" id="publish_button">
<property name="label" translatable="yes">_Publish</property>
- <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -130,7 +114,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">4</property>
+ <property name="position">2</property>
</packing>
</child>
</object>