diff --git a/src/bitmessageqt/address_dialogs.py b/src/bitmessageqt/address_dialogs.py index 60c10369..7b73152d 100644 --- a/src/bitmessageqt/address_dialogs.py +++ b/src/bitmessageqt/address_dialogs.py @@ -1,9 +1,7 @@ """ -src/bitmessageqt/address_dialogs.py -=================================== - +Dialogs that work with BM address. """ -# pylint: disable=attribute-defined-outside-init +# pylint: disable=attribute-defined-outside-init,too-few-public-methods import hashlib @@ -14,13 +12,11 @@ import widgets from account import AccountMixin, GatewayAccount, MailchuckAccount, accountClass, getSortedAccounts from addresses import addBMIfNotPresent, decodeAddress, encodeVarint from inventory import Inventory -from retranslateui import RetranslateMixin from tr import _translate class AddressCheckMixin(object): """Base address validation class for QT UI""" - # pylint: disable=too-few-public-methods def __init__(self): self.valid = False @@ -33,7 +29,9 @@ class AddressCheckMixin(object): pass def addressChanged(self, QString): - """Address validation callback, performs validation and gives feedback""" + """ + Address validation callback, performs validation and gives feedback + """ status, addressVersion, streamNumber, ripe = decodeAddress( str(QString)) self.valid = status == 'success' @@ -102,8 +100,8 @@ class AddressDataDialog(QtGui.QDialog, AddressCheckMixin): super(AddressDataDialog, self).accept() -class AddAddressDialog(AddressDataDialog, RetranslateMixin): - """QDialog for adding a new address, with validation and translation""" +class AddAddressDialog(AddressDataDialog): + """QDialog for adding a new address""" def __init__(self, parent=None, address=None): super(AddAddressDialog, self).__init__(parent) @@ -113,8 +111,8 @@ class AddAddressDialog(AddressDataDialog, RetranslateMixin): self.lineEditAddress.setText(address) -class NewAddressDialog(QtGui.QDialog, RetranslateMixin): - """QDialog for generating a new address, with translation""" +class NewAddressDialog(QtGui.QDialog): + """QDialog for generating a new address""" def __init__(self, parent=None): super(NewAddressDialog, self).__init__(parent) @@ -175,8 +173,8 @@ class NewAddressDialog(QtGui.QDialog, RetranslateMixin): )) -class NewSubscriptionDialog(AddressDataDialog, RetranslateMixin): - """QDialog for subscribing to an address, with validation and translation""" +class NewSubscriptionDialog(AddressDataDialog): + """QDialog for subscribing to an address""" def __init__(self, parent=None): super(NewSubscriptionDialog, self).__init__(parent) @@ -218,8 +216,8 @@ class NewSubscriptionDialog(AddressDataDialog, RetranslateMixin): )) -class RegenerateAddressesDialog(QtGui.QDialog, RetranslateMixin): - """QDialog for regenerating deterministic addresses, with translation""" +class RegenerateAddressesDialog(QtGui.QDialog): + """QDialog for regenerating deterministic addresses""" def __init__(self, parent=None): super(RegenerateAddressesDialog, self).__init__(parent) widgets.load('regenerateaddresses.ui', self) @@ -227,8 +225,10 @@ class RegenerateAddressesDialog(QtGui.QDialog, RetranslateMixin): QtGui.QWidget.resize(self, QtGui.QWidget.sizeHint(self)) -class SpecialAddressBehaviorDialog(QtGui.QDialog, RetranslateMixin): - """QDialog for special address behaviour (e.g. mailing list functionality), with translation""" +class SpecialAddressBehaviorDialog(QtGui.QDialog): + """ + QDialog for special address behaviour (e.g. mailing list functionality) + """ def __init__(self, parent=None, config=None): super(SpecialAddressBehaviorDialog, self).__init__(parent) @@ -294,8 +294,8 @@ class SpecialAddressBehaviorDialog(QtGui.QDialog, RetranslateMixin): self.parent.rerenderMessagelistToLabels() -class EmailGatewayDialog(QtGui.QDialog, RetranslateMixin): - """QDialog for email gateway control, with translation""" +class EmailGatewayDialog(QtGui.QDialog): + """QDialog for email gateway control""" def __init__(self, parent, config=None, account=None): super(EmailGatewayDialog, self).__init__(parent) widgets.load('emailgateway.ui', self) diff --git a/src/bitmessageqt/bitmessageui.py b/src/bitmessageqt/bitmessageui.py index f81bf285..7f2c8c91 100644 --- a/src/bitmessageqt/bitmessageui.py +++ b/src/bitmessageqt/bitmessageui.py @@ -771,6 +771,8 @@ class Ui_MainWindow(object): self.actionRegenerateDeterministicAddresses.setText(_translate("MainWindow", "Regenerate deterministic addresses", None)) self.actionDeleteAllTrashedMessages.setText(_translate("MainWindow", "Delete all trashed messages", None)) self.actionJoinChan.setText(_translate("MainWindow", "Join / Create chan", None)) + self.updateNetworkSwitchMenuLabel() + import bitmessage_icons_rc diff --git a/src/bitmessageqt/dialogs.py b/src/bitmessageqt/dialogs.py index c667edb1..10701500 100644 --- a/src/bitmessageqt/dialogs.py +++ b/src/bitmessageqt/dialogs.py @@ -13,7 +13,6 @@ from address_dialogs import ( SpecialAddressBehaviorDialog ) from newchandialog import NewChanDialog -from retranslateui import RetranslateMixin from settings import SettingsDialog from tr import _translate from version import softwareVersion @@ -27,7 +26,7 @@ __all__ = [ ] -class AboutDialog(QtGui.QDialog, RetranslateMixin): +class AboutDialog(QtGui.QDialog): """The `About` dialog""" def __init__(self, parent=None): super(AboutDialog, self).__init__(parent) @@ -55,7 +54,7 @@ class AboutDialog(QtGui.QDialog, RetranslateMixin): self.setFixedSize(QtGui.QWidget.sizeHint(self)) -class IconGlossaryDialog(QtGui.QDialog, RetranslateMixin): +class IconGlossaryDialog(QtGui.QDialog): """The `Icon Glossary` dialog, explaining the status icon colors""" def __init__(self, parent=None, config=None): super(IconGlossaryDialog, self).__init__(parent) @@ -71,7 +70,7 @@ class IconGlossaryDialog(QtGui.QDialog, RetranslateMixin): self.setFixedSize(QtGui.QWidget.sizeHint(self)) -class HelpDialog(QtGui.QDialog, RetranslateMixin): +class HelpDialog(QtGui.QDialog): """The `Help` dialog""" def __init__(self, parent=None): super(HelpDialog, self).__init__(parent) @@ -79,7 +78,7 @@ class HelpDialog(QtGui.QDialog, RetranslateMixin): self.setFixedSize(QtGui.QWidget.sizeHint(self)) -class ConnectDialog(QtGui.QDialog, RetranslateMixin): +class ConnectDialog(QtGui.QDialog): """The `Connect` dialog""" def __init__(self, parent=None): super(ConnectDialog, self).__init__(parent) diff --git a/src/bitmessageqt/networkstatus.py b/src/bitmessageqt/networkstatus.py index 59b97f77..e8340298 100644 --- a/src/bitmessageqt/networkstatus.py +++ b/src/bitmessageqt/networkstatus.py @@ -1,7 +1,5 @@ """ -src/bitmessageqt/networkstatus.py -================================= - +Network status tab widget definition. """ import time @@ -34,8 +32,6 @@ class NetworkStatus(QtGui.QWidget, RetranslateMixin): header.setSortIndicator(0, QtCore.Qt.AscendingOrder) self.startup = time.localtime() - self.labelStartupTime.setText(_translate("networkstatus", "Since startup on %1").arg( - l10n.formatTimestamp(self.startup))) self.UISignalThread = UISignaler.get() # pylint: disable=no-member @@ -240,6 +236,15 @@ class NetworkStatus(QtGui.QWidget, RetranslateMixin): self.updateNumberOfObjectsToBeSynced() def retranslateUi(self): + """Conventional Qt Designer method for dynamic l10n""" super(NetworkStatus, self).retranslateUi() - self.labelStartupTime.setText(_translate("networkstatus", "Since startup on %1").arg( - l10n.formatTimestamp(self.startup))) + self.labelTotalConnections.setText( + _translate( + "networkstatus", "Total Connections: %1").arg( + str(self.tableWidgetConnectionCount.rowCount()))) + self.labelStartupTime.setText(_translate( + "networkstatus", "Since startup on %1" + ).arg(l10n.formatTimestamp(self.startup))) + self.updateNumberOfMessagesProcessed() + self.updateNumberOfBroadcastsProcessed() + self.updateNumberOfPubkeysProcessed() diff --git a/src/bitmessageqt/newchandialog.py b/src/bitmessageqt/newchandialog.py index 8db486c1..c0629cd7 100644 --- a/src/bitmessageqt/newchandialog.py +++ b/src/bitmessageqt/newchandialog.py @@ -9,13 +9,13 @@ from PyQt4 import QtCore, QtGui import widgets from addresses import addBMIfNotPresent from addressvalidator import AddressValidator, PassPhraseValidator -from queues import UISignalQueue, addressGeneratorQueue, apiAddressGeneratorReturnQueue -from retranslateui import RetranslateMixin +from queues import ( + addressGeneratorQueue, apiAddressGeneratorReturnQueue, UISignalQueue) from tr import _translate from utils import str_chan -class NewChanDialog(QtGui.QDialog, RetranslateMixin): +class NewChanDialog(QtGui.QDialog): """The `New Chan` dialog""" def __init__(self, parent=None): super(NewChanDialog, self).__init__(parent)