forked from openlp/openlp
Stop signal from running twice and set 'Autodetect' text after language names have been set.
This commit is contained in:
parent
c4e64dce8d
commit
21d59235ac
@ -425,14 +425,14 @@ class Ui_MainWindow(object):
|
|||||||
translate('OpenLP.MainWindow', '&Online Help'))
|
translate('OpenLP.MainWindow', '&Online Help'))
|
||||||
self.helpWebSiteItem.setText(
|
self.helpWebSiteItem.setText(
|
||||||
translate('OpenLP.MainWindow', '&Web Site'))
|
translate('OpenLP.MainWindow', '&Web Site'))
|
||||||
self.AutoLanguageItem.setText(
|
|
||||||
translate('OpenLP.MainWindow', '&Auto Detect'))
|
|
||||||
self.AutoLanguageItem.setStatusTip(translate('OpenLP.MainWindow',
|
|
||||||
'Use the system language, if available.'))
|
|
||||||
for item in self.LanguageGroup.actions():
|
for item in self.LanguageGroup.actions():
|
||||||
item.setText(item.objectName())
|
item.setText(item.objectName())
|
||||||
item.setStatusTip(unicode(translate('OpenLP.MainWindow',
|
item.setStatusTip(unicode(translate('OpenLP.MainWindow',
|
||||||
'Set the interface language to %s')) % item.objectName())
|
'Set the interface language to %s')) % item.objectName())
|
||||||
|
self.AutoLanguageItem.setText(
|
||||||
|
translate('OpenLP.MainWindow', '&Autodetect'))
|
||||||
|
self.AutoLanguageItem.setStatusTip(translate('OpenLP.MainWindow',
|
||||||
|
'Use the system language, if available.'))
|
||||||
self.ToolsAddToolItem.setText(
|
self.ToolsAddToolItem.setText(
|
||||||
translate('OpenLP.MainWindow', 'Add &Tool...'))
|
translate('OpenLP.MainWindow', 'Add &Tool...'))
|
||||||
self.ToolsAddToolItem.setStatusTip(translate('OpenLP.MainWindow',
|
self.ToolsAddToolItem.setStatusTip(translate('OpenLP.MainWindow',
|
||||||
@ -550,8 +550,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
QtCore.SIGNAL(u'triggered()'),
|
QtCore.SIGNAL(u'triggered()'),
|
||||||
self.ServiceManagerContents.printServiceOrder)
|
self.ServiceManagerContents.printServiceOrder)
|
||||||
# i18n set signals for languages
|
# i18n set signals for languages
|
||||||
QtCore.QObject.connect(self.AutoLanguageItem,
|
|
||||||
QtCore.SIGNAL(u'toggled(bool)'), self.setAutoLanguage)
|
|
||||||
self.LanguageGroup.triggered.connect(LanguageManager.set_language)
|
self.LanguageGroup.triggered.connect(LanguageManager.set_language)
|
||||||
QtCore.QObject.connect(self.ModeDefaultItem,
|
QtCore.QObject.connect(self.ModeDefaultItem,
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onModeDefaultItemClicked)
|
QtCore.SIGNAL(u'triggered()'), self.onModeDefaultItemClicked)
|
||||||
|
@ -112,9 +112,13 @@ class LanguageManager(object):
|
|||||||
"""
|
"""
|
||||||
language = u'en'
|
language = u'en'
|
||||||
if action:
|
if action:
|
||||||
action_name = u'%s' % action.objectName()
|
action_name = unicode(action.objectName())
|
||||||
qm_list = LanguageManager.get_qm_list()
|
if action_name == u'AutoLanguageItem':
|
||||||
language = u'%s' % qm_list[action_name]
|
LanguageManager.auto_language = True
|
||||||
|
else:
|
||||||
|
LanguageManager.auto_language = False
|
||||||
|
qm_list = LanguageManager.get_qm_list()
|
||||||
|
language = unicode(qm_list[action_name])
|
||||||
if LanguageManager.auto_language:
|
if LanguageManager.auto_language:
|
||||||
language = u'[%s]' % language
|
language = u'[%s]' % language
|
||||||
# This needs to be here for the setValue to work
|
# This needs to be here for the setValue to work
|
||||||
|
Loading…
Reference in New Issue
Block a user