[WIP] Add early exit to xlet-settings if no instances exist, handle adding/removing xlets while xlet-settings is open.#13055
Conversation
069df70 to
52f37b2
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds functionality to handle dynamic xlet instance changes while the xlet-settings window is open. The main improvements include early exit validation when no instances exist, and real-time UI updates when instances are added or removed.
- Early exit validation when no xlet instances are found
- Dynamic monitoring and handling of xlet instance additions/removals
- Automatic UI updates for navigation buttons based on instance count
Reviewed Changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| xlet-settings.py | Implements instance monitoring, dynamic settings page creation/removal, navigation refactoring, and early exit logic |
| JsonSettingsWidgets.py | Adds file not found handling to prevent crashes when config files are removed |
Comments suppressed due to low confidence (1)
files/usr/share/cinnamon/cinnamon-settings/xlet-settings.py:500
- Except block directly handles BaseException.
except:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Please rebase and have a look at two areas noted. |
571a3c7 to
75c05a7
Compare
|
I'm having trouble with keybinding widgets I think due to 95e9d25. All keybinding widgets derive their values from the KeybindingTable now, not directly from the json files when xlet-settings is loading. I don't think it's serious, but a race condition when adding or removing an xlet that contains a keybinding setting. Please have a look. (I was testing with the menu applet but anything with a keybinding probably works). Adding an instance, I believe xlet-settings is adding the new instance before the KeybindingTable has discovered the new instance and registered the keybinding there: Removing an instance (via the applet context menu) - Somehow the KeybindingTable still thinks the json file exists: |
| spice_properties[key_name]["path"] = str(config_json) | ||
| spice_properties[key_name]["type"] = _type | ||
| spice_properties[key_name]["uuid"] = uuid | ||
| spice_properties[key_name]["instance_id"] = _id |
There was a problem hiding this comment.
I changed the instance_id property to be the same as config id. I was not sure why there was a distinction before, let me know if this is okay?
|
Updated keybinding table and keybinding class to handle adding and removing xlets. Xlet settings will now listen to the keybind table spice change event before creating a new settings page. |
xlet-settings now exits if command is run when no instances of an xlet exist.
Added logic to handle adding and removing xlet while xlet-settings is open.