-
Notifications
You must be signed in to change notification settings - Fork 129
Settings: Flag project as deactivated and hide from tools' view #2008
Settings: Flag project as deactivated and hide from tools' view #2008
Conversation
Based on avalon-core bfce450f
Based on avalon-core bfce450f
Based on avalon-core bfce450f
Based on avalon-core bfce450f
So the settings can recognize and won't pop warnings
Great stuff! Maybe we could have a confirmation box when using the archive switch rather than a separate line edit @iLLiCiTiT ? |
class ProjectListWidget(QtWidgets.QWidget): | ||
default = "< Default >" | ||
project_changed = QtCore.Signal() | ||
|
||
def __init__(self, parent): | ||
ProjectSortRole = QtCore.Qt.UserRole + 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use came case for attributes and don't set these constants used in different code in class. It is better to define roles as constants at header part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be resolved by 0bf84ad
|
||
index = self.sourceModel().index(source_row, 0, source_parent) | ||
is_active = bool(index.data(self.filterRole())) | ||
is_selected = bool(index.data(ProjectListWidget.ProjectSelectedRole)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I quite don't get why selection is important? All projects should disappear when checkbox change value...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was for keeping current selected project visible in list when it just got deactivated.
Since the only way for user to know which project is being edited is from the selection of that list view, so I thought it would be better not to hide the project that just got deactivated from list as soon as the "Save" is clicked and processed, until the user changed the selection to another project settings.
I would maybe change BTW: The validation could be done only in UI with using custom checkbox which would trigger confirmation dialog but I don't think it's necessary. Ad active: Also you may want to have inactive projects by default which does not make sense with having |
I'd also stay away from |
All good points, I have changed the attrib
That's true. I removed the confirmation for now as it's also outdated after the But after the confirmation is removed, code like this (e.g. in avalon-core code base for doc in project_docs:
if not doc["data"].get("active", True):
# the default value here is not following studio default setting
continue
... Not sure how to solve this properly, as it may also make sense if one like the project's default active state to For new project, we could make the project manager to always set the Edit
How about scan and update project documents that doesn't have |
I don't think it's used in a way that it would change behavior or affect anything.
Since there is (in avalon-core) default value of "active" set to
Not in tray like a script before/after launch that's not good idea as it would slow down all tray applications if studio has 30 projects it would query 30 times on each tray launch without doing anything. It could be done by script (out of tray), through settings or could modify |
Yeah, but if the default value in Studio Settings gets change to |
…ema_anatomy_attributes.json Co-authored-by: Milan Kolar <mkolar@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I spoke too soon. Sync queue is showing no projects at all with this PR. @davidlatwe get in touch with @kalisp he should be able to point to to a simple site sync setup with local storage so you can sort it out.
if only_active: | ||
inactive_chk = None | ||
else: | ||
inactive_chk = QtWidgets.QCheckBox(" Show Inactive Projects ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use parenting on widgets for proper style propagation.
inactive_chk = QtWidgets.QCheckBox(" Show Inactive Projects ") | |
inactive_chk = QtWidgets.QCheckBox(" Show Inactive Projects ", self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, I tried this but doesn't have any difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know but it may differ if we had different styles for checkbox than default.
Sync server projects widget
Thanks @iLLiCiTiT for taking a stab on fixing SyncServer ❤️ However I found an issue :
As for Launcher, LibraryLoader, StandalonePublisher, LocalSettings and ProjectManager, they all seems fine in a few quick tests. |
Oh good testing. I literally just tested too and didn't notice that |
But I can confirm that it indeed crashes in the scenario that @davidlatwe described |
So in the end @kalisp will have to look into that :) |
Here's the full log and GIF that shows the bug |
Task linked: PYPE-1427 Pype Projects - Deleting & Archiving |
Fixed Site Sync issue in davidlatwe#2 |
@kalisp @davidlatwe apologies. I've prematurely merged this thinking the fix was already part of it here. Petr could you please make the same PR to this main repo and we'll make a hotfix asap with it. Thanks. |
Feature
Able to switch project state between active and inactive in Studio Settings.
The project in inactive state will not be shown in tools like :
Usage
To mark project as inactive :
Projects
tab in Studio Settings and select the project that you want to deactivate.project_anatomy/attributes/active
and toggle it.Tips
Notes
AvalonMongoDB.projects()
filtering with 'data.active' field avalon-core#368