[shotwell/wip/gtk4: 152/154] Re-enable Google services




commit 3003a58d4f7c1940d1e3d2f397315ef1ad2b3248
Author: Jens Georg <mail jensge org>
Date:   Fri Jul 29 01:24:11 2022 +0200

    Re-enable Google services

 .../shotwell/ShotwellAuthenticatorFactory.vala     |  6 +-
 plugins/authenticator/shotwell/meson.build         |  2 +-
 plugins/shotwell-publishing/YouTubePublishing.vala |  3 +-
 .../google_photos_publishing_options_pane.ui       | 18 +----
 plugins/shotwell-publishing/meson.build            |  4 +-
 .../shotwell-publishing/shotwell-publishing.vala   |  2 +-
 .../youtube_publishing_options_pane.ui             | 83 ++++------------------
 7 files changed, 24 insertions(+), 94 deletions(-)
---
diff --git a/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala 
b/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala
index a2cfac45..01fa3c39 100644
--- a/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala
+++ b/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala
@@ -27,13 +27,11 @@ namespace Publishing.Authenticator {
                 case "flickr":
                     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;
+                    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 hr
 ef=\"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. 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);
-                    return null;
+                    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/authenticator/shotwell/meson.build b/plugins/authenticator/shotwell/meson.build
index 6031bf4f..80662e97 100644
--- a/plugins/authenticator/shotwell/meson.build
+++ b/plugins/authenticator/shotwell/meson.build
@@ -1,7 +1,7 @@
 authenticator_shotwell_sources = [
         'ShotwellAuthenticatorFactory.vala',
         'FlickrPublishingAuthenticator.vala',
-#        'GoogleAuthenticator.vala',
+        'GoogleAuthenticator.vala',
         'OAuth1Authenticator.vala',
         'TumblrAuthenticator.vala'
         ]
diff --git a/plugins/shotwell-publishing/YouTubePublishing.vala 
b/plugins/shotwell-publishing/YouTubePublishing.vala
index 4b5908a4..46d3968f 100644
--- a/plugins/shotwell-publishing/YouTubePublishing.vala
+++ b/plugins/shotwell-publishing/YouTubePublishing.vala
@@ -37,7 +37,6 @@ 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) {
@@ -319,7 +318,7 @@ internal class PublishingOptionsPane : Spit.Publishing.DialogPane, GLib.Object {
         privacy_label = this.builder.get_object("privacy_label") as Gtk.Label;
 
         if (!authenticator.can_logout()) {
-            logout_button.parent.remove(logout_button);
+            logout_button.unparent();
         }
 
         login_identity_label.set_label(_("You are logged into YouTube as %s.").printf(
diff --git a/plugins/shotwell-publishing/google_photos_publishing_options_pane.ui 
b/plugins/shotwell-publishing/google_photos_publishing_options_pane.ui
index 8526ed30..6bff5406 100644
--- a/plugins/shotwell-publishing/google_photos_publishing_options_pane.ui
+++ b/plugins/shotwell-publishing/google_photos_publishing_options_pane.ui
@@ -14,7 +14,6 @@
     </child>
     <child>
       <object class="GtkLabel" id="login_identity_label">
-        <property name="visible">0</property>
         <property name="halign">start</property>
         <property name="margin_top">12</property>
         <property name="margin_bottom">32</property>
@@ -23,21 +22,18 @@
     </child>
     <child>
       <object class="GtkBox" id="album_gallery_layout_box">
-        <property name="visible">0</property>
         <property name="margin_start">32</property>
         <property name="margin_end">32</property>
         <property name="orientation">vertical</property>
         <child>
           <object class="GtkLabel" id="publish_to_label">
-            <property name="visible">0</property>
-            <property name="vexpand">1</property>
+            <property name="vexpand">0</property>
             <property name="halign">start</property>
             <property name="label">$mediatype will appear in (populated in code)</property>
           </object>
         </child>
         <child>
           <object class="GtkGrid" id="album_choice_area_grid">
-            <property name="visible">0</property>
             <property name="margin_start">24</property>
             <property name="margin_end">24</property>
             <property name="row_spacing">6</property>
@@ -45,7 +41,6 @@
             <property name="column_homogeneous">1</property>
             <child>
               <object class="GtkComboBoxText" id="existing_albums_combo">
-                <property name="visible">0</property>
                 <property name="tooltip_text" translatable="yes">Shotwell can only publish into albums that 
it created by itself, so this list might be empty despite the fact that you already have albums in your 
Google Photos account</property>
                 <layout>
                   <property name="column">1</property>
@@ -55,7 +50,6 @@
             </child>
             <child>
               <object class="GtkCheckButton" id="strip_metadata_check">
-                <property name="visible">0</property>
                 <property name="label" translatable="yes">_Remove location, camera, and other identifying 
information before uploading</property>
                 <property name="focusable">1</property>
                 <property name="halign">start</property>
@@ -71,7 +65,6 @@
             </child>
             <child>
               <object class="GtkLabel" id="label1">
-                <property name="visible">0</property>
                 <property name="halign">end</property>
                 <property name="label" translatable="yes">Photo _size preset</property>
                 <property name="use_underline">1</property>
@@ -84,7 +77,6 @@
             </child>
             <child>
               <object class="GtkComboBoxText" id="size_combo">
-                <property name="visible">0</property>
                 <layout>
                   <property name="column">1</property>
                   <property name="row">2</property>
@@ -93,7 +85,6 @@
             </child>
             <child>
               <object class="GtkCheckButton" id="existing_album_radio">
-                <property name="visible">0</property>
                 <property name="label" translatable="yes">An existing album</property>
                 <property name="halign">end</property>
                 <property name="active">1</property>
@@ -105,10 +96,9 @@
             </child>
             <child>
               <object class="GtkCheckButton" id="new_album_radio">
-                <property name="visible">0</property>
                 <property name="label" translatable="yes">A new album named</property>
                 <property name="halign">end</property>
-                <property name="active">1</property>
+                <property name="active">0</property>
                 <property name="group">existing_album_radio</property>
                 <layout>
                   <property name="column">0</property>
@@ -118,7 +108,6 @@
             </child>
             <child>
               <object class="GtkEntry" id="new_album_entry">
-                <property name="visible">0</property>
                 <property name="focusable">1</property>
                 <layout>
                   <property name="column">1</property>
@@ -135,10 +124,8 @@
     </child>
     <child>
       <object class="GtkBox">
-        <property name="visible">0</property>
         <child>
           <object class="GtkButton" id="logout_button">
-            <property name="visible">0</property>
             <property name="label" translatable="yes">_Logout</property>
             <property name="focusable">1</property>
             <property name="receives_default">1</property>
@@ -147,7 +134,6 @@
         </child>
         <child>
           <object class="GtkButton" id="publish_button">
-            <property name="visible">0</property>
             <property name="label" translatable="yes">_Publish</property>
             <property name="focusable">1</property>
             <property name="receives_default">1</property>
diff --git a/plugins/shotwell-publishing/meson.build b/plugins/shotwell-publishing/meson.build
index 8bff7aaa..7cecfc04 100644
--- a/plugins/shotwell-publishing/meson.build
+++ b/plugins/shotwell-publishing/meson.build
@@ -2,8 +2,8 @@ shotwell_publishing_sources = [
     'shotwell-publishing.vala',
     'FlickrPublishing.vala',
     'TumblrPublishing.vala',
-#    'YouTubePublishing.vala',
-#    'YoutubeUploader.vala',
+    'YouTubePublishing.vala',
+    'YoutubeUploader.vala',
     'PiwigoPublishing.vala',
     'PhotosPublisher.vala',
     'PhotosService.vala',
diff --git a/plugins/shotwell-publishing/shotwell-publishing.vala 
b/plugins/shotwell-publishing/shotwell-publishing.vala
index 742c9b84..29c51245 100644
--- a/plugins/shotwell-publishing/shotwell-publishing.vala
+++ b/plugins/shotwell-publishing/shotwell-publishing.vala
@@ -36,7 +36,7 @@ private class ShotwellPublishingCoreServices : Object, Spit.Module {
 
 #if HAVE_YOUTUBE
         if (authenicators.contains("youtube")) {
-            //pluggables += new YouTubeService(resource_directory);
+            pluggables += new YouTubeService(resource_directory);
         }
 #endif
 
diff --git a/plugins/shotwell-publishing/youtube_publishing_options_pane.ui 
b/plugins/shotwell-publishing/youtube_publishing_options_pane.ui
index 777632eb..eef5b3b5 100644
--- a/plugins/shotwell-publishing/youtube_publishing_options_pane.ui
+++ b/plugins/shotwell-publishing/youtube_publishing_options_pane.ui
@@ -1,114 +1,61 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.2 -->
 <interface domain="shotwell">
-  <requires lib="gtk+" version="3.22"/>
+  <requires lib="gtk" version="4.0"/>
   <object class="GtkBox" id="youtube_pane_widget">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
     <property name="orientation">vertical</property>
     <property name="spacing">1</property>
     <child>
       <object class="GtkLabel" id="login_identity_label">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
         <property name="margin_top">24</property>
         <property name="margin_bottom">32</property>
-        <property name="label" comments="This string is altered in the code, so it's safe to ignore it 
during translation.">'you are logged in as $name'
+        <property name="label" comments="This string is altered in the code, so it&apos;s safe to ignore it 
during translation.">&apos;you are logged in as $name&apos;
 (populated in the application code)</property>
       </object>
-      <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="padding">4</property>
-        <property name="position">0</property>
-      </packing>
     </child>
     <child>
       <object class="GtkBox" id="box1">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
         <property name="margin_start">40</property>
         <property name="margin_end">40</property>
         <property name="margin_top">16</property>
         <property name="spacing">6</property>
-        <property name="homogeneous">True</property>
+        <property name="homogeneous">1</property>
         <child>
           <object class="GtkLabel" id="privacy_label">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
             <property name="halign">end</property>
-            <property name="label" translatable="yes">Video privacy _setting</property>
-            <property name="use_underline">True</property>
+            <property name="label" translatable="1">Video privacy _setting</property>
+            <property name="use_underline">1</property>
           </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">0</property>
-          </packing>
         </child>
         <child>
-          <object class="GtkComboBoxText" id="privacy_combo">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
-          </packing>
+          <object class="GtkComboBoxText" id="privacy_combo"/>
         </child>
       </object>
-      <packing>
-        <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="GtkBox" id="button_area_box">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
         <property name="margin_start">112</property>
         <property name="margin_end">112</property>
         <property name="margin_top">48</property>
         <property name="margin_bottom">24</property>
         <property name="spacing">128</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="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="use_underline">True</property>
+            <property name="label" translatable="1">_Logout</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="position">0</property>
-          </packing>
         </child>
         <child>
           <object class="GtkButton" id="publish_button">
-            <property name="label" translatable="yes">_Publish</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="label" translatable="1">_Publish</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="position">1</property>
-          </packing>
         </child>
       </object>
-      <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">2</property>
-      </packing>
     </child>
   </object>
 </interface>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]