def handleCommand(event): """Handle commands.""" if event.hasId('show-addon-settings'): # Switch to the Settings tab. ui.selectTab(SETTINGS) # Switch to the Addons category. categoryArea.selectTab('addons-options') # Switch to the correct tab. addonArea.selectTab(event.addon) elif event.hasId('show-snowberry-settings'): # Change to the Defaults profile. pr.setActive(pr.getDefaults()) # Switch to the Settings tab. ui.selectTab(SETTINGS) # Switch to the Snowberry category. categoryArea.selectTab('general-options')
def notifyHandler(event): if summaryDisabled: return if event.hasId('active-profile-changed'): p = pr.getActive() titleLabel.setText(p.getName()) # Update the summary entries. updateSummary(p) # Change to the Summary tab automatically. if event.hasId('active-profile-changed') and \ st.getSystemBoolean('summary-profile-change-autoselect'): if event.wasChanged(): # The profile did actually change. ui.selectTab(SUMMARY) elif event.hasId('value-changed') or \ event.hasId('addon-attached') or \ event.hasId('addon-detached'): # Resummarize due to a changed value of a setting. updateSummary(pr.getActive())