Fix the displayed buttons in detail view#178
Conversation
491f6b8 to
0ea31ca
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the display of buttons in the addon detail view by refactoring the update check mechanism and improving button visibility logic. The changes remove automatic update checking when viewing addon details and simplify the button display logic based on installation status and available branches.
- Automatic update checking is removed from the detail view initialization
- Update button visibility is now based on actual update availability rather than addon type
- Button display logic is simplified and made more consistent across different installation scenarios
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| addonmanager_package_details_controller.py | Removes automatic update checking, updates button visibility logic for update availability |
| Widgets/addonmanager_widget_addon_buttons.py | Removes unused display mode enum, simplifies button visibility logic and branch handling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| @@ -120,9 +120,10 @@ def set_up_updater(self): | |||
| if self.addon.repo_type == Addon.Kind.MACRO | |||
| else os.path.join(self.addon.mod_directory, self.addon.name) | |||
| ) | |||
There was a problem hiding this comment.
The line self.ui.set_disabled(self.addon.is_disabled()) has been removed but there's no indication that this functionality has been moved elsewhere. This could result in the UI not properly reflecting the addon's disabled state.
| self.ui.button_bar.check_for_update.clicked.connect( | ||
| self.check_for_update_worker.do_work | ||
| ) | ||
| self.update_check_thread.started.connect(self.check_for_update_worker.do_work) |
There was a problem hiding this comment.
The update check is now triggered automatically when the thread starts rather than when the user clicks the update button. This changes the user interaction model and may cause unwanted automatic update checks.
| not presented to the user as an option to change. | ||
| :param disabled: Whether the addon is currently disabled.""" | ||
| :param disabled: Whether the addon is currently disabled. | ||
| :param can_be_disabled: Whether the addon can be disabled (i.e., if it is NOT a macro)""" |
There was a problem hiding this comment.
The docstring mentions a can_be_disabled parameter that doesn't exist in the function signature. The parameter list should be updated to match the documented behavior.
No description provided.