def on_project_changed(self): project_name = self.project_bar.get_current_project() self.dbcon.Session["AVALON_PROJECT"] = project_name self.assets_widget.refresh() # Force asset change callback to ensure tasks are correctly reset tools_lib.schedule(self.on_asset_changed, 0.05, channel="assets")
def on_text_changed(self, text): self.widget["btnAdd"].setEnabled(False) self.widget["btnDel"].setEnabled(False) def on_changed(): project = self._projects[text] member = project["data"].get("role", {}).get("member", []) if self._user in member: self.widget["btnDel"].setEnabled(True) else: self.widget["btnAdd"].setEnabled(True) tools_lib.schedule(on_changed, 400, channel="projectmember")
def refresh_actions(self, delay=1): tools_lib.schedule(self.on_refresh_actions, delay)
def on_asset_changed(self): tools_lib.schedule(self._on_asset_changed, 50, channel="mongo")
def on_task_changed(self): # Since we query the disk give it slightly more delay tools_lib.schedule(self._on_task_changed, 100, channel="mongo")
def refresh(self): """Refresh listed files for current selection in the interface""" self.files_model.refresh() if self.auto_select_latest_modified: tools_lib.schedule(self._select_last_modified_file, 100)