Merge pull request #756 from digital-dreamer/retranslate-context-menus
Retranslate context menus after language switch
This commit is contained in:
commit
4e123af4a6
|
@ -233,7 +233,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
QtCore.QObject.connect(self.ui.actionHelp, QtCore.SIGNAL(
|
QtCore.QObject.connect(self.ui.actionHelp, QtCore.SIGNAL(
|
||||||
"triggered()"), self.click_actionHelp)
|
"triggered()"), self.click_actionHelp)
|
||||||
|
|
||||||
def init_inbox_popup_menu(self):
|
def init_inbox_popup_menu(self, connectSignal=True):
|
||||||
# Popup menu for the Inbox tab
|
# Popup menu for the Inbox tab
|
||||||
self.ui.inboxContextMenuToolbar = QtGui.QToolBar()
|
self.ui.inboxContextMenuToolbar = QtGui.QToolBar()
|
||||||
# Actions
|
# Actions
|
||||||
|
@ -259,6 +259,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
"MainWindow", "Mark Unread"), self.on_action_InboxMarkUnread)
|
"MainWindow", "Mark Unread"), self.on_action_InboxMarkUnread)
|
||||||
self.ui.tableWidgetInbox.setContextMenuPolicy(
|
self.ui.tableWidgetInbox.setContextMenuPolicy(
|
||||||
QtCore.Qt.CustomContextMenu)
|
QtCore.Qt.CustomContextMenu)
|
||||||
|
if connectSignal:
|
||||||
self.connect(self.ui.tableWidgetInbox, QtCore.SIGNAL(
|
self.connect(self.ui.tableWidgetInbox, QtCore.SIGNAL(
|
||||||
'customContextMenuRequested(const QPoint&)'),
|
'customContextMenuRequested(const QPoint&)'),
|
||||||
self.on_context_menuInbox)
|
self.on_context_menuInbox)
|
||||||
|
@ -272,7 +273,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
self.popMenuInbox.addAction(self.actionSaveMessageAs)
|
self.popMenuInbox.addAction(self.actionSaveMessageAs)
|
||||||
self.popMenuInbox.addAction(self.actionTrashInboxMessage)
|
self.popMenuInbox.addAction(self.actionTrashInboxMessage)
|
||||||
|
|
||||||
def init_identities_popup_menu(self):
|
def init_identities_popup_menu(self, connectSignal=True):
|
||||||
# Popup menu for the Your Identities tab
|
# Popup menu for the Your Identities tab
|
||||||
self.ui.addressContextMenuToolbar = QtGui.QToolBar()
|
self.ui.addressContextMenuToolbar = QtGui.QToolBar()
|
||||||
# Actions
|
# Actions
|
||||||
|
@ -298,6 +299,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
self.on_action_SpecialAddressBehaviorDialog)
|
self.on_action_SpecialAddressBehaviorDialog)
|
||||||
self.ui.tableWidgetYourIdentities.setContextMenuPolicy(
|
self.ui.tableWidgetYourIdentities.setContextMenuPolicy(
|
||||||
QtCore.Qt.CustomContextMenu)
|
QtCore.Qt.CustomContextMenu)
|
||||||
|
if connectSignal:
|
||||||
self.connect(self.ui.tableWidgetYourIdentities, QtCore.SIGNAL(
|
self.connect(self.ui.tableWidgetYourIdentities, QtCore.SIGNAL(
|
||||||
'customContextMenuRequested(const QPoint&)'),
|
'customContextMenuRequested(const QPoint&)'),
|
||||||
self.on_context_menuYourIdentities)
|
self.on_context_menuYourIdentities)
|
||||||
|
@ -311,7 +313,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
self.popMenu.addAction(self.actionSetAvatar)
|
self.popMenu.addAction(self.actionSetAvatar)
|
||||||
self.popMenu.addAction(self.actionSpecialAddressBehavior)
|
self.popMenu.addAction(self.actionSpecialAddressBehavior)
|
||||||
|
|
||||||
def init_addressbook_popup_menu(self):
|
def init_addressbook_popup_menu(self, connectSignal=True):
|
||||||
# Popup menu for the Address Book page
|
# Popup menu for the Address Book page
|
||||||
self.ui.addressBookContextMenuToolbar = QtGui.QToolBar()
|
self.ui.addressBookContextMenuToolbar = QtGui.QToolBar()
|
||||||
# Actions
|
# Actions
|
||||||
|
@ -339,6 +341,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
"MainWindow", "Delete"), self.on_action_AddressBookDelete)
|
"MainWindow", "Delete"), self.on_action_AddressBookDelete)
|
||||||
self.ui.tableWidgetAddressBook.setContextMenuPolicy(
|
self.ui.tableWidgetAddressBook.setContextMenuPolicy(
|
||||||
QtCore.Qt.CustomContextMenu)
|
QtCore.Qt.CustomContextMenu)
|
||||||
|
if connectSignal:
|
||||||
self.connect(self.ui.tableWidgetAddressBook, QtCore.SIGNAL(
|
self.connect(self.ui.tableWidgetAddressBook, QtCore.SIGNAL(
|
||||||
'customContextMenuRequested(const QPoint&)'),
|
'customContextMenuRequested(const QPoint&)'),
|
||||||
self.on_context_menuAddressBook)
|
self.on_context_menuAddressBook)
|
||||||
|
@ -351,7 +354,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
self.popMenuAddressBook.addAction(self.actionAddressBookNew)
|
self.popMenuAddressBook.addAction(self.actionAddressBookNew)
|
||||||
self.popMenuAddressBook.addAction(self.actionAddressBookDelete)
|
self.popMenuAddressBook.addAction(self.actionAddressBookDelete)
|
||||||
|
|
||||||
def init_subscriptions_popup_menu(self):
|
def init_subscriptions_popup_menu(self, connectSignal=True):
|
||||||
# Popup menu for the Subscriptions page
|
# Popup menu for the Subscriptions page
|
||||||
self.ui.subscriptionsContextMenuToolbar = QtGui.QToolBar()
|
self.ui.subscriptionsContextMenuToolbar = QtGui.QToolBar()
|
||||||
# Actions
|
# Actions
|
||||||
|
@ -374,6 +377,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
self.on_action_SubscriptionsSetAvatar)
|
self.on_action_SubscriptionsSetAvatar)
|
||||||
self.ui.tableWidgetSubscriptions.setContextMenuPolicy(
|
self.ui.tableWidgetSubscriptions.setContextMenuPolicy(
|
||||||
QtCore.Qt.CustomContextMenu)
|
QtCore.Qt.CustomContextMenu)
|
||||||
|
if connectSignal:
|
||||||
self.connect(self.ui.tableWidgetSubscriptions, QtCore.SIGNAL(
|
self.connect(self.ui.tableWidgetSubscriptions, QtCore.SIGNAL(
|
||||||
'customContextMenuRequested(const QPoint&)'),
|
'customContextMenuRequested(const QPoint&)'),
|
||||||
self.on_context_menuSubscriptions)
|
self.on_context_menuSubscriptions)
|
||||||
|
@ -387,7 +391,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
self.popMenuSubscriptions.addSeparator()
|
self.popMenuSubscriptions.addSeparator()
|
||||||
self.popMenuSubscriptions.addAction(self.actionsubscriptionsClipboard)
|
self.popMenuSubscriptions.addAction(self.actionsubscriptionsClipboard)
|
||||||
|
|
||||||
def init_sent_popup_menu(self):
|
def init_sent_popup_menu(self, connectSignal=True):
|
||||||
# Popup menu for the Sent page
|
# Popup menu for the Sent page
|
||||||
self.ui.sentContextMenuToolbar = QtGui.QToolBar()
|
self.ui.sentContextMenuToolbar = QtGui.QToolBar()
|
||||||
# Actions
|
# Actions
|
||||||
|
@ -403,6 +407,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
"MainWindow", "Force send"), self.on_action_ForceSend)
|
"MainWindow", "Force send"), self.on_action_ForceSend)
|
||||||
self.ui.tableWidgetSent.setContextMenuPolicy(
|
self.ui.tableWidgetSent.setContextMenuPolicy(
|
||||||
QtCore.Qt.CustomContextMenu)
|
QtCore.Qt.CustomContextMenu)
|
||||||
|
if connectSignal:
|
||||||
self.connect(self.ui.tableWidgetSent, QtCore.SIGNAL(
|
self.connect(self.ui.tableWidgetSent, QtCore.SIGNAL(
|
||||||
'customContextMenuRequested(const QPoint&)'),
|
'customContextMenuRequested(const QPoint&)'),
|
||||||
self.on_context_menuSent)
|
self.on_context_menuSent)
|
||||||
|
@ -410,7 +415,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
# self.popMenuSent.addAction( self.actionSentClipboard )
|
# self.popMenuSent.addAction( self.actionSentClipboard )
|
||||||
# self.popMenuSent.addAction( self.actionTrashSentMessage )
|
# self.popMenuSent.addAction( self.actionTrashSentMessage )
|
||||||
|
|
||||||
def init_blacklist_popup_menu(self):
|
def init_blacklist_popup_menu(self, connectSignal=True):
|
||||||
# Popup menu for the Blacklist page
|
# Popup menu for the Blacklist page
|
||||||
self.ui.blacklistContextMenuToolbar = QtGui.QToolBar()
|
self.ui.blacklistContextMenuToolbar = QtGui.QToolBar()
|
||||||
# Actions
|
# Actions
|
||||||
|
@ -436,6 +441,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
self.on_action_BlacklistSetAvatar)
|
self.on_action_BlacklistSetAvatar)
|
||||||
self.ui.tableWidgetBlacklist.setContextMenuPolicy(
|
self.ui.tableWidgetBlacklist.setContextMenuPolicy(
|
||||||
QtCore.Qt.CustomContextMenu)
|
QtCore.Qt.CustomContextMenu)
|
||||||
|
if connectSignal:
|
||||||
self.connect(self.ui.tableWidgetBlacklist, QtCore.SIGNAL(
|
self.connect(self.ui.tableWidgetBlacklist, QtCore.SIGNAL(
|
||||||
'customContextMenuRequested(const QPoint&)'),
|
'customContextMenuRequested(const QPoint&)'),
|
||||||
self.on_context_menuBlacklist)
|
self.on_context_menuBlacklist)
|
||||||
|
@ -1436,6 +1442,12 @@ class MyForm(QtGui.QMainWindow):
|
||||||
def changeEvent(self, event):
|
def changeEvent(self, event):
|
||||||
if event.type() == QtCore.QEvent.LanguageChange:
|
if event.type() == QtCore.QEvent.LanguageChange:
|
||||||
self.ui.retranslateUi(self)
|
self.ui.retranslateUi(self)
|
||||||
|
self.init_inbox_popup_menu(False)
|
||||||
|
self.init_identities_popup_menu(False)
|
||||||
|
self.init_addressbook_popup_menu(False)
|
||||||
|
self.init_subscriptions_popup_menu(False)
|
||||||
|
self.init_sent_popup_menu(False)
|
||||||
|
self.init_blacklist_popup_menu(False)
|
||||||
if event.type() == QtCore.QEvent.WindowStateChange:
|
if event.type() == QtCore.QEvent.WindowStateChange:
|
||||||
if self.windowState() & QtCore.Qt.WindowMinimized:
|
if self.windowState() & QtCore.Qt.WindowMinimized:
|
||||||
self.actionShow.setChecked(False)
|
self.actionShow.setChecked(False)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user