[shotwell/wip/gtk4: 151/154] Enable Flicker publisher
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell/wip/gtk4: 151/154] Enable Flicker publisher
- Date: Sat, 1 Oct 2022 17:53:21 +0000 (UTC)
commit 1e75cec18b11183ba68a9f8f42179754dc920a79
Author: Jens Georg <mail jensge org>
Date: Fri Jul 29 01:11:44 2022 +0200
Enable Flicker publisher
.../shotwell/ShotwellAuthenticatorFactory.vala | 3 +-
plugins/authenticator/shotwell/meson.build | 4 +-
plugins/common/WebAuthenticationPane.vala | 22 +---
plugins/meson.build | 4 +-
plugins/shotwell-publishing/FlickrPublishing.vala | 3 +-
.../flickr_publishing_options_pane.ui | 138 ++++++---------------
plugins/shotwell-publishing/meson.build | 4 +-
.../shotwell-publishing/shotwell-publishing.vala | 2 +-
plugins/shotwell-transitions/meson.build | 2 +-
9 files changed, 55 insertions(+), 127 deletions(-)
---
diff --git a/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala
b/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala
index 95bca55d..a2cfac45 100644
--- a/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala
+++ b/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala
@@ -25,8 +25,7 @@ namespace Publishing.Authenticator {
Spit.Publishing.PluginHost host) {
switch (provider) {
case "flickr":
- //return new Shotwell.Flickr.Flickr(host);
- return null;
+ return new Shotwell.Flickr.Flickr(host);
case "youtube":
//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);
return null;
diff --git a/plugins/authenticator/shotwell/meson.build b/plugins/authenticator/shotwell/meson.build
index a359fcd3..6031bf4f 100644
--- a/plugins/authenticator/shotwell/meson.build
+++ b/plugins/authenticator/shotwell/meson.build
@@ -1,6 +1,6 @@
authenticator_shotwell_sources = [
'ShotwellAuthenticatorFactory.vala',
-# 'FlickrPublishingAuthenticator.vala',
+ 'FlickrPublishingAuthenticator.vala',
# 'GoogleAuthenticator.vala',
'OAuth1Authenticator.vala',
'TumblrAuthenticator.vala'
@@ -11,7 +11,7 @@ authenticator_shotwell_resources = gnome.compile_resources('authenticator-resour
source_dir : meson.source_root())
authenticator_shotwell_deps = [gee, gtk, gio, soup, json_glib, sw_plugin,
- sw_plugin_common_dep, json_glib, xml, secret]
+ sw_plugin_common_dep, json_glib, xml, secret, webkit]
authenticator = library('shotwell-authenticator',
authenticator_shotwell_sources + authenticator_shotwell_resources,
diff --git a/plugins/common/WebAuthenticationPane.vala b/plugins/common/WebAuthenticationPane.vala
index b9f7280b..1ca06ce4 100644
--- a/plugins/common/WebAuthenticationPane.vala
+++ b/plugins/common/WebAuthenticationPane.vala
@@ -36,7 +36,7 @@ namespace Shotwell.Plugins.Common {
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);
+ box.append (entry);
this.webview = new WebKit.WebView ();
@@ -45,7 +45,8 @@ namespace Shotwell.Plugins.Common {
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);
+ this.webview.set_vexpand(true);
+ box.append (this.webview);
}
private bool on_decide_policy(WebKit.PolicyDecision decision, WebKit.PolicyDecisionType type) {
@@ -67,19 +68,6 @@ namespace Shotwell.Plugins.Common {
public abstract void on_page_load ();
- protected void set_cursor (Gdk.CursorType type) {
- var window = webview.get_window ();
- if (window == null)
- return;
-
- var display = window.get_display ();
- if (display == null)
- return;
-
- var cursor = new Gdk.Cursor.for_display (display, type);
- window.set_cursor (cursor);
- }
-
private bool on_page_load_failed (WebKit.LoadEvent load_event, string uri, Error error) {
// OAuth call-back scheme. Produces a load error because it is not HTTP(S)
// Do not set the load_error, but continue the error handling
@@ -96,10 +84,10 @@ namespace Shotwell.Plugins.Common {
switch (load_event) {
case WebKit.LoadEvent.STARTED:
case WebKit.LoadEvent.REDIRECTED:
- this.set_cursor (Gdk.CursorType.WATCH);
+ this.widget.set_cursor_from_name ("progress");
break;
case WebKit.LoadEvent.FINISHED:
- this.set_cursor (Gdk.CursorType.LEFT_PTR);
+ this.widget.set_cursor_from_name ("default");
this.on_page_load ();
break;
default:
diff --git a/plugins/meson.build b/plugins/meson.build
index 17a294ce..80cbb4d8 100644
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -3,11 +3,11 @@
sw_plugin_common = library('shotwell-plugin-common',
['common/RESTSupport.vala',
'common/Resources.vala',
-# 'common/WebAuthenticationPane.vala',
+ 'common/WebAuthenticationPane.vala',
'common/BuilderPane.vala',
'common/OAuth1Support.vala'],
version: so_version,
- dependencies : [gtk, gee, soup, xml, sw_plugin],
+ dependencies : [gtk, gee, soup, xml, sw_plugin, webkit],
vala_header : 'shotwell-plugin-common.h',
vala_vapi : 'shotwell-plugin-common.vapi',
include_directories : config_incdir,
diff --git a/plugins/shotwell-publishing/FlickrPublishing.vala
b/plugins/shotwell-publishing/FlickrPublishing.vala
index 2e252aa3..9365017d 100644
--- a/plugins/shotwell-publishing/FlickrPublishing.vala
+++ b/plugins/shotwell-publishing/FlickrPublishing.vala
@@ -31,7 +31,6 @@ 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 = null;
}
public void activation(bool enabled) {
@@ -600,7 +599,7 @@ internal class PublishingOptionsPane : Spit.Publishing.DialogPane, GLib.Object {
strip_metadata_check = (Gtk.CheckButton) this.builder.get_object("strip_metadata_check");
if (!publisher.get_authenticator().can_logout()) {
- logout_button.parent.remove(logout_button);
+ logout_button.unparent();
}
this.parameters = parameters;
diff --git a/plugins/shotwell-publishing/flickr_publishing_options_pane.ui
b/plugins/shotwell-publishing/flickr_publishing_options_pane.ui
index e5e61aab..4811f34a 100644
--- a/plugins/shotwell-publishing/flickr_publishing_options_pane.ui
+++ b/plugins/shotwell-publishing/flickr_publishing_options_pane.ui
@@ -1,38 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.0 -->
<interface domain="shotwell">
- <requires lib="gtk+" version="3.14"/>
+ <requires lib="gtk" version="4.0"/>
<object class="GtkBox" id="flickr_pane">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="spacing">16</property>
- <property name="homogeneous">True</property>
+ <property name="homogeneous">1</property>
<child>
<object class="GtkBox" id="inner_wrapper">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">24</property>
<child>
<object class="GtkLabel" id="upload_info_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="label">You are logged into Flickr as (name).
-(this label's string is populated and set inside the code,
+(this label's string is populated and set inside the code,
so changes made here will not display)</property>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">16</property>
- <property name="position">0</property>
- </packing>
</child>
<child>
<object class="GtkGrid" id="visibility_and_size_grid">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="margin_bottom">8</property>
@@ -40,132 +25,89 @@ so changes made here will not display)</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="visibility_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="halign">end</property>
<property name="label">_visibility label (populated in the code)</property>
- <property name="use_underline">True</property>
+ <property name="use_underline">1</property>
<property name="justify">right</property>
<property name="mnemonic_widget">visibility_combo</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">0</property>
+ </layout>
</object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
</child>
<child>
<object class="GtkLabel" id="size_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="halign">end</property>
- <property name="label" translatable="yes">Photo _size</property>
- <property name="use_underline">True</property>
+ <property name="label" translatable="1">Photo _size</property>
+ <property name="use_underline">1</property>
<property name="mnemonic_widget">size_combo</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">1</property>
+ </layout>
</object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
</child>
<child>
<object class="GtkComboBoxText" id="visibility_combo">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">0</property>
+ </layout>
</object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
</child>
<child>
<object class="GtkComboBoxText" id="size_combo">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">1</property>
+ </layout>
</object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
</child>
<child>
<object class="GtkCheckButton" id="strip_metadata_check">
- <property name="label" translatable="yes">_Remove location, camera, and other identifying
information before uploading</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
+ <property name="label" translatable="1">_Remove location, camera, and other identifying
information before uploading</property>
+ <property name="focusable">1</property>
<property name="halign">start</property>
<property name="margin_top">16</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="use_underline">1</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">2</property>
+ <property name="column-span">2</property>
+ </layout>
</object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- <property name="width">2</property>
- </packing>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">18</property>
- <property name="position">1</property>
- </packing>
</child>
<child>
<object class="GtkBox" id="box2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="valign">center</property>
<property name="halign">center</property>
<property name="margin_bottom">8</property>
<property name="spacing">64</property>
- <property name="homogeneous">True</property>
+ <property name="homogeneous">1</property>
<child>
<object class="GtkButton" id="logout_button">
- <property name="label" translatable="yes">_Logout</property>
+ <property name="label" translatable="1">_Logout</property>
<property name="width_request">96</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
+ <property name="focusable">1</property>
+ <property name="receives_default">1</property>
+ <property name="use_underline">1</property>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">24</property>
- <property name="position">0</property>
- </packing>
</child>
<child>
<object class="GtkButton" id="publish_button">
- <property name="label" translatable="yes">_Publish</property>
+ <property name="label" translatable="1">_Publish</property>
<property name="width_request">96</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
+ <property name="focusable">1</property>
+ <property name="receives_default">1</property>
+ <property name="use_underline">1</property>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">24</property>
- <property name="position">1</property>
- </packing>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">8</property>
- <property name="position">0</property>
- </packing>
</child>
</object>
</interface>
diff --git a/plugins/shotwell-publishing/meson.build b/plugins/shotwell-publishing/meson.build
index 13fd7239..8bff7aaa 100644
--- a/plugins/shotwell-publishing/meson.build
+++ b/plugins/shotwell-publishing/meson.build
@@ -1,6 +1,6 @@
shotwell_publishing_sources = [
'shotwell-publishing.vala',
-# 'FlickrPublishing.vala',
+ 'FlickrPublishing.vala',
'TumblrPublishing.vala',
# 'YouTubePublishing.vala',
# 'YoutubeUploader.vala',
@@ -19,7 +19,7 @@ shared_module('shotwell-publishing',
shotwell_publishing_sources + shotwell_publishing_resources,
dependencies : [gtk, soup, gexiv2, gee, sw_plugin, json_glib,
webkit, sw_plugin_common_dep, xml, gcr, gcr_ui,
- authenticator_dep, secret],
+ authenticator_dep, secret, webkit],
c_args : ['-DPLUGIN_RESOURCE_PATH="/org/gnome/Shotwell/Publishing"',
'-DGCR_API_SUBJECT_TO_CHANGE'],
install: true,
diff --git a/plugins/shotwell-publishing/shotwell-publishing.vala
b/plugins/shotwell-publishing/shotwell-publishing.vala
index c44fc2b8..742c9b84 100644
--- a/plugins/shotwell-publishing/shotwell-publishing.vala
+++ b/plugins/shotwell-publishing/shotwell-publishing.vala
@@ -30,7 +30,7 @@ private class ShotwellPublishingCoreServices : Object, Spit.Module {
#if HAVE_FLICKR
if (authenicators.contains("flickr")) {
- //pluggables += new FlickrService(resource_directory);
+ pluggables += new FlickrService(resource_directory);
}
#endif
diff --git a/plugins/shotwell-transitions/meson.build b/plugins/shotwell-transitions/meson.build
index 69f30627..5f91487d 100644
--- a/plugins/shotwell-transitions/meson.build
+++ b/plugins/shotwell-transitions/meson.build
@@ -20,7 +20,7 @@ libm = cc.find_library('m', required : false)
shared_module('shotwell-transitions',
shotwell_transitions_sources + shotwell_transitions_resources,
dependencies : [gio, gdk_pixbuf, cairo, gtk, xml, sw_plugin,
- sw_plugin_common_dep, gee, soup, libm],
+ sw_plugin_common_dep, gee, soup, libm, webkit],
vala_args : [
'--gresources', 'org.gnome.Shotwell.Transitions.gresource.xml',
],
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]