Bug 491061 - Ability to skip custom page based on the result of a command
Summary: Ability to skip custom page based on the result of a command
Status: CONFIRMED
Alias: None
Product: Welcome Center
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-31 13:50 UTC by Timothée Ravier
Modified: 2024-07-31 18:22 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timothée Ravier 2024-07-31 13:50:45 UTC
SUMMARY

For Fedora, we want to be able to display a page to enable the installation of the OpenH264 codec. We however want to be able to completely skip the page if the package is already installed.

See: https://pagure.io/fedora-kde/plasma-welcome-fedora/pull-request/4

I haven't found yet if it's possible with the existing code or if we need changes in plasma-welcome.

STEPS TO REPRODUCE
1. Open plasma-welcome on Fedora Rawhide with https://pagure.io/fedora-kde/plasma-welcome-fedora/pull-request/4

OBSERVED RESULT

The OpenH264 install page is always displayed, whether or not the package is already installed.

EXPECTED RESULT

The OpenH264 install page is displayed only if the package is not already installed.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora KDE Rawhide

ADDITIONAL INFORMATION

See: https://pagure.io/fedora-kde/plasma-welcome-fedora/pull-request/4
Comment 1 Oliver Beard 2024-07-31 14:06:04 UTC
I don't believe this can be done at present. Right now, Discover's page exposes whether Discover is installed:

    let discover = _createPage("Discover.qml");
    if (discover.application.exists) {
        _pushPage(discover);
    } else {
        discover.destroy();
    }

It should be possible for GenericPage to include a property that can be overridden for whether a page should be included. We can then use this internally and in distro pages. I'll investigate!
Comment 2 Oliver Beard 2024-07-31 14:09:08 UTC
Basing this on the result of a command could be a problem. At present, I'd suggest using a Kirigami.PlaceholderMessage (anchors.centerIn; width: parent.width - Kirigami.Units.gridUnit * 2; visible: ...) to communicate that no action needs to be taken.

I'd say this is probably preferable anyway, as users would know that even if currently installed, they will have the option to do so there if that were not the case.
Comment 3 Nate Graham 2024-07-31 18:22:15 UTC
Given the proposed UX, I think showing a big blank "Yay, you have this random video codec, click Next now!" would be a bit silly. I think the request makes sense in general.

For the moment, could you integrate the OpenH264 content into another existing custom page, so that you could hide it when not relevant on that page?