2018-10-21 18:14:20 +02:00
|
|
|
"""
|
|
|
|
src/bitmessageqt/dialogs.py
|
|
|
|
===========================
|
|
|
|
"""
|
2016-03-17 22:09:46 +01:00
|
|
|
|
2018-10-21 18:14:20 +02:00
|
|
|
from PyQt4 import QtGui
|
2018-01-19 17:38:15 +01:00
|
|
|
|
2018-10-21 18:14:20 +02:00
|
|
|
import paths
|
|
|
|
import widgets
|
|
|
|
from address_dialogs import (
|
2018-11-13 16:03:38 +01:00
|
|
|
AddAddressDialog, EmailGatewayDialog, NewAddressDialog,
|
|
|
|
NewSubscriptionDialog, RegenerateAddressesDialog,
|
2018-10-21 18:14:20 +02:00
|
|
|
SpecialAddressBehaviorDialog
|
|
|
|
)
|
|
|
|
from newchandialog import NewChanDialog
|
|
|
|
from retranslateui import RetranslateMixin
|
2018-11-13 16:03:38 +01:00
|
|
|
from settings import SettingsDialog
|
2018-10-21 18:14:20 +02:00
|
|
|
from tr import _translate
|
2018-11-13 16:03:38 +01:00
|
|
|
from version import softwareVersion
|
|
|
|
|
2016-03-17 22:09:46 +01:00
|
|
|
|
2018-01-23 10:48:59 +01:00
|
|
|
__all__ = [
|
|
|
|
"NewChanDialog", "AddAddressDialog", "NewAddressDialog",
|
|
|
|
"NewSubscriptionDialog", "RegenerateAddressesDialog",
|
2018-11-13 16:03:38 +01:00
|
|
|
"SpecialAddressBehaviorDialog", "EmailGatewayDialog",
|
|
|
|
"SettingsDialog"
|
2018-01-23 10:48:59 +01:00
|
|
|
]
|
2018-01-18 17:47:09 +01:00
|
|
|
|
|
|
|
|
2017-10-13 00:36:54 +02:00
|
|
|
class AboutDialog(QtGui.QDialog, RetranslateMixin):
|
2018-10-21 18:14:20 +02:00
|
|
|
"""The `About` dialog"""
|
2017-10-13 00:36:54 +02:00
|
|
|
def __init__(self, parent=None):
|
|
|
|
super(AboutDialog, self).__init__(parent)
|
|
|
|
widgets.load('about.ui', self)
|
2017-11-07 12:46:23 +01:00
|
|
|
last_commit = paths.lastCommit()
|
2017-10-18 17:42:59 +02:00
|
|
|
version = softwareVersion
|
2017-11-07 12:46:23 +01:00
|
|
|
commit = last_commit.get('commit')
|
2017-10-13 00:36:54 +02:00
|
|
|
if commit:
|
2017-11-07 12:46:23 +01:00
|
|
|
version += '-' + commit[:7]
|
2017-10-18 17:42:59 +02:00
|
|
|
self.labelVersion.setText(
|
|
|
|
self.labelVersion.text().replace(
|
|
|
|
':version:', version
|
2018-10-21 18:14:20 +02:00
|
|
|
).replace(':branch:', commit or 'v%s' % version)
|
2017-10-18 17:42:59 +02:00
|
|
|
)
|
|
|
|
self.labelVersion.setOpenExternalLinks(True)
|
2017-10-13 00:36:54 +02:00
|
|
|
|
2017-11-07 12:46:23 +01:00
|
|
|
try:
|
|
|
|
self.label_2.setText(
|
|
|
|
self.label_2.text().replace(
|
2019-12-27 18:23:02 +01:00
|
|
|
'2020', str(last_commit.get('time').year)
|
2017-11-07 12:46:23 +01:00
|
|
|
))
|
|
|
|
except AttributeError:
|
|
|
|
pass
|
|
|
|
|
2018-02-02 17:31:07 +01:00
|
|
|
self.setFixedSize(QtGui.QWidget.sizeHint(self))
|
2017-11-07 12:46:23 +01:00
|
|
|
|
2017-10-13 00:36:54 +02:00
|
|
|
|
|
|
|
class IconGlossaryDialog(QtGui.QDialog, RetranslateMixin):
|
2018-10-21 18:14:20 +02:00
|
|
|
"""The `Icon Glossary` dialog, explaining the status icon colors"""
|
2017-10-13 00:36:54 +02:00
|
|
|
def __init__(self, parent=None, config=None):
|
|
|
|
super(IconGlossaryDialog, self).__init__(parent)
|
|
|
|
widgets.load('iconglossary.ui', self)
|
|
|
|
|
2018-10-21 18:14:20 +02:00
|
|
|
# .. todo:: FIXME: check the window title visibility here
|
2017-11-03 13:28:48 +01:00
|
|
|
self.groupBox.setTitle('')
|
|
|
|
|
2017-10-13 00:36:54 +02:00
|
|
|
self.labelPortNumber.setText(_translate(
|
|
|
|
"iconGlossaryDialog",
|
|
|
|
"You are using TCP port %1. (This can be changed in the settings)."
|
2018-10-21 18:14:20 +02:00
|
|
|
).arg(config.getint('bitmessagesettings', 'port')))
|
2018-02-02 17:31:07 +01:00
|
|
|
self.setFixedSize(QtGui.QWidget.sizeHint(self))
|
2017-10-16 15:09:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
class HelpDialog(QtGui.QDialog, RetranslateMixin):
|
2018-10-21 18:14:20 +02:00
|
|
|
"""The `Help` dialog"""
|
2017-10-16 15:09:52 +02:00
|
|
|
def __init__(self, parent=None):
|
|
|
|
super(HelpDialog, self).__init__(parent)
|
|
|
|
widgets.load('help.ui', self)
|
2018-02-02 17:31:07 +01:00
|
|
|
self.setFixedSize(QtGui.QWidget.sizeHint(self))
|
2017-10-16 15:09:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ConnectDialog(QtGui.QDialog, RetranslateMixin):
|
2018-10-21 18:14:20 +02:00
|
|
|
"""The `Connect` dialog"""
|
2017-10-16 15:09:52 +02:00
|
|
|
def __init__(self, parent=None):
|
|
|
|
super(ConnectDialog, self).__init__(parent)
|
|
|
|
widgets.load('connect.ui', self)
|
2018-02-02 17:31:07 +01:00
|
|
|
self.setFixedSize(QtGui.QWidget.sizeHint(self))
|