Initial bits

This commit is contained in:
Tim Bentley 2011-02-26 09:26:17 +00:00
parent f79d95bf21
commit ce1ab6ee5e
2 changed files with 8 additions and 3 deletions

View File

@ -172,6 +172,10 @@ class OpenLP(QtGui.QApplication):
self.setApplicationVersion(app_version[u'version'])
if os.name == u'nt':
self.setStyleSheet(application_stylesheet)
# First time checks in settings
if QtCore.QSettings().value(
u'general/first time', QtCore.QVariant(True)).toBool():
print "first time"
show_splash = QtCore.QSettings().value(
u'general/show splash', QtCore.QVariant(True)).toBool()
if show_splash:
@ -273,7 +277,9 @@ def main():
qInitResources()
# Now create and actually run the application.
app = OpenLP(qt_args)
#i18n Set Language
# Define the settings environment
QtCore.QSettings(u'OpenLP', u'OpenLP')
# i18n Set Language
language = LanguageManager.get_language()
appTranslator = LanguageManager.get_translator(language)
app.installTranslator(appTranslator)

View File

@ -89,8 +89,7 @@ class LanguageManager(object):
"""
Retrieve a saved language to use from settings
"""
settings = QtCore.QSettings(u'OpenLP', u'OpenLP')
language = unicode(settings.value(
language = unicode(QtCore.QSettings().value(
u'general/language', QtCore.QVariant(u'[en]')).toString())
log.info(u'Language file: \'%s\' Loaded from conf file' % language)
reg_ex = QtCore.QRegExp("^\[(.*)\]")