Merge pull request #21 from Atheros1/master

Various small changes
This commit is contained in:
Jonathan Warren 2013-01-04 14:37:15 -08:00
commit fa9397f89d
5 changed files with 112 additions and 98 deletions

View File

@ -5,7 +5,7 @@
#Right now, PyBitmessage only support connecting to stream 1. It doesn't yet contain logic to expand into further streams. #Right now, PyBitmessage only support connecting to stream 1. It doesn't yet contain logic to expand into further streams.
softwareVersion = '0.1.4' softwareVersion = '0.1.5'
verbose = 2 verbose = 2
maximumAgeOfAnObjectThatIAmWillingToAccept = 216000 #Equals two days and 12 hours. maximumAgeOfAnObjectThatIAmWillingToAccept = 216000 #Equals two days and 12 hours.
lengthOfTimeToLeaveObjectsInInventory = 237600 #Equals two days and 18 hours. This should be longer than maximumAgeOfAnObjectThatIAmWillingToAccept so that we don't process messages twice. lengthOfTimeToLeaveObjectsInInventory = 237600 #Equals two days and 18 hours. This should be longer than maximumAgeOfAnObjectThatIAmWillingToAccept so that we don't process messages twice.
@ -411,7 +411,7 @@ class receiveDataThread(QThread):
self.receivedgetbiginv = True self.receivedgetbiginv = True
sqlLock.acquire() sqlLock.acquire()
#Select all hashes which are younger than two days old and in this stream. #Select all hashes which are younger than two days old and in this stream.
t = (int(time.time())-172800,self.streamNumber) t = (int(time.time())-maximumAgeOfObjectsThatIAdvertiseToOthers,self.streamNumber)
sqlSubmitQueue.put('''SELECT hash FROM inventory WHERE receivedtime>? and streamnumber=?''') sqlSubmitQueue.put('''SELECT hash FROM inventory WHERE receivedtime>? and streamnumber=?''')
sqlSubmitQueue.put(t) sqlSubmitQueue.put(t)
queryreturn = sqlReturnQueue.get() queryreturn = sqlReturnQueue.get()
@ -424,7 +424,7 @@ class receiveDataThread(QThread):
#print 'bigInvList:', bigInvList #print 'bigInvList:', bigInvList
for hash, storedValue in inventory.items(): for hash, storedValue in inventory.items():
objectType, streamNumber, payload, receivedTime = storedValue objectType, streamNumber, payload, receivedTime = storedValue
if streamNumber == self.streamNumber and receivedTime > int(time.time())-172800: if streamNumber == self.streamNumber and receivedTime > int(time.time())-maximumAgeOfObjectsThatIAdvertiseToOthers:
bigInvList[hash] = 0 bigInvList[hash] = 0
numberOfObjectsInInvMessage = 0 numberOfObjectsInInvMessage = 0
payload = '' payload = ''
@ -819,7 +819,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:])
@ -890,6 +890,9 @@ class receiveDataThread(QThread):
bitfieldBehaviors = self.data[readPosition:readPosition+4] bitfieldBehaviors = self.data[readPosition:readPosition+4]
readPosition += 4 #for the bitfield of behaviors and features readPosition += 4 #for the bitfield of behaviors and features
addressVersion, varintLength = decodeVarint(self.data[readPosition:readPosition+10]) addressVersion, varintLength = decodeVarint(self.data[readPosition:readPosition+10])
if addressVersion >= 2:
'This version of Bitmessgae cannot handle version', addressVersion,'addresses.'
return
readPosition += varintLength readPosition += varintLength
streamNumber, varintLength = decodeVarint(self.data[readPosition:readPosition+10]) streamNumber, varintLength = decodeVarint(self.data[readPosition:readPosition+10])
readPosition += varintLength readPosition += varintLength
@ -930,6 +933,13 @@ class receiveDataThread(QThread):
if not self.isProofOfWorkSufficient(): if not self.isProofOfWorkSufficient():
print 'Proof of work in getpubkey message insufficient.' print 'Proof of work in getpubkey message insufficient.'
return return
embeddedTime, = unpack('>I',self.data[32:36])
if embeddedTime > int(time.time())+10800:
print 'The time in this getpubkey message is too new. Ignoring it. Time:', embeddedTime
return
if embeddedTime < int(time.time())-maximumAgeOfAnObjectThatIAmWillingToAccept:
print 'The time in this getpubkey message is too old. Ignoring it. Time:', embeddedTime
return
inventoryLock.acquire() inventoryLock.acquire()
inventoryHash = calculateInventoryHash(self.data[24:self.payloadLength+24]) inventoryHash = calculateInventoryHash(self.data[24:self.payloadLength+24])
if inventoryHash in inventory: if inventoryHash in inventory:
@ -942,25 +952,23 @@ class receiveDataThread(QThread):
return return
objectType = 'pubkeyrequest' objectType = 'pubkeyrequest'
inventory[inventoryHash] = (objectType, self.streamNumber, self.data[24:self.payloadLength+24], int(time.time())) inventory[inventoryHash] = (objectType, self.streamNumber, self.data[24:self.payloadLength+24], embeddedTime)
inventoryLock.release() inventoryLock.release()
#Now let us make sure that the getpubkey request isn't too old or with a fake (future) time. #Now let us make sure that the getpubkey request isn't too old or with a fake (future) time.
embeddedTime, = unpack('>I',self.data[32:36])
if embeddedTime > int(time.time())+10800:
print 'The time in this getpubkey message is too new. Ignoring it. Time:', embeddedTime
return
if embeddedTime < int(time.time())-maximumAgeOfAnObjectThatIAmWillingToAccept:
print 'The time in this getpubkey message is too old. Ignoring it. Time:', embeddedTime
return
addressVersionNumber, addressVersionLength = decodeVarint(self.data[36:42]) addressVersionNumber, addressVersionLength = decodeVarint(self.data[36:42])
if addressVersionNumber > 1:
print 'The addressVersionNumber of the pubkey is too high. Can\'t understand. Ignoring it.'
return
streamNumber, streamNumberLength = decodeVarint(self.data[36+addressVersionLength:42+addressVersionLength]) streamNumber, streamNumberLength = decodeVarint(self.data[36+addressVersionLength:42+addressVersionLength])
if streamNumber <> self.streamNumber: if streamNumber <> self.streamNumber:
print 'The streamNumber', streamNumber, 'doesn\'t match our stream number:', self.streamNumber print 'The streamNumber', streamNumber, 'doesn\'t match our stream number:', self.streamNumber
return return
#This getpubkey request is valid so far. Forward to peers.
broadcastToSendDataQueues((self.streamNumber,'send',self.data[:self.payloadLength+24]))
if addressVersionNumber > 1:
print 'The addressVersionNumber of the pubkey is too high. Can\'t understand. Ignoring it.'
return
if self.data[36+addressVersionLength+streamNumberLength:56+addressVersionLength+streamNumberLength] in myAddressHashes: if self.data[36+addressVersionLength+streamNumberLength:56+addressVersionLength+streamNumberLength] in myAddressHashes:
print 'Found getpubkey requested hash in my list of hashes.' print 'Found getpubkey requested hash in my list of hashes.'
#check to see whether we have already calculated the nonce and transmitted this key before #check to see whether we have already calculated the nonce and transmitted this key before
@ -1000,12 +1008,15 @@ class receiveDataThread(QThread):
sqlSubmitQueue.put(t) sqlSubmitQueue.put(t)
queryreturn = sqlReturnQueue.get() queryreturn = sqlReturnQueue.get()
#Now that we have the key either from getting it earlier or making it and storing it ourselves... #Now that we have the full pubkey message ready either from making it just now or making it earlier, we can send it out.
t = (self.data[36+addressVersionLength+streamNumberLength:56+addressVersionLength+streamNumberLength],) #this prevents SQL injection t = (self.data[36+addressVersionLength+streamNumberLength:56+addressVersionLength+streamNumberLength],) #this prevents SQL injection
sqlSubmitQueue.put('SELECT * FROM pubkeys WHERE hash=?') sqlSubmitQueue.put('''SELECT * FROM pubkeys WHERE hash=? AND havecorrectnonce=1''')
sqlSubmitQueue.put(t) sqlSubmitQueue.put(t)
queryreturn = sqlReturnQueue.get() queryreturn = sqlReturnQueue.get()
if queryreturn == []:
sys.stderr.write('Error: pubkey which we just put in our pubkey database suddenly is not there. Is the database malfunctioning?')
sqlLock.release()
return
for row in queryreturn: for row in queryreturn:
hash, havecorrectnonce, payload, timeLastRequested = row hash, havecorrectnonce, payload, timeLastRequested = row
if timeLastRequested < int(time.time())+604800: #if the last time anyone asked about this hash was this week, extend the time. if timeLastRequested < int(time.time())+604800: #if the last time anyone asked about this hash was this week, extend the time.
@ -1022,11 +1033,11 @@ class receiveDataThread(QThread):
self.broadcastinv(inventoryHash) self.broadcastinv(inventoryHash)
else: else:
print 'Hash in getpubkey is not mine.' print 'Hash in getpubkey request is not for any of my keys.'
#..but lets see if we have it stored from when it came in from someone else. #..but lets see if we have it stored from when it came in from someone else.
t = (self.data[36+addressVersionLength+streamNumberLength:56+addressVersionLength+streamNumberLength],) #this prevents SQL injection t = (self.data[36+addressVersionLength+streamNumberLength:56+addressVersionLength+streamNumberLength],) #this prevents SQL injection
sqlLock.acquire() sqlLock.acquire()
sqlSubmitQueue.put('''SELECT hash, time FROM pubkeys WHERE hash=? AND havecorrectnonce='True' ''') sqlSubmitQueue.put('''SELECT hash, transmitdata, time FROM pubkeys WHERE hash=? AND havecorrectnonce=1''')
sqlSubmitQueue.put(t) sqlSubmitQueue.put(t)
queryreturn = sqlReturnQueue.get() queryreturn = sqlReturnQueue.get()
sqlLock.release() sqlLock.release()
@ -1035,20 +1046,17 @@ class receiveDataThread(QThread):
print 'we have the public key. sending it.' print 'we have the public key. sending it.'
#We have it. Let's send it. #We have it. Let's send it.
for row in queryreturn: for row in queryreturn:
hash, timeLastRequested = row hash, transmitdata, timeLastRequested = row
if timeLastRequested < int(time.time())+604800: #if the last time anyone asked about this hash was this week, extend the time. if timeLastRequested < int(time.time())+604800: #if the last time anyone asked about this hash was this week, extend the time.
t = (int(time.time())+604800,hash) t = (int(time.time())+604800,hash)
sqlSubmitQueue.put('''UPDATE pubkeys set time=? WHERE hash=?''') sqlSubmitQueue.put('''UPDATE pubkeys set time=? WHERE hash=? ''')
sqlSubmitQueue.put(t) sqlSubmitQueue.put(t)
queryreturn = sqlReturnQueue.get() queryreturn = sqlReturnQueue.get()
inventoryHash = calculateInventoryHash(self.data[24:self.payloadLength+24]) inventoryHash = calculateInventoryHash(transmitdata)
objectType = 'pubkey' objectType = 'pubkey'
inventory[inventoryHash] = (objectType, self.streamNumber, self.data[24:self.payloadLength+24], int(time.time())) inventory[inventoryHash] = (objectType, self.streamNumber, transmitdata, int(time.time()))
self.broadcastinv(inventoryHash) self.broadcastinv(inventoryHash)
else:
#We don't have it. We'll need to forward the getpubkey request to our peers.
print 'We don\' have the public key. Forwarding getpubkey message to peers.'
broadcastToSendDataQueues((self.streamNumber,'send',self.data[:self.payloadLength+24]))
#We have received an inv message #We have received an inv message
def recinv(self): def recinv(self):
@ -1611,7 +1619,7 @@ class sqlThread(QThread):
self.cur.execute( '''CREATE TABLE whitelist (label text, address text, enabled bool)''' ) self.cur.execute( '''CREATE TABLE whitelist (label text, address text, enabled bool)''' )
self.cur.execute( '''CREATE TABLE pubkeys (hash blob, havecorrectnonce bool, transmitdata blob, time blob, UNIQUE(hash, havecorrectnonce, transmitdata) ON CONFLICT REPLACE)''' ) self.cur.execute( '''CREATE TABLE pubkeys (hash blob, havecorrectnonce bool, transmitdata blob, time blob, UNIQUE(hash, havecorrectnonce, transmitdata) ON CONFLICT REPLACE)''' )
self.cur.execute( '''CREATE TABLE inventory (hash blob, objecttype text, streamnumber int, payload blob, receivedtime integer, UNIQUE(hash) ON CONFLICT REPLACE)''' ) self.cur.execute( '''CREATE TABLE inventory (hash blob, objecttype text, streamnumber int, payload blob, receivedtime integer, UNIQUE(hash) ON CONFLICT REPLACE)''' )
self.cur.execute( '''CREATE TABLE knownnodes (timelastseen int, stream int, services blob, host blob, port blob, UNIQUE(host) ON CONFLICT REPLACE)''' ) #This table isn't used in the program yet but I have a feeling that we'll need it. self.cur.execute( '''CREATE TABLE knownnodes (timelastseen int, stream int, services blob, host blob, port blob, UNIQUE(host, stream, port) ON CONFLICT REPLACE)''' ) #This table isn't used in the program yet but I have a feeling that we'll need it.
self.conn.commit() self.conn.commit()
print 'Created messages database file' print 'Created messages database file'
@ -1895,6 +1903,7 @@ class singleWorker(QThread):
sqlLock.release() sqlLock.release()
for row in queryreturn: for row in queryreturn:
toaddress, fromaddress, subject, message, ackdata = row toaddress, fromaddress, subject, message, ackdata = row
ackdataForWhichImWatching[ackdata] = 0
status,addressVersionNumber,toStreamNumber,hash = decodeAddress(toaddress) status,addressVersionNumber,toStreamNumber,hash = decodeAddress(toaddress)
#if hash == toRipe: #if hash == toRipe:
self.emit(SIGNAL("updateSentItemStatusByAckdata(PyQt_PyObject,PyQt_PyObject)"),ackdata,'Doing work necessary to send the message.') self.emit(SIGNAL("updateSentItemStatusByAckdata(PyQt_PyObject,PyQt_PyObject)"),ackdata,'Doing work necessary to send the message.')
@ -2129,6 +2138,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):
@ -2230,6 +2240,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))
@ -2784,7 +2795,6 @@ class MyForm(QtGui.QMainWindow):
for i in range(4): #This will make 32 bytes of random data. for i in range(4): #This will make 32 bytes of random data.
random.seed() random.seed()
ackdata += pack('>Q',random.randrange(1, 18446744073709551615)) ackdata += pack('>Q',random.randrange(1, 18446744073709551615))
ackdataForWhichImWatching[ackdata] = 0
sqlLock.acquire() sqlLock.acquire()
t = ('',toAddress,ripe,fromAddress,subject,message,ackdata,int(time.time()),'findingpubkey',1,1,'sent') t = ('',toAddress,ripe,fromAddress,subject,message,ackdata,int(time.time()),'findingpubkey',1,1,'sent')
sqlSubmitQueue.put('''INSERT INTO sent VALUES (?,?,?,?,?,?,?,?,?,?,?,?)''') sqlSubmitQueue.put('''INSERT INTO sent VALUES (?,?,?,?,?,?,?,?,?,?,?,?)''')

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">