Windows resize to fit contents on different operating systems

This commit is contained in:
Jonathan Warren 2012-12-21 10:55:29 -05:00
parent 64fad80f44
commit 151358566a
5 changed files with 75 additions and 69 deletions

View File

@ -815,7 +815,7 @@ class receiveDataThread(QThread):
if ackDataValidThusFar: if ackDataValidThusFar:
print 'ackData is valid. Will process it.' print 'ackData is valid. Will process it.'
#self.data = self.data[:self.payloadLength+24] + ackData + self.data[self.payloadLength+24:] #self.data = self.data[:self.payloadLength+24] + ackData + self.data[self.payloadLength+24:]
self.ackDataThatWeHaveYetToSend.append(ackData) #When we have processed all data self.ackDataThatWeHaveYetToSend.append(ackData) #When we have processed all data, the processData function will pop the ackData out and process it as if it is a message received from our peer.
#print 'self.data after:', repr(self.data) #print 'self.data after:', repr(self.data)
'''if ackData[4:16] == 'msg\x00\x00\x00\x00\x00\x00\x00\x00\x00': '''if ackData[4:16] == 'msg\x00\x00\x00\x00\x00\x00\x00\x00\x00':
inventoryHash = calculateInventoryHash(ackData[24:]) inventoryHash = calculateInventoryHash(ackData[24:])
@ -2125,6 +2125,7 @@ class helpDialog(QtGui.QDialog):
self.ui.setupUi(self) self.ui.setupUi(self)
self.parent = parent self.parent = parent
self.ui.labelHelpURI.setOpenExternalLinks(True) self.ui.labelHelpURI.setOpenExternalLinks(True)
QtGui.QWidget.resize(self,QtGui.QWidget.sizeHint(self))
class aboutDialog(QtGui.QDialog): class aboutDialog(QtGui.QDialog):
def __init__(self,parent): def __init__(self,parent):
@ -2226,6 +2227,7 @@ class NewAddressDialog(QtGui.QDialog):
#print self.parent.ui.tableWidgetYourIdentities.item(row-1,1).text() #print self.parent.ui.tableWidgetYourIdentities.item(row-1,1).text()
self.ui.comboBoxExisting.addItem(self.parent.ui.tableWidgetYourIdentities.item(row-1,1).text()) self.ui.comboBoxExisting.addItem(self.parent.ui.tableWidgetYourIdentities.item(row-1,1).text())
row += 1 row += 1
#QtGui.QWidget.resize(self,QtGui.QWidget.sizeHint(self))

