V0.6 #852

Merged
Atheros1 merged 399 commits from v0.6 into master 2016-05-03 01:58:38 +02:00
4 changed files with 24 additions and 2 deletions
Showing only changes of commit 412e175f27 - Show all commits

View File

@ -726,6 +726,8 @@ class Ui_MainWindow(object):
item.setText(_translate("MainWindow", "Received", None)) item.setText(_translate("MainWindow", "Received", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.chans), _translate("MainWindow", "Chans", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.chans), _translate("MainWindow", "Chans", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.networkstatus), _translate("MainWindow", "Network Status", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.networkstatus), _translate("MainWindow", "Network Status", None))
self.blackwhitelist.retranslateUi()
self.networkstatus.retranslateUi()
self.menuFile.setTitle(_translate("MainWindow", "File", None)) self.menuFile.setTitle(_translate("MainWindow", "File", None))
self.menuSettings.setTitle(_translate("MainWindow", "Settings", None)) self.menuSettings.setTitle(_translate("MainWindow", "Settings", None))
self.menuHelp.setTitle(_translate("MainWindow", "Help", None)) self.menuHelp.setTitle(_translate("MainWindow", "Help", None))

View File

@ -7,11 +7,12 @@ import widgets
from addresses import addBMIfNotPresent from addresses import addBMIfNotPresent
from dialogs import AddAddressDialog from dialogs import AddAddressDialog
from helper_sql import sqlExecute, sqlQuery from helper_sql import sqlExecute, sqlQuery
from retranslateui import RetranslateMixin
from utils import avatarize from utils import avatarize
from uisignaler import UISignaler from uisignaler import UISignaler
class Blacklist(QtGui.QWidget): class Blacklist(QtGui.QWidget, RetranslateMixin):
def __init__(self, parent=None): def __init__(self, parent=None):
super(Blacklist, self).__init__(parent) super(Blacklist, self).__init__(parent)
widgets.load('blacklist.ui', self) widgets.load('blacklist.ui', self)

View File

@ -2,11 +2,12 @@ from PyQt4 import QtCore, QtGui
import shared import shared
from tr import _translate from tr import _translate
import l10n import l10n
from retranslateui import RetranslateMixin
from uisignaler import UISignaler from uisignaler import UISignaler
import widgets import widgets
class NetworkStatus(QtGui.QWidget): class NetworkStatus(QtGui.QWidget, RetranslateMixin):
def __init__(self, parent=None): def __init__(self, parent=None):
super(NetworkStatus, self).__init__(parent) super(NetworkStatus, self).__init__(parent)
widgets.load('networkstatus.ui', self) widgets.load('networkstatus.ui', self)

View File

@ -0,0 +1,18 @@
from os import path
from PyQt4 import QtGui
from debug import logger
import widgets
class RetranslateMixin(object):
def retranslateUi(self):
defaults = QtGui.QWidget()
widgets.load(self.__class__.__name__.lower() + '.ui', defaults)
for attr, value in defaults.__dict__.iteritems():
setTextMethod = getattr(value, "setText", None)
if callable(setTextMethod):
getattr(self, attr).setText(getattr(defaults, attr).text())
elif isinstance(value, QtGui.QTableWidget):
for i in range (value.columnCount()):
getattr(self, attr).horizontalHeaderItem(i).setText(getattr(defaults, attr).horizontalHeaderItem(i).text())
for i in range (value.rowCount()):
getattr(self, attr).verticalHeaderItem(i).setText(getattr(defaults, attr).verticalHeaderItem(i).text())