Skip to content

Allow re-installation of installed patches from Web Catalog page#312

Merged
nephros merged 4 commits intosailfishos-patches:masterfrom
nephros:reinstallfromweb
Jul 12, 2022
Merged

Allow re-installation of installed patches from Web Catalog page#312
nephros merged 4 commits intosailfishos-patches:masterfrom
nephros:reinstallfromweb

Conversation

@nephros
Copy link
Contributor

@nephros nephros commented Jun 26, 2022

This relaxes/enhances the "can it be installed" checks in the Web Catalog Patch page so installed patches can be installed again.

Use case: lazy patch developers like myself don't bump the patch version when updating OS Compatibility. This results in (old) installed patches shown in red in the main patch list.
Having the possibility to re-install updates the metadata (at the least), making the red 'incompatible' color go away.

... and a bit of trojan horse commit: highlight the compatible OS version in the "compatible" list.

@nephros nephros added enhancement this improves something UX design and behaviour of UI components labels Jun 26, 2022
@nephros nephros added this to the 3.2.3 milestone Jun 26, 2022
@Olf0
Copy link
Contributor

Olf0 commented Jul 8, 2022

Sorry for the delayed review, I have been away on a holiday.

  1. The code changes of the first commit (830a87a) look fine. But …
    • … please keep the wording consistent of the extant line 341 and the new line 343. I deliberately used "install", because while the remorse timer is running, nothing has happened yet. Using "installing" in this case may be misinterpreted as some kind of a countdown bar ("negative progress bar"), finishing when the bar is at zero. In reality the action only starts when the bar arrived at zero.
      Hence I suggest changing the string "Re-Installing Patch %1" in line 343 to "Re-Install Patch %1". If you think I am wrong, then please consider altering the string "Install Patch %1" in line 341 to "Installing Patch %1".

    • Unrelated to these changes I wonder about the closing bracket (" ) ") in line 363: I fail to find the corresponding opening bracket (" ( "). Is this really correct?
      I assume either the opening bracket is missing or the closing bracket ought to be deleted.

      The logic of the whole section looks a bit dubious to me: Why is the case !ok tested within the function(ok)? But likely I am wrong, because QML code always looks strange for me.

  2. Due to my lack of QML and Qt know-how I am unable to properly review the second commit (0afc2c8) and can only tell that it formally looks fine (no obvious typos etc.). But due to you exhibiting extensive know-how of formatting and styles in Install History, I fully trust you doing the right thing. Still, please re-review your commit 0afc2c8, now that two weeks have passed.

HTH & Cheers!

@nephros
Copy link
Contributor Author

nephros commented Jul 10, 2022

I have changed the wording for the sake of constistency.

Jolla's recommendation is also alomg those lines.

https://sailfishos.org/develop/docs/silica/qml-sailfishsilica-sailfish-silica-remorse.html/

@nephros
Copy link
Contributor Author

nephros commented Jul 10, 2022

The closing brace closes the watchCall from line 352, the whole code block is actually a set of arguments to that call.

one of the arguments is an anonymous callback function (function(foo) {...}) which takes one argument (the result of the watchCall execution).

The argument can be named anything, here we name it ok, and check its value in the function body.

I agree it all looks a bit convoluted, but it's just the way asynchronous calls are done in qml/javascript.
As it's async, you can't just handle the result of the call directly, instead you give it a function to execute whenever it returns.

It's usually call( input arguments for the call, callback function on success, callback function on error).

@nephros nephros merged commit a28fac8 into sailfishos-patches:master Jul 12, 2022
@nephros nephros deleted the reinstallfromweb branch October 28, 2022 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement this improves something UX design and behaviour of UI components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants