Fix WidgetExplorer "get new widgets" always a new window opens instead of taking the focus to the already opened one
Needs ReviewPublic

Authored by sunny on Apr 16 2020, 11:41 AM.

Details

Reviewers
None
Group Reviewers
Plasma
Summary

WidgetExplorer "get new widgets" dialogs live longer than WidgetExplorer, so it will be better to have external storage for that dialogs.
If external storage isn't be set then behavior won't be changed.

BUG: 412765

Diff Detail

Repository
R120 Plasma Workspace
Lint
Lint Skipped
Unit
Unit Tests Skipped
sunny created this revision.Apr 16 2020, 11:41 AM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 16 2020, 11:41 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

This change seems rather more expansive than the title would suggest. I see a lot of unrelated-looking changes including the removal of KNS functionality? These changes need to be explained or reverted.

Iincluding the removal of KNS functionality?

It's there. It's in widgetexplorerassistant

To help rephrase the commit message.

  • WidgetExplorer opens dialogs
  • WidgetExplorer has a limited lifespan and can be recreated each time it's shown.
  • This patch creates a new object that exists to track dialogs
  • There will be one of these (presumably in a pending plasma-desktop patch)
  • If you create N WidgetExplorers and open the same dialog multiple times because it has a common object it can raise the first one.

It's somewhat overengineered, but will work.

I don't like this "assistant" object that is just an opaque pointer being passed around from QML space. It's not very declarative.

Either we should register this item as a singleton with some nice invokable methods to show KNS dialogs, which could be a nice useful re-usable class. Then we port WidgetExplorer.qml to use that directly

Or just internally make widgetexplorerassistant some static inside WidgetExplorer as a completely private class.