forked from openlp/openlp
Change the "autodetect" item into a radio button and stop disabling the language items. This is a more sane and less irritating approach to selecting a language.
bzr-revno: 1372
This commit is contained in:
commit
5e16f0fb12
@ -232,7 +232,7 @@ class Ui_MainWindow(object):
|
||||
self.LanguageGroup = QtGui.QActionGroup(mainWindow)
|
||||
self.LanguageGroup.setExclusive(True)
|
||||
self.LanguageGroup.setObjectName(u'LanguageGroup')
|
||||
self.LanguageGroup.setDisabled(LanguageManager.auto_language)
|
||||
add_actions(self.LanguageGroup, [self.AutoLanguageItem])
|
||||
qmList = LanguageManager.get_qm_list()
|
||||
savedLanguage = LanguageManager.get_language()
|
||||
for key in sorted(qmList.keys()):
|
||||
@ -425,14 +425,14 @@ class Ui_MainWindow(object):
|
||||
translate('OpenLP.MainWindow', '&Online Help'))
|
||||
self.helpWebSiteItem.setText(
|
||||
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():
|
||||
item.setText(item.objectName())
|
||||
item.setStatusTip(unicode(translate('OpenLP.MainWindow',
|
||||
'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(
|
||||
translate('OpenLP.MainWindow', 'Add &Tool...'))
|
||||
self.ToolsAddToolItem.setStatusTip(translate('OpenLP.MainWindow',
|
||||
@ -550,8 +550,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
QtCore.SIGNAL(u'triggered()'),
|
||||
self.ServiceManagerContents.printServiceOrder)
|
||||
# i18n set signals for languages
|
||||
QtCore.QObject.connect(self.AutoLanguageItem,
|
||||
QtCore.SIGNAL(u'toggled(bool)'), self.setAutoLanguage)
|
||||
self.LanguageGroup.triggered.connect(LanguageManager.set_language)
|
||||
QtCore.QObject.connect(self.ModeDefaultItem,
|
||||
QtCore.SIGNAL(u'triggered()'), self.onModeDefaultItemClicked)
|
||||
|
@ -112,9 +112,13 @@ class LanguageManager(object):
|
||||
"""
|
||||
language = u'en'
|
||||
if action:
|
||||
action_name = u'%s' % action.objectName()
|
||||
qm_list = LanguageManager.get_qm_list()
|
||||
language = u'%s' % qm_list[action_name]
|
||||
action_name = unicode(action.objectName())
|
||||
if action_name == u'AutoLanguageItem':
|
||||
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:
|
||||
language = u'[%s]' % language
|
||||
# This needs to be here for the setValue to work
|
||||
|
Loading…
Reference in New Issue
Block a user