26
help.py
View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'help.ui' # Form implementation generated from reading ui file 'help.ui'
# #
# Created: Mon Nov 19 12:25:18 2012 # Created: Wed Dec 19 15:53:53 2012
# by: PyQt4 UI code generator 4.9.4 # by: PyQt4 UI code generator 4.9.4
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!
@ -17,19 +17,23 @@ except AttributeError:
class Ui_helpDialog(object): class Ui_helpDialog(object):
def setupUi(self, helpDialog): def setupUi(self, helpDialog):
helpDialog.setObjectName(_fromUtf8("helpDialog")) helpDialog.setObjectName(_fromUtf8("helpDialog"))
helpDialog.resize(335, 170) helpDialog.resize(335, 96)
self.formLayout = QtGui.QFormLayout(helpDialog)
self.formLayout.setObjectName(_fromUtf8("formLayout"))
self.labelHelpURI = QtGui.QLabel(helpDialog)
self.labelHelpURI.setObjectName(_fromUtf8("labelHelpURI"))
self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.labelHelpURI)
self.label = QtGui.QLabel(helpDialog)
self.label.setWordWrap(True)
self.label.setObjectName(_fromUtf8("label"))
self.formLayout.setWidget(0, QtGui.QFormLayout.SpanningRole, self.label)
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.formLayout.setItem(2, QtGui.QFormLayout.LabelRole, spacerItem)
self.buttonBox = QtGui.QDialogButtonBox(helpDialog) self.buttonBox = QtGui.QDialogButtonBox(helpDialog)
self.buttonBox.setGeometry(QtCore.QRect(30, 120, 281, 32))
self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.label = QtGui.QLabel(helpDialog) self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.buttonBox)
self.label.setGeometry(QtCore.QRect(30, 20, 291, 51))
self.label.setWordWrap(True)
self.label.setObjectName(_fromUtf8("label"))
self.labelHelpURI = QtGui.QLabel(helpDialog)
self.labelHelpURI.setGeometry(QtCore.QRect(30, 70, 301, 21))
self.labelHelpURI.setObjectName(_fromUtf8("labelHelpURI"))
self.retranslateUi(helpDialog) self.retranslateUi(helpDialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), helpDialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), helpDialog.accept)
@ -38,6 +42,6 @@ class Ui_helpDialog(object):
def retranslateUi(self, helpDialog): def retranslateUi(self, helpDialog):
helpDialog.setWindowTitle(QtGui.QApplication.translate("helpDialog", "Help", None, QtGui.QApplication.UnicodeUTF8)) helpDialog.setWindowTitle(QtGui.QApplication.translate("helpDialog", "Help", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("helpDialog", "As Bitmessage is a collaborative project, help can be found online in the Bitmessage Wiki:", None, QtGui.QApplication.UnicodeUTF8))
self.labelHelpURI.setText(QtGui.QApplication.translate("helpDialog", "<a href=\"http://Bitmessage.org/wiki/PyBitmessage_Help\">http://Bitmessage.org/wiki/PyBitmessage_Help</a>", None, QtGui.QApplication.UnicodeUTF8)) self.labelHelpURI.setText(QtGui.QApplication.translate("helpDialog", "<a href=\"http://Bitmessage.org/wiki/PyBitmessage_Help\">http://Bitmessage.org/wiki/PyBitmessage_Help</a>", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("helpDialog", "As Bitmessage is a collaborative project, help can be found online in the Bitmessage Wiki:", None, QtGui.QApplication.UnicodeUTF8))

89
help.ui
View File

@ -7,57 +7,54 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>335</width> <width>335</width>
<height>170</height> <height>96</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Help</string> <string>Help</string>
</property> </property>
<widget class="QDialogButtonBox" name="buttonBox"> <layout class="QFormLayout" name="formLayout">
<property name="geometry"> <item row="1" column="0">
<rect> <widget class="QLabel" name="labelHelpURI">
<x>30</x> <property name="text">
<y>120</y> <string>&lt;a href=&quot;http://Bitmessage.org/wiki/PyBitmessage_Help&quot;&gt;http://Bitmessage.org/wiki/PyBitmessage_Help&lt;/a&gt;</string>
<width>281</width> </property>
<height>32</height> </widget>
</rect> </item>
</property> <item row="0" column="0" colspan="2">
<property name="orientation"> <widget class="QLabel" name="label">
<enum>Qt::Horizontal</enum> <property name="text">
</property> <string>As Bitmessage is a collaborative project, help can be found online in the Bitmessage Wiki:</string>
<property name="standardButtons"> </property>
<set>QDialogButtonBox::Ok</set> <property name="wordWrap">
</property> <bool>true</bool>
</widget> </property>
<widget class="QLabel" name="label"> </widget>
<property name="geometry"> </item>
<rect> <item row="2" column="0">
<x>30</x> <spacer name="horizontalSpacer">
<y>20</y> <property name="orientation">
<width>291</width> <enum>Qt::Horizontal</enum>
<height>51</height> </property>
</rect> <property name="sizeHint" stdset="0">
</property> <size>
<property name="text"> <width>40</width>
<string>As Bitmessage is a collaborative project, help can be found online in the Bitmessage Wiki:</string> <height>20</height>
</property> </size>
<property name="wordWrap"> </property>
<bool>true</bool> </spacer>
</property> </item>
</widget> <item row="2" column="1">
<widget class="QLabel" name="labelHelpURI"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="geometry"> <property name="orientation">
<rect> <enum>Qt::Horizontal</enum>
<x>30</x> </property>
<y>70</y> <property name="standardButtons">
<width>301</width> <set>QDialogButtonBox::Ok</set>
<height>21</height> </property>
</rect> </widget>
</property> </item>
<property name="text"> </layout>
<string>&lt;a href=&quot;http://Bitmessage.org/wiki/PyBitmessage_Help&quot;&gt;http://Bitmessage.org/wiki/PyBitmessage_Help&lt;/a&gt;</string>
</property>
</widget>
</widget> </widget>
<resources/> <resources/>
<connections> <connections>

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'newaddressdialog.ui' # Form implementation generated from reading ui file 'newaddressdialog.ui'
# #
# Created: Tue Sep 25 16:40:04 2012 # Created: Wed Dec 19 15:55:07 2012
# by: PyQt4 UI code generator 4.9.4 # by: PyQt4 UI code generator 4.9.4
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!
@ -17,39 +17,42 @@ except AttributeError:
class Ui_NewAddressDialog(object): class Ui_NewAddressDialog(object):
def setupUi(self, NewAddressDialog): def setupUi(self, NewAddressDialog):
NewAddressDialog.setObjectName(_fromUtf8("NewAddressDialog")) NewAddressDialog.setObjectName(_fromUtf8("NewAddressDialog"))
NewAddressDialog.resize(368, 257) NewAddressDialog.resize(383, 258)
self.buttonBox = QtGui.QDialogButtonBox(NewAddressDialog) self.buttonBox = QtGui.QDialogButtonBox(NewAddressDialog)
self.buttonBox.setGeometry(QtCore.QRect(160, 220, 201, 32)) self.buttonBox.setGeometry(QtCore.QRect(160, 220, 201, 32))
self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.label = QtGui.QLabel(NewAddressDialog) self.label = QtGui.QLabel(NewAddressDialog)
self.label.setGeometry(QtCore.QRect(10, 10, 351, 31)) self.label.setGeometry(QtCore.QRect(10, 0, 361, 41))
self.label.setAlignment(QtCore.Qt.AlignBottom|QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft)
self.label.setWordWrap(True) self.label.setWordWrap(True)
self.label.setObjectName(_fromUtf8("label")) self.label.setObjectName(_fromUtf8("label"))
self.label_2 = QtGui.QLabel(NewAddressDialog) self.label_2 = QtGui.QLabel(NewAddressDialog)
self.label_2.setGeometry(QtCore.QRect(20, 50, 301, 20)) self.label_2.setGeometry(QtCore.QRect(20, 50, 301, 20))
self.label_2.setObjectName(_fromUtf8("label_2")) self.label_2.setObjectName(_fromUtf8("label_2"))
self.newaddresslabel = QtGui.QLineEdit(NewAddressDialog) self.newaddresslabel = QtGui.QLineEdit(NewAddressDialog)
self.newaddresslabel.setGeometry(QtCore.QRect(20, 70, 341, 20)) self.newaddresslabel.setGeometry(QtCore.QRect(20, 70, 351, 20))
self.newaddresslabel.setObjectName(_fromUtf8("newaddresslabel")) self.newaddresslabel.setObjectName(_fromUtf8("newaddresslabel"))
self.radioButtonMostAvailable = QtGui.QRadioButton(NewAddressDialog) self.radioButtonMostAvailable = QtGui.QRadioButton(NewAddressDialog)
self.radioButtonMostAvailable.setGeometry(QtCore.QRect(20, 110, 401, 16)) self.radioButtonMostAvailable.setGeometry(QtCore.QRect(20, 110, 401, 16))
self.radioButtonMostAvailable.setChecked(True) self.radioButtonMostAvailable.setChecked(True)
self.radioButtonMostAvailable.setObjectName(_fromUtf8("radioButtonMostAvailable")) self.radioButtonMostAvailable.setObjectName(_fromUtf8("radioButtonMostAvailable"))
self.radioButtonExisting = QtGui.QRadioButton(NewAddressDialog) self.radioButtonExisting = QtGui.QRadioButton(NewAddressDialog)
self.radioButtonExisting.setGeometry(QtCore.QRect(20, 150, 271, 18)) self.radioButtonExisting.setGeometry(QtCore.QRect(20, 150, 351, 18))
self.radioButtonExisting.setChecked(False) self.radioButtonExisting.setChecked(False)
self.radioButtonExisting.setObjectName(_fromUtf8("radioButtonExisting")) self.radioButtonExisting.setObjectName(_fromUtf8("radioButtonExisting"))
self.label_3 = QtGui.QLabel(NewAddressDialog) self.label_3 = QtGui.QLabel(NewAddressDialog)
self.label_3.setGeometry(QtCore.QRect(33, 123, 331, 21)) self.label_3.setGeometry(QtCore.QRect(35, 127, 351, 20))
self.label_3.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
self.label_3.setObjectName(_fromUtf8("label_3")) self.label_3.setObjectName(_fromUtf8("label_3"))
self.label_4 = QtGui.QLabel(NewAddressDialog) self.label_4 = QtGui.QLabel(NewAddressDialog)
self.label_4.setGeometry(QtCore.QRect(37, 167, 341, 16)) self.label_4.setGeometry(QtCore.QRect(37, 167, 351, 21))
self.label_4.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
self.label_4.setObjectName(_fromUtf8("label_4")) self.label_4.setObjectName(_fromUtf8("label_4"))
self.comboBoxExisting = QtGui.QComboBox(NewAddressDialog) self.comboBoxExisting = QtGui.QComboBox(NewAddressDialog)
self.comboBoxExisting.setEnabled(False) self.comboBoxExisting.setEnabled(False)
self.comboBoxExisting.setGeometry(QtCore.QRect(40, 190, 321, 22)) self.comboBoxExisting.setGeometry(QtCore.QRect(40, 190, 331, 22))
self.comboBoxExisting.setEditable(True) self.comboBoxExisting.setEditable(True)
self.comboBoxExisting.setObjectName(_fromUtf8("comboBoxExisting")) self.comboBoxExisting.setObjectName(_fromUtf8("comboBoxExisting"))
@ -61,7 +64,7 @@ class Ui_NewAddressDialog(object):
def retranslateUi(self, NewAddressDialog): def retranslateUi(self, NewAddressDialog):
NewAddressDialog.setWindowTitle(QtGui.QApplication.translate("NewAddressDialog", "Create new Address", None, QtGui.QApplication.UnicodeUTF8)) NewAddressDialog.setWindowTitle(QtGui.QApplication.translate("NewAddressDialog", "Create new Address", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("NewAddressDialog", "Here you may generate as many addresses as you like. Indeed, creating many addresses is encouraged.", None, QtGui.QApplication.UnicodeUTF8)) self.label.setText(QtGui.QApplication.translate("NewAddressDialog", "Here you may generate as many addresses as you like. Indeed, creating and abandoning addresses is encouraged.", None, QtGui.QApplication.UnicodeUTF8))
self.label_2.setText(QtGui.QApplication.translate("NewAddressDialog", "Label (not shown to anyone except you)", None, QtGui.QApplication.UnicodeUTF8)) self.label_2.setText(QtGui.QApplication.translate("NewAddressDialog", "Label (not shown to anyone except you)", None, QtGui.QApplication.UnicodeUTF8))
self.radioButtonMostAvailable.setText(QtGui.QApplication.translate("NewAddressDialog", "Use the most available stream", None, QtGui.QApplication.UnicodeUTF8)) self.radioButtonMostAvailable.setText(QtGui.QApplication.translate("NewAddressDialog", "Use the most available stream", None, QtGui.QApplication.UnicodeUTF8))
self.radioButtonExisting.setText(QtGui.QApplication.translate("NewAddressDialog", "Use the same stream as an existing address", None, QtGui.QApplication.UnicodeUTF8)) self.radioButtonExisting.setText(QtGui.QApplication.translate("NewAddressDialog", "Use the same stream as an existing address", None, QtGui.QApplication.UnicodeUTF8))

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>384</width> <width>383</width>
<height>257</height> <height>258</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">