def accept(self): # Update default settings from glue.config import settings settings.FOREGROUND_COLOR = self.foreground settings.BACKGROUND_COLOR = self.background settings.DATA_COLOR = self.data_color settings.DATA_ALPHA = self.data_alpha settings.FONT_SIZE = self.font_size for pane in self.panes: pane.finalize() # Save to disk if requested if self.save_to_disk: save_settings() else: settings._save_to_disk = True # Trigger viewers to update defaults app = self._app() if app is not None: app._hub.broadcast(SettingsChangeMessage(self, ('FOREGROUND_COLOR', 'BACKGROUND_COLOR', 'FONT_SIZE'))) if self.data_apply: # If requested, trigger data to update color app.set_data_color(settings.DATA_COLOR, settings.DATA_ALPHA) super(PreferencesDialog, self).accept()
def accept(self): # Update default settings from glue.config import settings settings.FOREGROUND_COLOR = self.foreground settings.BACKGROUND_COLOR = self.background settings.DATA_COLOR = self.data_color settings.DATA_ALPHA = self.data_alpha settings.SHOW_LARGE_DATA_WARNING = self.show_large_data_warning for pane in self.panes: pane.finalize() # Save to disk if requested if self.save_to_disk: save_settings() # Trigger viewers to update defaults self.app._hub.broadcast( SettingsChangeMessage(self, ('FOREGROUND_COLOR', 'BACKGROUND_COLOR'))) # If requested, trigger data to update color if self.data_apply: self.app.set_data_color(settings.DATA_COLOR, settings.DATA_ALPHA) super(PreferencesDialog, self).accept()
def _synced_checkbox_callback(self, event): if self._synced_checkbox.isChecked(): msg = SettingsChangeMessage(self, [self]) self.parent().tab_widget.session.hub.broadcast(msg) self.update_slice_index(self.parent().tab_widget.synced_index)
def activate(self): self._synced = True if self._hub is not None: msg = SettingsChangeMessage(self, [self._viewer]) self._hub.broadcast(msg)