def py_checkSettings(self, settings, cache): settings = objToDict(settings) cache = objToDict(cache) if g_config.settings != settings or g_config.modelsData[ 'selected'] != cache: showI18nDialog( g_config.i18n['UI_flash_unsaved_header'], g_config.i18n['UI_flash_unsaved_text'], 'common/confirm', lambda confirm: ((self.py_onSaveSettings(settings, cache) if confirm else None), self.flashObject.as_onSettingsChecked())) return False else: return True
def py_onSaveSettings(self, settings, cache): g_config.settings = settings = objToDict(settings) g_config.modelsData['selected'] = cache = objToDict(cache) loadJson(g_config.ID, 'remodsCache', cache, g_config.configPath, True, quiet=not g_config.data['isDebug']) loadJson(g_config.ID, 'settings', settings, g_config.configPath, True, quiet=not g_config.data['isDebug']) g_config.readCurrentSettings(not g_config.data['isDebug']) refreshCurrentVehicle()
def py_onSaveSettings(self, settings): settings = objToDict(settings) g_config.settings = settings['skins'] loadJson(g_config.ID, 'settings', g_config.settings, g_config.configPath, True, quiet=not g_config.data['isDebug']) g_config.skinsData['priorities'] = settings['priorities'] loadJson(g_config.ID, 'skinsPriority', g_config.skinsData['priorities'], g_config.configPath, True, quiet=not g_config.data['isDebug']) g_config.readCurrentSettings(not g_config.data['isDebug']) refreshCurrentVehicle()
def py_checkSettings(self, settings): settings = objToDict(settings) if g_config.settings != settings['skins'] or g_config.skinsData['priorities'] != settings['priorities']: showI18nDialog( g_config.i18n['UI_flash_unsaved_header'], g_config.i18n['UI_flash_unsaved_text'], 'common/confirm', lambda confirm: ( (self.py_onSaveSettings(settings) if confirm else None), self.flashObject.as_onSettingsChecked())) return False else: return True