Beispiel #1
0
 def _saveLanguage(self):
     w = self.languageEdit
     index = w.currentIndex()
     lang = config.LANGUAGES[index]
     if lang != self.game.language:
         dataman.manager().setGameLanguage(lang, md5=self.game.md5)
     if lang == 'ja':
         skqss.removeclass(w, 'warning')
     else:
         skqss.addclass(w, 'warning')
Beispiel #2
0
    def _loadText(self):
        self._loadLanguage()

        # Load encoding
        g = self.game
        self.encodingEdit.setText(i18n.encoding_desc(g.encoding))
        #self.languageEdit.setText(i18n.language_name2(g.language))
        if g.encoding in ('shift-jis', 'utf-16'):
            skqss.removeclass(self.encodingEdit, 'warning')
        else:
            skqss.addclass(self.encodingEdit, 'warning')
Beispiel #3
0
 def _loadLaunchLanguage(self):
     lang = self.game.launchLanguage
     try:
         langIndex = config.LANGUAGES.index(lang) + 1
     except ValueError:
         langIndex = 0  # 'default'
     w = self.launchLanguageEdit
     w.setCurrentIndex(langIndex)
     if lang in ('', 'ja'):
         skqss.removeclass(w, 'warning')
     else:
         skqss.addclass(w, 'warning')
Beispiel #4
0
 def _saveLaunchLanguage(self):
     w = self.launchLanguageEdit
     index = w.currentIndex()
     if not index:
         lang = ''
     else:
         lang = config.LANGUAGES[index - 1]
     if lang != self.game.launchLanguage:
         dataman.manager().setGameLaunchLanguage(lang, md5=self.game.md5)
     if lang in ('', 'ja'):
         skqss.removeclass(w, 'warning')
     else:
         skqss.addclass(w, 'warning')
Beispiel #5
0
 def _refreshLanguageEdit(self):
   if self._language() == 'ja':
     skqss.removeclass(self.languageEdit, 'warning')
   else:
     skqss.addclass(self.languageEdit, 'warning')
Beispiel #6
0
 def _refreshEncodingEdit(self):
   if self._encoding() in ('shift-jis', 'utf-16', 'utf-8'):
     skqss.removeclass(self.encodingEdit, 'warning')
   else:
     skqss.addclass(self.encodingEdit, 'warning')