forked from openlp/openlp
Initial bits
This commit is contained in:
parent
f79d95bf21
commit
ce1ab6ee5e
@ -172,6 +172,10 @@ class OpenLP(QtGui.QApplication):
|
|||||||
self.setApplicationVersion(app_version[u'version'])
|
self.setApplicationVersion(app_version[u'version'])
|
||||||
if os.name == u'nt':
|
if os.name == u'nt':
|
||||||
self.setStyleSheet(application_stylesheet)
|
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(
|
show_splash = QtCore.QSettings().value(
|
||||||
u'general/show splash', QtCore.QVariant(True)).toBool()
|
u'general/show splash', QtCore.QVariant(True)).toBool()
|
||||||
if show_splash:
|
if show_splash:
|
||||||
@ -273,7 +277,9 @@ def main():
|
|||||||
qInitResources()
|
qInitResources()
|
||||||
# Now create and actually run the application.
|
# Now create and actually run the application.
|
||||||
app = OpenLP(qt_args)
|
app = OpenLP(qt_args)
|
||||||
#i18n Set Language
|
# Define the settings environment
|
||||||
|
QtCore.QSettings(u'OpenLP', u'OpenLP')
|
||||||
|
# i18n Set Language
|
||||||
language = LanguageManager.get_language()
|
language = LanguageManager.get_language()
|
||||||
appTranslator = LanguageManager.get_translator(language)
|
appTranslator = LanguageManager.get_translator(language)
|
||||||
app.installTranslator(appTranslator)
|
app.installTranslator(appTranslator)
|
||||||
|
@ -89,8 +89,7 @@ class LanguageManager(object):
|
|||||||
"""
|
"""
|
||||||
Retrieve a saved language to use from settings
|
Retrieve a saved language to use from settings
|
||||||
"""
|
"""
|
||||||
settings = QtCore.QSettings(u'OpenLP', u'OpenLP')
|
language = unicode(QtCore.QSettings().value(
|
||||||
language = unicode(settings.value(
|
|
||||||
u'general/language', QtCore.QVariant(u'[en]')).toString())
|
u'general/language', QtCore.QVariant(u'[en]')).toString())
|
||||||
log.info(u'Language file: \'%s\' Loaded from conf file' % language)
|
log.info(u'Language file: \'%s\' Loaded from conf file' % language)
|
||||||
reg_ex = QtCore.QRegExp("^\[(.*)\]")
|
reg_ex = QtCore.QRegExp("^\[(.*)\]")
|
||||||
|
Loading…
Reference in New Issue
Block a user