[shotwell/wip/gtk4] Fix piwigo ssl certificate dialog



commit a3217983db17f97ad8153f96a47a8d8f110f04ab
Author: Jens Georg <mail jensge org>
Date:   Fri Jul 29 00:30:22 2022 +0200

    Fix piwigo ssl certificate dialog

 plugins/shotwell-publishing/PiwigoPublishing.vala  | 10 +--
 plugins/shotwell-publishing/meson.build            |  4 +-
 .../shotwell-publishing/piwigo_ssl_failure_pane.ui | 83 ++++++----------------
 3 files changed, 28 insertions(+), 69 deletions(-)
---
diff --git a/plugins/shotwell-publishing/PiwigoPublishing.vala 
b/plugins/shotwell-publishing/PiwigoPublishing.vala
index 7a3ec3c0..d3b4c574 100644
--- a/plugins/shotwell-publishing/PiwigoPublishing.vala
+++ b/plugins/shotwell-publishing/PiwigoPublishing.vala
@@ -1090,9 +1090,12 @@ internal class SSLErrorPane : Shotwell.Plugins.Common.BuilderPane {
         var info = this.get_builder ().get_object ("default") as Gtk.Button;
         if (cert != null) {
             info.clicked.connect (() => {
-            #if 0
                 var simple_cert = new Gcr.SimpleCertificate (cert.certificate.data);
+                var scrollable = new Gtk.ScrolledWindow();
+                scrollable.set_vexpand(true);
                 var widget = new Gcr.CertificateWidget (simple_cert);
+                widget.set_vexpand(true);
+                scrollable.set_child(widget);
                 bool use_header = true;
                 Gtk.Settings.get_default ().get ("gtk-dialogs-use-header", out use_header);
                 var flags = (Gtk.DialogFlags) 0;
@@ -1105,15 +1108,14 @@ internal class SSLErrorPane : Shotwell.Plugins.Common.BuilderPane {
                                 null,
                                 flags,
                                 _("_OK"), Gtk.ResponseType.OK);
-                dialog.get_content_area ().append (widget);
+                dialog.get_content_area ().append (scrollable);
                 dialog.set_default_response (Gtk.ResponseType.OK);
-                dialog.set_default_size (640, -1);
+                dialog.set_default_size (640, 480);
                 dialog.show ();
                 dialog.set_modal(true);
                 dialog.response.connect(() => {
                     dialog.destroy();
                 });
-            #endif
             });
         } else {
             info.unparent();
diff --git a/plugins/shotwell-publishing/meson.build b/plugins/shotwell-publishing/meson.build
index 235dfbf5..13fd7239 100644
--- a/plugins/shotwell-publishing/meson.build
+++ b/plugins/shotwell-publishing/meson.build
@@ -3,7 +3,7 @@ shotwell_publishing_sources = [
 #    'FlickrPublishing.vala',
     'TumblrPublishing.vala',
 #    'YouTubePublishing.vala',
-    'YoutubeUploader.vala',
+#    'YoutubeUploader.vala',
     'PiwigoPublishing.vala',
     'PhotosPublisher.vala',
     'PhotosService.vala',
@@ -18,7 +18,7 @@ shotwell_publishing_resources = gnome.compile_resources('publishing-resource',
 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,
+                              webkit, sw_plugin_common_dep, xml, gcr, gcr_ui,
                               authenticator_dep, secret],
               c_args : ['-DPLUGIN_RESOURCE_PATH="/org/gnome/Shotwell/Publishing"',
                         '-DGCR_API_SUBJECT_TO_CHANGE'],
diff --git a/plugins/shotwell-publishing/piwigo_ssl_failure_pane.ui 
b/plugins/shotwell-publishing/piwigo_ssl_failure_pane.ui
index d1910251..9884015f 100644
--- a/plugins/shotwell-publishing/piwigo_ssl_failure_pane.ui
+++ b/plugins/shotwell-publishing/piwigo_ssl_failure_pane.ui
@@ -1,111 +1,68 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
 <interface domain="shotwell">
-  <requires lib="gtk+" version="3.14"/>
+  <requires lib="gtk" version="4.0"/>
   <object class="GtkWindow">
-    <property name="can_focus">False</property>
-    <child>
+    <property name="child">
       <object class="GtkBox" id="content">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="margin_left">12</property>
-        <property name="margin_right">12</property>
+        <property name="margin-start">12</property>
+        <property name="margin-end">12</property>
         <property name="margin_top">12</property>
         <property name="margin_bottom">12</property>
         <property name="orientation">vertical</property>
         <property name="spacing">12</property>
         <child>
           <object class="GtkLabel">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label" translatable="yes">This connection is not secure</property>
+            <property name="label" translatable="1">This connection is not secure</property>
             <attributes>
-              <attribute name="weight" value="bold"/>
+              <attribute name="weight" value="bold"></attribute>
             </attributes>
           </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">0</property>
-          </packing>
         </child>
         <child>
           <object class="GtkLabel" id="main_text">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
             <property name="label">This does not look like the real %s. Attackers might be trying to steal 
or alter information going to or from this site (for example, private messages, credit card information, or 
passwords).</property>
-            <property name="use_markup">True</property>
-            <property name="wrap">True</property>
+            <property name="use_markup">1</property>
+            <property name="wrap">1</property>
             <property name="width_chars">40</property>
             <property name="max_width_chars">40</property>
           </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
-          </packing>
         </child>
         <child>
           <object class="GtkLabel" id="ssl_errors">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
             <property name="halign">start</property>
-            <property name="margin_left">12</property>
+            <property name="margin-start">12</property>
             <property name="label">⚫ This website presented identification that belongs to a different 
website.
 ⚫ This website’s identification could not be processed. It may be corrupted.</property>
-            <property name="wrap">True</property>
+            <property name="wrap">1</property>
             <property name="width_chars">52</property>
             <property name="max_width_chars">52</property>
           </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">2</property>
-          </packing>
         </child>
         <child>
-          <object class="GtkButtonBox">
+          <object class="GtkBox">
+            <property name="orientation">horizontal</property>
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="orientation">vertical</property>
             <property name="spacing">6</property>
-            <property name="layout_style">center</property>
             <child>
               <object class="GtkButton" id="default">
-                <property name="label" translatable="yes">Show the certificate…</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="label" translatable="1">Show the certificate…</property>
+                <property name="focusable">1</property>
+                <property name="receives_default">1</property>
               </object>
-              <packing>
-                <property name="expand">True</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
             </child>
             <child>
               <object class="GtkButton" id="proceed_button">
-                <property name="label" translatable="yes">I understand, please _proceed.</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">I understand, please _proceed.</property>
+                <property name="focusable">1</property>
+                <property name="receives_default">1</property>
+                <property name="use_underline">1</property>
               </object>
-              <packing>
-                <property name="expand">True</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="pack_type">end</property>
-            <property name="position">3</property>
-          </packing>
         </child>
       </object>
-    </child>
+    </property>
   </object>
 </interface>


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