elementary / photos

Photo viewer and organizer designed for elementary OS
https://elementary.io
GNU Lesser General Public License v2.1
105 stars 38 forks source link

PiwigoPlugin: Fix deprecated codes #677

Closed ryonakano closed 2 years ago

ryonakano commented 2 years ago

Supersedes #674 Review in no whitespace mode

Changes Summary

Replace deprecated Gtk.Table, Gtk.Alignment, Gtk.HButtonBox, Gtk.Widget.reparent, etc. Thus this fixes the following error messages on build:

../plugins/pantheon-photos-publishing/PiwigoPublishing.vala:1029.27-1029.31: warning: `Gtk.Alignment' has been deprecated since 3.14
../plugins/pantheon-photos-publishing/PiwigoPublishing.vala:1074.13-1074.26: warning: `Gtk.Widget.reparent' has been deprecated since 3.14
../plugins/pantheon-photos-publishing/PiwigoPublishing.vala:1183.27-1183.31: warning: `Gtk.Alignment' has been deprecated since 3.14
../plugins/pantheon-photos-publishing/PiwigoPublishing.vala:1219.13-1219.26: warning: `Gtk.Widget.reparent' has been deprecated since 3.14
Compilation succeeded - 4 warning(s)

Steps to test

  1. Open Photos
  2. Select a photo in the library and click the cloud button "Publish to various websites"
  3. Select "Piwigo" for "Publish photos to:"

We can use a demo instance of Piwigo to test the PR.

Before

Screenshot from 2021-11-25 21-48-10

Screenshot from 2021-12-01 11-02-27

After

Screenshot from 2021-11-30 14-33-36

Screenshot from 2021-12-01 11-07-28

jeremypw commented 2 years ago

If you are going to change the appearance in this PR, then I would lose the long opening instruction which is self-evident from the entry labels.

I would also move the "Remember Password" checkbox close to the Password entry field (in the manner of the Files ConnectServer dialog).

Best wait for UX team input though.

ryonakano commented 2 years ago

@jeremypw Thank you for your suggestion! I agree with your idea.

Looks like the instruction label is also used for showing error messages (represented in the condition of Mode.FAILED_RETRY_URL and Mode.FAILED_RETRY_USER in the AuthenticationPane class), so maybe we can remove the label completely and add a Gtk.InfoBar for these errors, as we do in other places when showing an erro message?

But that would make the PR complicated and this PR don't seem to get interested in for a couple of days from anyone, so I'll separate the design changes in another PR to get this merged easily.

ryonakano commented 2 years ago

Hmm, looks like the options pane not working, investigating.

ryonakano commented 2 years ago

OK, now the options pane works fine.

Before

Screenshot from 2021-12-01 11-02-27

After

Screenshot from 2021-12-01 11-07-28

The view still looks bad but again this PR only aims to fix deprecated codes so I'll tweak that in another PR.

BTW I found a demo instance of Piwigo, so we can test the PR using this