def custom_theme(self): d = ThemeEditor(parent=self) d.exec_() choices = self.theme_choices() s = self.settings['editor_theme'] current_val = s.getter(s.widget) s.widget.clear() for key, human in sorted(choices.iteritems(), key=lambda key_human1: key_human1[1] or key_human1[0]): s.widget.addItem(human or key, key) s.setter(s.widget, current_val) if d.theme_name: s.setter(s.widget, d.theme_name)
def custom_theme(self): d = ThemeEditor(parent=self) d.exec_() choices = self.theme_choices() s = self.settings['editor_theme'] current_val = s.getter(s.widget) s.widget.clear() for key, human in sorted(iteritems(choices), key=lambda key_human1: key_human1[1] or key_human1[0]): s.widget.addItem(human or key, key) s.setter(s.widget, current_val) if d.theme_name: s.setter(s.widget, d.theme_name)