fclient-commit Mailing List for fclient (Page 6)
Status: Pre-Alpha
Brought to you by:
jurner
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(23) |
Nov
(54) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(17) |
Feb
(209) |
Mar
(63) |
Apr
(31) |
May
(7) |
Jun
(39) |
Jul
(390) |
Aug
(122) |
Sep
(6) |
Oct
|
Nov
|
Dec
|
From: <jU...@us...> - 2008-08-01 23:51:47
|
Revision: 845 http://fclient.svn.sourceforge.net/fclient/?rev=845&view=rev Author: jUrner Date: 2008-08-01 23:51:57 +0000 (Fri, 01 Aug 2008) Log Message: ----------- experimental, add a led widget Added Paths: ----------- trunk/fclient/fclient/impl/lib/qt4ex/led.py Added: trunk/fclient/fclient/impl/lib/qt4ex/led.py =================================================================== --- trunk/fclient/fclient/impl/lib/qt4ex/led.py (rev 0) +++ trunk/fclient/fclient/impl/lib/qt4ex/led.py 2008-08-01 23:51:57 UTC (rev 845) @@ -0,0 +1,121 @@ +"""2 state Led widget mostly taken from Eric4's E4Led, thanks detlev +(kde4s KLed is incredibly slow...) +""" + + +from PyQt4 import QtCore, QtGui +#********************************************************************************** +# +#********************************************************************************** + +class Led(QtGui.QWidget): + + + def __init__(self, parent=None, colorOn=QtGui.QColor('green'), colorOff=QtGui.QColor('red'), isOn=True): + QtGui.QWidget.__init__(self, parent) + + self.__isOn = isOn + self._colorOn = colorOn + self._colorOff =colorOff + self._timer = None + + def isOn(self): + return self.__isOn + def setOn(self, flag): + self.__isOn = flag + self.update() + return True + isOn = QtCore.pyqtProperty("bool",isOn, setOn) + + + def paintEvent(self, event): + self.paintRaised() + + + def ledWidth(self): + width = self.width() + + # enshure Led is round + if width > self.height(): + width = self.height() + + # leave one pixel border + width -= 2 + width = 0 if width < 0 else width + return width + + def paintRaised(self): + """""" + # Initialize coordinates, width and height of the LED + width = self.ledWidth() + palette = self.palette() + + # Calculate the gradient for the LED + wh = int(width / 2) + color = self.colorOn() if self.isOn else self.colorOff() + + gradient = QtGui.QRadialGradient(wh, wh, wh, 0.8 * wh, 0.8 * wh) + gradient.setColorAt(0.0, color.light(200)) + gradient.setColorAt(0.6, color) + gradient.setColorAt(1.0, color.dark()) + + # now do the drawing + paint = QtGui.QPainter(self) + paint.setRenderHint(paint.Antialiasing, True) + paint.setBrush(QtGui.QBrush(gradient)) + paint.setPen(QtCore.Qt.NoPen) + paint.drawEllipse(1, 1, width, width) + paint.end() + + + def colorOn(self): + return self._colorOn + + def colorOff(self): + return self._colorOff + + def setColorOn(self, color): + self.colorOn = color + if self.isOn(): + self.update() + + def setColorOff(self, color): + self.colorOff = color + if self.isOff(): + self.update() + + + def flashing(self): + if self._timer is not None: + return self._timer.isActive() + return False + + def setFlashing(self, flag, interval=300): + if flag: + if not self._timer: + self._timer = QtCore.QTimer(self) + self.connect(self._timer, QtCore.SIGNAL('timeout()'), self.onTimerTimeout) + self._timer.setInterval(interval) + self._timer.start() + else: + if self._timer is not None: + self._timer.stop() + + + def onTimerTimeout(self): + if self._timer.isActive(): + self.setOn(not self.isOn) + + + +#********************************************************************************** +# +#********************************************************************************** +if __name__ == '__main__': + import sys + + app = QtGui.QApplication(sys.argv) + w = Led(None) + w.show() + res = app.exec_() + sys.exit(res) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-01 23:49:42
|
Revision: 844 http://fclient.svn.sourceforge.net/fclient/?rev=844&view=rev Author: jUrner Date: 2008-08-01 23:49:50 +0000 (Fri, 01 Aug 2008) Log Message: ----------- all requests can be registered now (except from pluginMessage) Modified Paths: -------------- trunk/fclient/fclient/impl/lib/fcp2/client.py Modified: trunk/fclient/fclient/impl/lib/fcp2/client.py =================================================================== --- trunk/fclient/fclient/impl/lib/fcp2/client.py 2008-08-01 23:48:53 UTC (rev 843) +++ trunk/fclient/fclient/impl/lib/fcp2/client.py 2008-08-01 23:49:50 UTC (rev 844) @@ -381,6 +381,10 @@ @note: the client can only deal with requests registered here @note: the identifier returned is unique to the client but may not be unique to the node """ + + if msg == message.MsgFCPPluginMessage: + raise ValueError('Can not register plugin messages') + identifier = self.newIdentifier(identifiers=self._requests) if identifier is None else identifier # equip requests with some additional params @@ -388,6 +392,7 @@ #TODO: keep an eye on additional params, they may collide with Fcp parameters msg['Identifier'] = self.newIdentifier(identifiers=self._requests) if identifier is None else identifier msg['InitTime'] = time.time() if initTime is None else initTime + msg['RequestStatus'] = consts.ConstRequestStatus.Null if msg == message.MsgClientGet: msg['HandleFilenameCollision'] = handleFilenameCollision msg['HandlePermanentRedirect'] = handlePermanentRedirect @@ -406,11 +411,7 @@ pass elif msg == message.MsgSubscribeUSK: msg['UserData'] = userData - elif msg == message.MsgGetPluginInfo: - pass - else: - raise ValueError('Can not register request: ' + msg.name) - + self._requests[identifier] = msg ############################################################### @@ -798,14 +799,20 @@ ## #################################################### elif msg == message.MsgConfigData: - self.events.ConfigData(msg) + if initialRequest is None: #NOTE: just in case fcp supports global notifications some day + self.events.ConfigData(msg) + else: + self._finalizeRequest(msg, initialRequest, self.events.ConfigData) return True elif msg == message.MsgNodeData: - self.events.NodeData(msg) + if initialRequest is None: #NOTE: just in case fcp supports global notifications some day + self.events.NodeData(msg) + else: + self._finalizeRequest(msg, initialRequest, self.events.NodeData) return True - #################################################### + #################################################### ## ## get / put related ## @@ -844,7 +851,6 @@ ) else: self._finalizeRequest(msg, initialRequest, self.events.RequestCompleted) - return True @@ -1040,32 +1046,42 @@ ## #################################################### elif msg == message.MsgEndListPeers: - self.events.EndListPeers(msg) + self._finalizeRequest(msg, initialRequest, self.events.EndListPeers) return True elif msg == message.MsgEndListPeerNotes: - self.events.EndListPeerNotes(msg.params) + self._finalizeRequest(msg, initialRequest, self.events.EndListPeerNotes) return True elif msg == message.MsgPeer: - self.events.Peer(msg) + if initialRequest is None: #NOTE: just in case fcp supports global notifications some day + self.events.Peer(msg) + else: + self._finalizeRequest(msg, initialRequest, self.events.Peer) return True elif msg == message.MsgPeerNote: - self.events.PeerNote(msg) + if initialRequest is None: #NOTE: just in case fcp supports global notifications some day + self.events.PeerNote(msg) + else: + self._finalizeRequest(msg, initialRequest, self.events.PeerNote) return True elif msg == message.MsgPeerRemoved: - self.events.PeerRemoved(msg) + if initialRequest is None: #NOTE: just in case fcp supports global notifications some day + self.events.PeerRemoved(msg) + else: + self._finalizeRequest(msg, initialRequest, self.events.PeerRemoved) return True elif msg == message.MsgUnknownNodeIdentifier: - self.events.PeerUnknown(msg) + self._finalizeRequest(msg, initialRequest, self.events.PeerUnknown) return True elif msg == message.MsgUnknownPeerNoteType: - self.events.PeerNoteTypeUnknown(msg) + self._finalizeRequest(msg, initialRequest, self.events.NoteTypeUnknown) return True + #################################################### ## ## plugins @@ -1112,6 +1128,7 @@ self._finalizeRequest(msg, initialRequest, self.events.KeypairGenerated) return True + #NOTE: can not be removed. so don't finalize elif msg == message.MsgSubscribedUSKUpdate: if initialRequest is None: return False @@ -2012,6 +2029,28 @@ else: del self._requests[request['Identifier']] + + def resendRequest(self, request): + + if request == message.MsgFCPPluginMessage: + # we can not register plugin messages, cause we don't know if we get a reply + pass + else: + if request['Identifier'] in self._requests: + self.removeRequest(request) + self.registerRequest( + request, + userData=request['UserData'], + identifier=None, + initTime=None, + persistentUserData=request['PersistentUserData'], + handleFilenameCollision=request.get('HandleFilenameCollision', False), + handlePermanentRedirect=request.get('HandleFilenameCollision', False), + ) + self.sendMessage(request) + return request + + ######################################################## ## ## Peer related methods @@ -2027,24 +2066,24 @@ @param withVolatile: if True, statistical data is included @param giveOpennetRef: if True, the opennet reference is retuned instead of the darknet """ - self.sendMessage( - message.MsgGetNode( + msg = message.MsgGetNode( WithPrivate=withPrivate, WithVolatile=withVolatile, GiveOpennetRef=giveOpennetRef, ) - ) + self.registerRequest(msg) + self.sendMessage(msg) + return msg def listPeer(self, identity): """Requests information about a peer node @param identity: identity of the peer to request information for """ - self.sendMessage( - message.MsgListPeer( - NodeIdentifier=identity, - ) - ) + msg = message.MsgListPeer(NodeIdentifier=identity) + self.registerRequest(msg) + self.sendMessage(msg) + return msg def listPeerNotes(self, identity): @@ -2054,11 +2093,10 @@ @event: EndListPeerNotes(event, params) @note: listPeerNotes() is only available for darknet nodes """ - self.sendMessage( - message.MsgListPeerNotes( - NodeIdentifier=identity - ) - ) + msg = message.MsgListPeerNotes(NodeIdentifier=identity) + self.registerRequest(msg) + self.sendMessage(msg) + return msg def listPeers(self, withMetaData=True, withVolantile=True): @@ -2069,12 +2107,13 @@ @event: Peer(event, peer). @event: EndListPeers(event, params). """ - self.sendMessage( - message.MsgListPeers( + msg = message.MsgListPeers( WithMetadata=withMetaData, WithVolatile=withVolantile, ) - ) + self.registerRequest(msg) + self.sendMessage(msg) + return msg def modifyPeer(self, identitty, allowLocalAddresses=None, isDisabled=None, isListenOnly=None): @@ -2086,18 +2125,16 @@ @note: you can only modify darknet peers """ - msg = MessageEx( - message.MsgModifyPeer( - NodeIdentifier=identity, - ) - ) + msg = message.MsgModifyPeer(NodeIdentifier=identity) if allowLocalAddresses is not None: msg['AllowLocalAddresses'] = allowLocalAddresses if isDisabled is not None: msg['IsDisabled'] = isDisabled if isListenOnly is not None: msg['IsListenOnly'] = isListenOnly + self.registerRequest(msg) self.sendMessage(msg) + return msg def modifyPeerNote(self, identity, note): @@ -2107,25 +2144,25 @@ @note: you can only modify notes of darknet peers """ - self.sendMessage( - message.MsgModifyPeerNote( + msg = message.MsgModifyPeerNote( NodeIdentifier=identity, #NOTE: currently fcp supports only this one type PeerNoteType=consts.ConstPeerNoteType.Private, NoteText=note ) - ) + self.registerRequest(msg) + self.sendMessage(msg) + return msg def removePeer(self, identity): """Removes a peer @param identity: identity of the peer node to remove """ - self.sendMessage( - message.MsgRemovePeer( - NodeIdentifier=identity, - ) - ) + msg = message.MsgRemovePeer(NodeIdentifier=identity) + self.registerRequest(msg) + self.sendMessage(msg) + return msg ########################################################## ## This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-01 23:48:44
|
Revision: 843 http://fclient.svn.sourceforge.net/fclient/?rev=843&view=rev Author: jUrner Date: 2008-08-01 23:48:53 +0000 (Fri, 01 Aug 2008) Log Message: ----------- equip all messages with custon params Modified Paths: -------------- trunk/fclient/fclient/impl/lib/fcp2/message.py Modified: trunk/fclient/fclient/impl/lib/fcp2/message.py =================================================================== --- trunk/fclient/fclient/impl/lib/fcp2/message.py 2008-07-31 18:45:36 UTC (rev 842) +++ trunk/fclient/fclient/impl/lib/fcp2/message.py 2008-08-01 23:48:53 UTC (rev 843) @@ -70,7 +70,7 @@ __metaclass__ = _MessageMeta name = '' - _additional_params_ = {} + _additional_params_ = {} _param_types_ = {} _persistent_params_ = () @@ -198,10 +198,14 @@ # as private so they don't get send to the node # #******************************************************************************** -_AdditionalGetParams = { +_AdditionalParamsCommon = { + _PrivateParam('InitTime'): 0, # when was the request started? + _PrivateParam('RequestStatus'): consts.ConstRequestStatus.Null, + } + +_AdditionalParamsGet = { # persistent params - _PrivateParam('InitTime'): 0, # when was the request started? _PrivateParam('PersistentUserData'): '', # any user defined persistent data _PrivateParam('HandleFilenameCollision'): False, _PrivateParam('FilenameCollisionHandled'): False, @@ -210,7 +214,6 @@ _PrivateParam('IsGetKeyInfo'): False, # non persistent params - _PrivateParam('RequestStatus'): consts.ConstRequestStatus.Null, _PrivateParam('ErrorMessage'): None, # error message in case an error occured _PrivateParam('UserData'): None, # any user defined runtime data here @@ -231,16 +234,14 @@ _PrivateParam('ProgressFatalyFailed'): 0, _PrivateParam('ProgressSucceeeded'): 0, } +_AdditionalParamsGet.update(_AdditionalParamsCommon) - -_AdditionalPutParams = { +_AdditionalParamsPut = { # persistent params - _PrivateParam('InitTime'): 0, # when was the request started? _PrivateParam('PersistentUserData'): '', # any user defined persistent data # non persistent params - _PrivateParam('RequestStatus'): consts.ConstRequestStatus.Null, _PrivateParam('ErrorMessage'): None, # error message in case an error occured _PrivateParam('UserData'): None, # any user defined runtime data here @@ -261,25 +262,19 @@ _PrivateParam('ProgressFatalyFailed'): 0, _PrivateParam('ProgressSucceeeded'): 0, } +_AdditionalParamsPut.update(_AdditionalParamsCommon) -_GenerateSSKParams = { - _PrivateParam('RequestStatus'): consts.ConstRequestStatus.Null, - _PrivateParam('InitTime'): 0, # when was the request started? +_AdditionalParamsGenerateSSK = { _PrivateParam('KeyPairType'): consts.ConstKeyType.SSK, } +_AdditionalParamsGenerateSSK.update(_AdditionalParamsCommon) -_SubscribeUSKParams = { - _PrivateParam('RequestStatus'): consts.ConstRequestStatus.Null, - _PrivateParam('InitTime'): 0, # when was the request started? +_AdditionalParamsSubscribeUSK = { _PrivateParam('UserData'): None, _PrivateParam('Edition'): -1, } +_AdditionalParamsSubscribeUSK.update(_AdditionalParamsCommon) -_PluginInfoParams = { - _PrivateParam('RequestStatus'): consts.ConstRequestStatus.Null, - _PrivateParam('InitTime'): 0, # when was the request started? - } - #******************************************************************************** # equip Get / Put messages with some persistent params # @@ -323,21 +318,21 @@ #******************************************************************************** class MsgClientDisconnected(_MessageBase): name = consts.ConstMessage.ClientDisconnected - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'DisconnectReason': types.TypeInt, } class MsgClientSocketDied(_MessageBase): name = consts.ConstMessage.ClientSocketDied - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { } class MsgClientSocketTimeout(_MessageBase): name = consts.ConstMessage.ClientSocketTimeout - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { } @@ -346,7 +341,7 @@ #******************************************************************************** class MsgAddPeer(_MessageBase): name = consts.ConstMessage.AddPeer - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'ark.number': types.TypeInt, 'auth.negTypes': types.TypeInt, @@ -394,7 +389,7 @@ class MsgAllData(_MessageBase): name = consts.ConstMessage.AllData - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'DataLength': types.TypeInt, 'Global': types.TypeBool, @@ -406,7 +401,7 @@ class MsgClientGet(_MessageBase): name = consts.ConstMessage.ClientGet - _additional_params_ = _AdditionalGetParams + _additional_params_ = _AdditionalParamsGet _param_types_ = { 'BinaryBlob': types.TypeBool, 'DSOnly': types.TypeBool, @@ -444,7 +439,7 @@ class MsgClientHello(_MessageBase): name = consts.ConstMessage.ClientHello - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'ExpectedVersion': types.TypeFloat, } @@ -452,7 +447,7 @@ class MsgClientPut(_MessageBase): name = consts.ConstMessage.ClientPut - _additional_params_ = _AdditionalPutParams + _additional_params_ = _AdditionalParamsPut _param_types_ = { 'BinaryBlob': types.TypeBool, 'DataLength': types.TypeInt, @@ -520,20 +515,20 @@ class MsgCloseConnectionDuplicateClientName(_MessageBase): name = consts.ConstMessage.CloseConnectionDuplicateClientName - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { } class MsgConfigData(_MessageBase): name = consts.ConstMessage.ConfigData - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = config._ConfigMessageParamTypes class MsgDataFound(_MessageBase): name = consts.ConstMessage.DataFound - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'DataLength': types.TypeInt, 'Global': types.TypeBool, @@ -542,35 +537,35 @@ class MsgEndListPeerNotes(_MessageBase): name = consts.ConstMessage.EndListPeerNotes - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { } class MsgEndListPeers(_MessageBase): name = consts.ConstMessage.EndListPeers - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { } class MsgEndListPersistentRequests(_MessageBase): name = consts.ConstMessage.EndListPersistentRequests - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { } class MsgFCPPluginMessage(_MessageBase): name = consts.ConstMessage.FCPPluginMessage - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { } class MsgFCPPluginReply(_MessageBase): name = consts.ConstMessage.FCPPluginReply - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'DataLength': types.TypeInt, } @@ -578,7 +573,7 @@ class MsgFinishedCompression(_MessageBase): name = consts.ConstMessage.FinishedCompression - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'CompressedSize': types.TypeInt, 'OriginalSize': types.TypeInt, @@ -587,14 +582,14 @@ class MsgGenerateSSK(_MessageBase): name = consts.ConstMessage.GenerateSSK - _additional_params_ = _GenerateSSKParams + _additional_params_ = _AdditionalParamsGenerateSSK _param_types_ = { } class MsgGetConfig(_MessageBase): name = consts.ConstMessage.GetConfig - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'WithCurrent': types.TypeBool, 'WithDefaults': types.TypeBool, @@ -609,7 +604,7 @@ class MsgGetFailed(_MessageBase): name = consts.ConstMessage.GetFailed - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'Code': types.TypeInt, 'ExpectedDataLength': types.TypeInt_GetFailed_ExpectedDataLenght, @@ -622,7 +617,7 @@ class MsgGetNode(_MessageBase): name = consts.ConstMessage.GetNode - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'GiveOpennetRef': types.TypeBool, 'WithPrivate': types.TypeBool, @@ -632,7 +627,7 @@ class MsgGetPluginInfo(_MessageBase): name = consts.ConstMessage.GetPluginInfo - _additional_params_ = _PluginInfoParams + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'Started': types.TypeBool, } @@ -640,7 +635,7 @@ class MsgGetRequestStatus(_MessageBase): name = consts.ConstMessage.GetRequestStatus - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'Global': types.TypeBool, 'OnlyData': types.TypeBool, @@ -649,7 +644,7 @@ class MsgIdentifierCollision(_MessageBase): name = consts.ConstMessage.IdentifierCollision - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'Global': types.TypeBool, } @@ -657,7 +652,7 @@ class MsgListPeer(_MessageBase): name = consts.ConstMessage.ListPeer - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'WithMetadata': types.TypeBool, 'WithVolantile': types.TypeBool, @@ -666,7 +661,7 @@ class MsgListPeerNotes(_MessageBase): name = consts.ConstMessage.ListPeerNotes - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { } @@ -674,7 +669,7 @@ class MsgListPeers(_MessageBase): name = consts.ConstMessage.ListPeers - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'WithMetadata': types.TypeBool, 'WithVolantile': types.TypeBool, @@ -683,27 +678,27 @@ class MsgListPersistentRequests(_MessageBase): name = consts.ConstMessage.ListPersistentRequests - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { } class MsgModifyConfig(_MessageBase): name = consts.ConstMessage.ModifyConfig - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = config._ConfigMessageParamTypes class MsgModifyPeer(_MessageBase): name = consts.ConstMessage.ModifyPeer - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { } class MsgModifyPeerNote(_MessageBase): name = consts.ConstMessage.ModifyPeerNote - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { #'Peernotetype': types.TypeInt, #???? } @@ -711,7 +706,7 @@ class MsgModifyPersistentRequest(_MessageBase): name = consts.ConstMessage.ModifyPersistentRequest - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'Global': types.TypeBool, } @@ -719,7 +714,7 @@ class MsgNodeData(_MessageBase): name = consts.ConstMessage.NodeData - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'ark.number': types.TypeInt, 'ark.privURI': key.TypeKey, @@ -832,7 +827,7 @@ class MsgNodeHello(_MessageBase): name = consts.ConstMessage.NodeHello - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'Build': types.TypeInt, 'CompressionCodecs': types.TypeInt, @@ -844,13 +839,13 @@ class MsgPeer(_MessageBase): name = consts.ConstMessage.Peer - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = MsgAddPeer._param_types_ class MsgPeerNote(_MessageBase): name = consts.ConstMessage.PeerNote - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'NoteText': types.TypeBase64EncodedString, } @@ -858,28 +853,28 @@ class MsgPeerRemoved(_MessageBase): name = consts.ConstMessage.PeerRemoved - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { } class MsgPersistentGet(MsgClientGet): name = consts.ConstMessage.PersistentGet - _additional_params_ = _AdditionalGetParams + _additional_params_ = _AdditionalParamsGet _param_types_ = MsgClientGet._param_types_.copy() _param_types_['Started'] = types.TypeBool class MsgPersistentPut(MsgClientPut): name = consts.ConstMessage.PersistentPut - _additional_params_ = _AdditionalPutParams + _additional_params_ = _AdditionalParamsPut _param_types_ = MsgClientPut._param_types_.copy() _param_types_['Started'] = types.TypeBool class MsgPersistentPutDir(MsgClientPut): name = consts.ConstMessage.PersistentPutDir - _additional_params_ = _AdditionalPutParams + _additional_params_ = _AdditionalParamsPut _param_types_ = MsgClientPutDiskDir._param_types_.copy() _param_types_['Started'] = types.TypeBool @@ -897,7 +892,7 @@ class MsgPersistentRequestModified(_MessageBase): name = consts.ConstMessage.PersistentRequestModified - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'Global': types.TypeBool, } @@ -905,7 +900,7 @@ class MsgPersistentRequestRemoved(_MessageBase): name = consts.ConstMessage.PersistentRequestRemoved - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'Global': types.TypeBool, } @@ -913,14 +908,14 @@ class MsgPluginInfo(_MessageBase): name = consts.ConstMessage.PluginInfo - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { } class MsgProtocolError(_MessageBase): name = consts.ConstMessage.ProtocolError - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'Code': types.TypeInt, 'Global': types.TypeBool, @@ -930,7 +925,7 @@ class MsgPutFailed(_MessageBase): name = consts.ConstMessage.PutFailed - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'Code': types.TypeInt, 'ExpectedURI': key.TypeKey, @@ -940,7 +935,7 @@ class MsgPutFetchable(_MessageBase): name = consts.ConstMessage.PutFetchable - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'Global': types.TypeBool, 'URI': key.TypeKey, @@ -949,7 +944,7 @@ class MsgPutSuccessful(_MessageBase): name = consts.ConstMessage.PutSuccessful - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'CompletionTime': types.TypeTime, 'Global': types.TypeBool, @@ -960,14 +955,14 @@ class MsgRemovePeer(_MessageBase): name = consts.ConstMessage.RemovePeer - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { } class MsgRemoveRequest(_MessageBase): name = consts.ConstMessage.RemoveRequest - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'Global': types.TypeBool, } @@ -975,7 +970,7 @@ class MsgSSKKeypair(_MessageBase): name = consts.ConstMessage. SSKKeypair - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'InsertURI': key.TypeKey, 'RequestURI': key.TypeKey, @@ -984,14 +979,14 @@ class MsgShutdown(_MessageBase): name = consts.ConstMessage.Shutdown - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { } class MsgSimpleProgress(_MessageBase): name = consts.ConstMessage.SimpleProgress - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'Failed': types.TypeInt, 'FatalyFailed': types.TypeInt, @@ -1004,14 +999,14 @@ class MsgStartedCompression(_MessageBase): name = consts.ConstMessage.StartedCompression - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { } class MsgSubscribeUSK(_MessageBase): name = consts.ConstMessage.SubscribeUSK - _additional_params_ = _SubscribeUSKParams + _additional_params_ = _AdditionalParamsSubscribeUSK _param_types_ = { 'DontPoll': types.TypeBool, 'URI': key.TypeKey, @@ -1020,7 +1015,7 @@ class MsgSubscribedUSK(_MessageBase): name = consts.ConstMessage.SubscribedUSK - _additional_params_ = _SubscribeUSKParams + _additional_params_ = _AdditionalParamsSubscribeUSK _param_types_ = { 'DontPoll': types.TypeBool, 'URI': key.TypeKey, @@ -1029,7 +1024,7 @@ class MsgSubscribedUSKUpdate(_MessageBase): name = consts.ConstMessage.SubscribedUSKUpdate - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'Edition': types.TypeInt, 'URI': key.TypeKey, @@ -1038,7 +1033,7 @@ class MsgTestDDAComplete(_MessageBase): name = consts.ConstMessage.TestDDAComplete - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'ReadDirectoryAllowed': types.TypeBool, 'WriteDirectoryAllowed': types.TypeBool, @@ -1047,14 +1042,14 @@ class MsgTestDDAReply(_MessageBase): name = consts.ConstMessage.TestDDAReply - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { } class MsgTestDDARequest(_MessageBase): name = consts.ConstMessage.TestDDARequest - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'WantReadDirectory': types.TypeBool, 'WantWriteDirectory': types.TypeBool, @@ -1063,14 +1058,14 @@ class MsgTestDDAResponse(_MessageBase): name = consts.ConstMessage.TestDDAResponse - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { } class MsgURIGenerated(_MessageBase): name = consts.ConstMessage.URIGenerated - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'URI': key.TypeKey, } @@ -1078,21 +1073,21 @@ class MsgUnknownNodeIdentifier(_MessageBase): name = consts.ConstMessage.UnknownNodeIdentifier - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { } class MsgUnknownPeerNoteType(_MessageBase): name = consts.ConstMessage.UnknownPeerNoteType - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { } class MsgWatchGlobal(_MessageBase): name = consts.ConstMessage.WatchGlobal - _additional_params_ = {} + _additional_params_ = _AdditionalParamsCommon _param_types_ = { 'Enabled': types.TypeBool, 'VerbosityMask': types.TypeInt, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-31 18:45:33
|
Revision: 842 http://fclient.svn.sourceforge.net/fclient/?rev=842&view=rev Author: jUrner Date: 2008-07-31 18:45:36 +0000 (Thu, 31 Jul 2008) Log Message: ----------- more work on layout and css Modified Paths: -------------- trunk/fclient/fclient/impl/res/stylesheets/default.css trunk/fclient/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui trunk/fclient/fclient/impl/tpls/DlgPropsBrowserObjectTpl.ui trunk/fclient/fclient/impl/tpls/DlgSingleAppErrorTpl.ui trunk/fclient/fclient/impl/tpls/PrefsBrowserWidgetTpl.ui trunk/fclient/fclient/impl/tpls/PrefsConnectionExpertSettingsTpl.ui trunk/fclient/fclient/impl/tpls/PrefsGlobalWidgetTpl.ui trunk/fclient/fclient/impl/tpls/PrefsSingleAppTpl.ui trunk/fclient/fclient/impl/tpls/Ui_DlgDownloadKeyToDiskTpl.py trunk/fclient/fclient/impl/tpls/Ui_DlgPropsBrowserObjectTpl.py trunk/fclient/fclient/impl/tpls/Ui_DlgSingleAppErrorTpl.py trunk/fclient/fclient/impl/tpls/Ui_PrefsBrowserWidgetTpl.py trunk/fclient/fclient/impl/tpls/Ui_PrefsConnectionExpertSettingsTpl.py trunk/fclient/fclient/impl/tpls/Ui_PrefsGlobalWidgetTpl.py trunk/fclient/fclient/impl/tpls/Ui_PrefsSingleAppTpl.py trunk/fclient/fclient/impl/tpls/Ui_ViewConnectionWidgetTpl.py trunk/fclient/fclient/impl/tpls/ViewConnectionWidgetTpl.ui Modified: trunk/fclient/fclient/impl/res/stylesheets/default.css =================================================================== --- trunk/fclient/fclient/impl/res/stylesheets/default.css 2008-07-31 17:37:10 UTC (rev 841) +++ trunk/fclient/fclient/impl/res/stylesheets/default.css 2008-07-31 18:45:36 UTC (rev 842) @@ -12,8 +12,26 @@ (..) **********************************************************************************************/ +/* label style. sample: + Host: + | 9999| +*/ +QLabel#fieldHeader, +QLabel#fieldHeader_2, +QLabel#fieldHeader_3, +QLabel#fieldNHeader_4, +QLabel#fieldHeader_5, +QLabel#fieldHeader_6, +QLabel#fieldHeader_7, +QLabel#fieldHeader_8, +QLabel#fieldHeader_9{ + font: bold; + } -/* style for "Name: | |" labels. for example "Host: |9999|" */ + +/* label style. sample: + Host: | 9999| +*/ QLabel#fieldName, QLabel#fieldName_2, QLabel#fieldName_3, @@ -24,4 +42,5 @@ QLabel#fieldName_8, QLabel#fieldName_9{ font: bold; + color: green; } \ No newline at end of file Modified: trunk/fclient/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui =================================================================== --- trunk/fclient/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui 2008-07-31 17:37:10 UTC (rev 841) +++ trunk/fclient/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui 2008-07-31 18:45:36 UTC (rev 842) @@ -16,7 +16,7 @@ <item row="0" column="0" > <layout class="QVBoxLayout" name="verticalLayout" > <item> - <widget class="QLabel" name="fieldName" > + <widget class="QLabel" name="fieldHeader" > <property name="text" > <string>Key:</string> </property> @@ -30,7 +30,7 @@ </widget> </item> <item> - <widget class="QLabel" name="fieldName_2" > + <widget class="QLabel" name="fieldHeader_2" > <property name="text" > <string>File name:</string> </property> @@ -40,7 +40,7 @@ <widget class="QLineEdit" name="edFileName" /> </item> <item> - <widget class="QLabel" name="fieldName_3" > + <widget class="QLabel" name="fieldHeader_3" > <property name="text" > <string>Directory:</string> </property> Modified: trunk/fclient/fclient/impl/tpls/DlgPropsBrowserObjectTpl.ui =================================================================== --- trunk/fclient/fclient/impl/tpls/DlgPropsBrowserObjectTpl.ui 2008-07-31 17:37:10 UTC (rev 841) +++ trunk/fclient/fclient/impl/tpls/DlgPropsBrowserObjectTpl.ui 2008-07-31 18:45:36 UTC (rev 842) @@ -16,7 +16,7 @@ <item row="0" column="0" > <layout class="QVBoxLayout" name="verticalLayout" > <item> - <widget class="QLabel" name="fieldName" > + <widget class="QLabel" name="fieldHeader" > <property name="sizePolicy" > <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > <horstretch>0</horstretch> @@ -48,7 +48,7 @@ </widget> </item> <item> - <widget class="QLabel" name="fieldName_2" > + <widget class="QLabel" name="fieldHeader_2" > <property name="sizePolicy" > <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > <horstretch>0</horstretch> @@ -80,7 +80,7 @@ </widget> </item> <item> - <widget class="QLabel" name="fieldName_3" > + <widget class="QLabel" name="fieldHeader_3" > <property name="sizePolicy" > <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > <horstretch>0</horstretch> @@ -112,7 +112,7 @@ </widget> </item> <item> - <widget class="QLabel" name="fieldName_4" > + <widget class="QLabel" name="fieldHeader_4" > <property name="sizePolicy" > <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > <horstretch>0</horstretch> @@ -144,7 +144,7 @@ </widget> </item> <item> - <widget class="QLabel" name="fieldName_5" > + <widget class="QLabel" name="fieldHeader_5" > <property name="sizePolicy" > <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > <horstretch>0</horstretch> Modified: trunk/fclient/fclient/impl/tpls/DlgSingleAppErrorTpl.ui =================================================================== --- trunk/fclient/fclient/impl/tpls/DlgSingleAppErrorTpl.ui 2008-07-31 17:37:10 UTC (rev 841) +++ trunk/fclient/fclient/impl/tpls/DlgSingleAppErrorTpl.ui 2008-07-31 18:45:36 UTC (rev 842) @@ -41,7 +41,7 @@ <item> <layout class="QVBoxLayout" name="verticalLayout" > <item> - <widget class="QLabel" name="fieldName" > + <widget class="QLabel" name="fieldHeader" > <property name="text" > <string>Host: </string> </property> @@ -51,7 +51,7 @@ <widget class="QLineEdit" name="edHost" /> </item> <item> - <widget class="QLabel" name="fieldName_2" > + <widget class="QLabel" name="fieldHeader_2" > <property name="text" > <string>Port: </string> </property> @@ -80,9 +80,6 @@ </widget> </item> </layout> - <zorder>line</zorder> - <zorder>buttonBox</zorder> - <zorder>splitter</zorder> </widget> <resources/> <connections> Modified: trunk/fclient/fclient/impl/tpls/PrefsBrowserWidgetTpl.ui =================================================================== --- trunk/fclient/fclient/impl/tpls/PrefsBrowserWidgetTpl.ui 2008-07-31 17:37:10 UTC (rev 841) +++ trunk/fclient/fclient/impl/tpls/PrefsBrowserWidgetTpl.ui 2008-07-31 18:45:36 UTC (rev 842) @@ -5,109 +5,104 @@ <rect> <x>0</x> <y>0</y> - <width>532</width> - <height>186</height> + <width>456</width> + <height>253</height> </rect> </property> <property name="windowTitle" > <string>Form</string> </property> - <layout class="QGridLayout" name="gridLayout_3" > + <layout class="QGridLayout" name="gridLayout" > <item row="0" column="0" > - <layout class="QHBoxLayout" name="horizontalLayout_2" > - <item> - <widget class="QLabel" name="label" > - <property name="text" > - <string>Homepage:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="edHomePage" > - <property name="dragEnabled" > - <bool>true</bool> - </property> - </widget> - </item> - </layout> + <widget class="QLabel" name="fieldHeader" > + <property name="text" > + <string>Homepage:</string> + </property> + </widget> </item> <item row="1" column="0" > + <widget class="QLineEdit" name="edHomePage" > + <property name="dragEnabled" > + <bool>true</bool> + </property> + </widget> + </item> + <item row="2" column="0" > <layout class="QHBoxLayout" name="horizontalLayout" > <item> - <widget class="QGroupBox" name="groupBox" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Minimum" hsizetype="Preferred" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title" > - <string>Open in new tab</string> - </property> - <layout class="QGridLayout" name="gridLayout" > - <item row="0" column="0" > - <widget class="QCheckBox" name="ckOpenLinksInNewTab" > - <property name="text" > - <string>Links</string> - </property> - </widget> - </item> - <item row="4" column="0" > - <widget class="QCheckBox" name="ckOpenBookmarksInNewTab" > - <property name="text" > - <string>Bookmarks</string> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QCheckBox" name="ckOpenAddressBarInNewTab" > - <property name="text" > - <string>Address bar</string> - </property> - </widget> - </item> - </layout> - </widget> + <layout class="QVBoxLayout" name="verticalLayout_2" > + <item> + <widget class="QLabel" name="fieldHeader_2" > + <property name="text" > + <string>Open in new tab:</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="ckOpenAddressBarInNewTab" > + <property name="text" > + <string>Address bar</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="ckOpenBookmarksInNewTab" > + <property name="text" > + <string>Bookmarks</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="ckOpenLinksInNewTab" > + <property name="text" > + <string>Links</string> + </property> + </widget> + </item> + </layout> </item> <item> - <widget class="QGroupBox" name="groupBox_2" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Minimum" hsizetype="Preferred" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <widget class="Line" name="line" > + <property name="orientation" > + <enum>Qt::Vertical</enum> </property> - <property name="title" > - <string>Others</string> - </property> - <layout class="QGridLayout" name="gridLayout_2" > - <item row="0" column="0" > - <widget class="QCheckBox" name="ckOpenHomePageOnNewTabCreated" > - <property name="text" > - <string>Open home page when a new tab is created</string> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QCheckBox" name="ckBackIsClose" > - <property name="text" > - <string>Back is close</string> - </property> - </widget> - </item> - <item row="2" column="0" > - <widget class="QCheckBox" name="ckAutoLoadImages" > - <property name="text" > - <string>Auto load images</string> - </property> - </widget> - </item> - </layout> </widget> </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout" > + <item> + <widget class="QLabel" name="fieldHeader_3" > + <property name="text" > + <string>Others:</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="ckOpenHomePageOnNewTabCreated" > + <property name="text" > + <string>Open homepage in new created tab</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="ckBackIsClose" > + <property name="text" > + <string>Back is close</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="ckAutoLoadImages" > + <property name="text" > + <string>Auto load images</string> + </property> + </widget> + </item> + </layout> + </item> </layout> </item> - <item row="2" column="0" > + <item row="3" column="0" > <spacer name="verticalSpacer" > <property name="orientation" > <enum>Qt::Vertical</enum> @@ -115,7 +110,7 @@ <property name="sizeHint" stdset="0" > <size> <width>20</width> - <height>297</height> + <height>56</height> </size> </property> </spacer> Modified: trunk/fclient/fclient/impl/tpls/PrefsConnectionExpertSettingsTpl.ui =================================================================== --- trunk/fclient/fclient/impl/tpls/PrefsConnectionExpertSettingsTpl.ui 2008-07-31 17:37:10 UTC (rev 841) +++ trunk/fclient/fclient/impl/tpls/PrefsConnectionExpertSettingsTpl.ui 2008-07-31 18:45:36 UTC (rev 842) @@ -6,44 +6,85 @@ <x>0</x> <y>0</y> <width>520</width> - <height>550</height> + <height>502</height> </rect> </property> <property name="windowTitle" > <string>Form</string> </property> - <layout class="QGridLayout" name="gridLayout_2" > + <layout class="QGridLayout" name="gridLayout" > <item row="0" column="0" > - <widget class="QTabWidget" name="tabWidget" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Minimum" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="currentIndex" > - <number>0</number> - </property> - <widget class="QWidget" name="tab" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>498</width> - <height>490</height> - </rect> - </property> - <attribute name="title" > - <string>Fcp connection</string> - </attribute> - <layout class="QGridLayout" name="gridLayout" > - <item row="0" column="0" > + <layout class="QVBoxLayout" name="verticalLayout_3" > + <item> + <widget class="QLabel" name="fieldHeader" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Connection name:</string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_5" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Adjusts the name the client uses to connect to the node. Use this for example to adjust the connection name in case the name is already in use by other clients. WARNING: changing this will loose your current qequests untill you connect under that name again</string> + </property> + <property name="alignment" > + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + <property name="wordWrap" > + <bool>true</bool> + </property> + <property name="textInteractionFlags" > + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard</set> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="edFcpConnectionName" /> + </item> + <item> + <widget class="QLabel" name="fieldHeader_2" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Connect duration and timeout:</string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_6" > + <property name="text" > + <string>How long should the client try to connect to the node before finally giving up? How long should he wait before retrying to establish a connection? WARNING: setting timeout to low values may cause the gui to slow down</string> + </property> + <property name="wordWrap" > + <bool>true</bool> + </property> + <property name="textInteractionFlags" > + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard</set> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout" > + <item> <layout class="QVBoxLayout" name="verticalLayout" > - <property name="spacing" > - <number>0</number> - </property> <item> - <widget class="QLabel" name="label_5" > + <widget class="QLabel" name="fieldName" > <property name="sizePolicy" > <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > <horstretch>0</horstretch> @@ -51,177 +92,112 @@ </sizepolicy> </property> <property name="text" > - <string>Adjusts the name the client uses to connect to the node. Use this for example to adjust the connection name in case the name is already in use by other clients. WARNING: changing this will loose your current qequests untill you connect under that name again</string> + <string>Duration: </string> </property> - <property name="alignment" > - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - <property name="wordWrap" > - <bool>true</bool> - </property> - <property name="textInteractionFlags" > - <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard</set> - </property> </widget> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout" > - <property name="spacing" > - <number>0</number> + <widget class="QLabel" name="fieldName_2" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <item> - <widget class="QLabel" name="label" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>Connection name:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="edFcpConnectionName" /> - </item> - </layout> + <property name="text" > + <string>Timeout:</string> + </property> + </widget> </item> + </layout> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_2" > <item> - <widget class="QLabel" name="label_6" > - <property name="text" > - <string>How long should the client try to connect to the node before finally giving up? How long should he wait before retrying to establish a connection? WARNING: setting timeout to low values may cause the gui to slow down</string> + <widget class="QSpinBox" name="spinFcpConnectionTimerMaxDuration" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="wordWrap" > - <bool>true</bool> + <property name="suffix" > + <string> seconds</string> </property> - <property name="textInteractionFlags" > - <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard</set> + <property name="maximum" > + <number>999</number> </property> </widget> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_2" > - <item> - <layout class="QVBoxLayout" name="verticalLayout_3" > - <item> - <widget class="QLabel" name="label_3" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>Connect duration: </string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_4" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>Connect timeout:</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_2" > - <item> - <widget class="QSpinBox" name="spinFcpConnectionTimerMaxDuration" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="suffix" > - <string> seconds</string> - </property> - <property name="maximum" > - <number>999</number> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinConnectionTimerTimeout" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="suffix" > - <string> miliseconds</string> - </property> - <property name="maximum" > - <number>99999</number> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - <item> - <widget class="QLabel" name="label_7" > - <property name="text" > - <string>How long should the client wait before polling the node for a the next message? Warning: setting this to high values will make messages come in more slowly. Setting it to low values may cause the gui to slow down. -</string> + <widget class="QSpinBox" name="spinConnectionTimerTimeout" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="wordWrap" > - <bool>true</bool> + <property name="suffix" > + <string> miliseconds</string> </property> - <property name="textInteractionFlags" > - <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard</set> + <property name="maximum" > + <number>99999</number> </property> </widget> </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_3" > - <item> - <widget class="QLabel" name="label_2" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>Poll frequency: </string> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinFcpPollTimerTimeout" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="suffix" > - <string> miliseconds</string> - </property> - <property name="maximum" > - <number>99999</number> - </property> - </widget> - </item> - </layout> - </item> </layout> </item> </layout> - </widget> - </widget> + </item> + <item> + <widget class="QLabel" name="fieldHeader_3" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Poll frequency: </string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_7" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>How long should the client wait before polling the node for a the next message? Warning: setting this to high values will make messages come in more slowly. Setting it to low values may cause the gui to slow down.</string> + </property> + <property name="wordWrap" > + <bool>true</bool> + </property> + <property name="textInteractionFlags" > + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard</set> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinFcpPollTimerTimeout" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="suffix" > + <string> miliseconds</string> + </property> + <property name="maximum" > + <number>99999</number> + </property> + </widget> + </item> + </layout> </item> <item row="1" column="0" > <spacer name="verticalSpacer" > @@ -230,13 +206,29 @@ </property> <property name="sizeHint" stdset="0" > <size> - <width>502</width> - <height>21</height> + <width>20</width> + <height>87</height> </size> </property> </spacer> </item> </layout> + <zorder>tabWidget</zorder> + <zorder>label</zorder> + <zorder>fieldHeader</zorder> + <zorder>label_5</zorder> + <zorder>edFcpConnectionName</zorder> + <zorder>fieldHeader_2</zorder> + <zorder>label_6</zorder> + <zorder>fieldName</zorder> + <zorder>spinFcpConnectionTimerMaxDuration</zorder> + <zorder>fieldName_2</zorder> + <zorder>spinConnectionTimerTimeout</zorder> + <zorder>label_7</zorder> + <zorder>spinFcpPollTimerTimeout</zorder> + <zorder>fieldHeader_3</zorder> + <zorder>verticalSpacer</zorder> + <zorder></zorder> </widget> <resources/> <connections/> Modified: trunk/fclient/fclient/impl/tpls/PrefsGlobalWidgetTpl.ui =================================================================== --- trunk/fclient/fclient/impl/tpls/PrefsGlobalWidgetTpl.ui 2008-07-31 17:37:10 UTC (rev 841) +++ trunk/fclient/fclient/impl/tpls/PrefsGlobalWidgetTpl.ui 2008-07-31 18:45:36 UTC (rev 842) @@ -6,7 +6,7 @@ <x>0</x> <y>0</y> <width>465</width> - <height>269</height> + <height>316</height> </rect> </property> <property name="windowTitle" > @@ -14,9 +14,16 @@ </property> <layout class="QGridLayout" name="gridLayout" > <item row="0" column="0" > + <widget class="QLabel" name="fieldHeader" > + <property name="text" > + <string>Settings directory:</string> + </property> + </widget> + </item> + <item row="1" column="0" > <widget class="QLabel" name="label" > <property name="text" > - <string>Specify directory to store settings to.Leave empty to store settings in a location your os feels best with</string> + <string>Directory to store settings to.Leave empty to store settings in a location your os feels best with</string> </property> <property name="wordWrap" > <bool>true</bool> @@ -26,7 +33,7 @@ </property> </widget> </item> - <item row="1" column="0" > + <item row="2" column="0" > <layout class="QHBoxLayout" > <item> <widget class="QLineEdit" name="edSettingsDir" /> @@ -40,7 +47,7 @@ </item> </layout> </item> - <item row="2" column="0" > + <item row="3" column="0" > <widget class="QLabel" name="label_2" > <property name="text" > <string>If no path for settings is specified, store settings only for the the current user or for all users?</string> @@ -53,17 +60,17 @@ </property> </widget> </item> - <item row="3" column="0" > + <item row="4" column="0" > <widget class="QCheckBox" name="ckSettingsAllUsers" > <property name="text" > <string>Store settings for all users</string> </property> </widget> </item> - <item row="4" column="0" > - <widget class="QLabel" name="label_3" > + <item row="5" column="0" > + <widget class="QLabel" name="fieldHeader_2" > <property name="text" > - <string>Default directory to store downloads to </string> + <string>Default download directory:</string> </property> <property name="wordWrap" > <bool>true</bool> @@ -73,7 +80,7 @@ </property> </widget> </item> - <item row="5" column="0" > + <item row="6" column="0" > <layout class="QHBoxLayout" name="horizontalLayout" > <item> <widget class="QLineEdit" name="edDownloadDir" /> @@ -87,7 +94,7 @@ </item> </layout> </item> - <item row="6" column="0" > + <item row="7" column="0" > <spacer name="verticalSpacer" > <property name="orientation" > <enum>Qt::Vertical</enum> Modified: trunk/fclient/fclient/impl/tpls/PrefsSingleAppTpl.ui =================================================================== --- trunk/fclient/fclient/impl/tpls/PrefsSingleAppTpl.ui 2008-07-31 17:37:10 UTC (rev 841) +++ trunk/fclient/fclient/impl/tpls/PrefsSingleAppTpl.ui 2008-07-31 18:45:36 UTC (rev 842) @@ -32,7 +32,7 @@ <item row="1" column="0" > <layout class="QVBoxLayout" name="verticalLayout" > <item> - <widget class="QLabel" name="fieldName" > + <widget class="QLabel" name="fieldHeader" > <property name="text" > <string>Single application host: </string> </property> @@ -42,7 +42,7 @@ <widget class="QLineEdit" name="edHost" /> </item> <item> - <widget class="QLabel" name="fieldName_2" > + <widget class="QLabel" name="fieldHeader_2" > <property name="text" > <string>Single application port: </string> </property> Modified: trunk/fclient/fclient/impl/tpls/Ui_DlgDownloadKeyToDiskTpl.py =================================================================== --- trunk/fclient/fclient/impl/tpls/Ui_DlgDownloadKeyToDiskTpl.py 2008-07-31 17:37:10 UTC (rev 841) +++ trunk/fclient/fclient/impl/tpls/Ui_DlgDownloadKeyToDiskTpl.py 2008-07-31 18:45:36 UTC (rev 842) @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui' +# Form implementation generated from reading ui file '/home/me/src/fclient/trunk/fclient/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui' # -# Created: Thu Jul 31 18:23:06 2008 +# Created: Thu Jul 31 20:24:05 2008 # by: PyQt4 UI code generator 4.4.3-snapshot-20080705 # # WARNING! All changes made in this file will be lost! @@ -17,22 +17,22 @@ self.gridLayout.setObjectName("gridLayout") self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") - self.fieldName = QtGui.QLabel(DlgDownloadKeyToDisk) - self.fieldName.setObjectName("fieldName") - self.verticalLayout.addWidget(self.fieldName) + self.fieldHeader = QtGui.QLabel(DlgDownloadKeyToDisk) + self.fieldHeader.setObjectName("fieldHeader") + self.verticalLayout.addWidget(self.fieldHeader) self.edKey = QtGui.QLineEdit(DlgDownloadKeyToDisk) self.edKey.setDragEnabled(True) self.edKey.setObjectName("edKey") self.verticalLayout.addWidget(self.edKey) - self.fieldName_2 = QtGui.QLabel(DlgDownloadKeyToDisk) - self.fieldName_2.setObjectName("fieldName_2") - self.verticalLayout.addWidget(self.fieldName_2) + self.fieldHeader_2 = QtGui.QLabel(DlgDownloadKeyToDisk) + self.fieldHeader_2.setObjectName("fieldHeader_2") + self.verticalLayout.addWidget(self.fieldHeader_2) self.edFileName = QtGui.QLineEdit(DlgDownloadKeyToDisk) self.edFileName.setObjectName("edFileName") self.verticalLayout.addWidget(self.edFileName) - self.fieldName_3 = QtGui.QLabel(DlgDownloadKeyToDisk) - self.fieldName_3.setObjectName("fieldName_3") - self.verticalLayout.addWidget(self.fieldName_3) + self.fieldHeader_3 = QtGui.QLabel(DlgDownloadKeyToDisk) + self.fieldHeader_3.setObjectName("fieldHeader_3") + self.verticalLayout.addWidget(self.fieldHeader_3) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.edDirectory = QtGui.QLineEdit(DlgDownloadKeyToDisk) @@ -64,9 +64,9 @@ def retranslateUi(self, DlgDownloadKeyToDisk): DlgDownloadKeyToDisk.setWindowTitle(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "Dialog", None, QtGui.QApplication.UnicodeUTF8)) - self.fieldName.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "Key:", None, QtGui.QApplication.UnicodeUTF8)) - self.fieldName_2.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "File name:", None, QtGui.QApplication.UnicodeUTF8)) - self.fieldName_3.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "Directory:", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldHeader.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "Key:", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldHeader_2.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "File name:", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldHeader_3.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "Directory:", None, QtGui.QApplication.UnicodeUTF8)) self.btChooseDirectory.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "...", None, QtGui.QApplication.UnicodeUTF8)) Modified: trunk/fclient/fclient/impl/tpls/Ui_DlgPropsBrowserObjectTpl.py =================================================================== --- trunk/fclient/fclient/impl/tpls/Ui_DlgPropsBrowserObjectTpl.py 2008-07-31 17:37:10 UTC (rev 841) +++ trunk/fclient/fclient/impl/tpls/Ui_DlgPropsBrowserObjectTpl.py 2008-07-31 18:45:36 UTC (rev 842) @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/impl/tpls/DlgPropsBrowserObjectTpl.ui' +# Form implementation generated from reading ui file '/home/me/src/fclient/trunk/fclient/fclient/impl/tpls/DlgPropsBrowserObjectTpl.ui' # -# Created: Thu Jul 31 18:25:16 2008 +# Created: Thu Jul 31 20:23:14 2008 # by: PyQt4 UI code generator 4.4.3-snapshot-20080705 # # WARNING! All changes made in this file will be lost! @@ -17,15 +17,15 @@ self.gridLayout.setObjectName("gridLayout") self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") - self.fieldName = QtGui.QLabel(DlgPropsBrowserObject) + self.fieldHeader = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.fieldName.sizePolicy().hasHeightForWidth()) - self.fieldName.setSizePolicy(sizePolicy) - self.fieldName.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) - self.fieldName.setObjectName("fieldName") - self.verticalLayout.addWidget(self.fieldName) + sizePolicy.setHeightForWidth(self.fieldHeader.sizePolicy().hasHeightForWidth()) + self.fieldHeader.setSizePolicy(sizePolicy) + self.fieldHeader.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.fieldHeader.setObjectName("fieldHeader") + self.verticalLayout.addWidget(self.fieldHeader) self.labeType = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) @@ -35,15 +35,15 @@ self.labeType.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) self.labeType.setObjectName("labeType") self.verticalLayout.addWidget(self.labeType) - self.fieldName_2 = QtGui.QLabel(DlgPropsBrowserObject) + self.fieldHeader_2 = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.fieldName_2.sizePolicy().hasHeightForWidth()) - self.fieldName_2.setSizePolicy(sizePolicy) - self.fieldName_2.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) - self.fieldName_2.setObjectName("fieldName_2") - self.verticalLayout.addWidget(self.fieldName_2) + sizePolicy.setHeightForWidth(self.fieldHeader_2.sizePolicy().hasHeightForWidth()) + self.fieldHeader_2.setSizePolicy(sizePolicy) + self.fieldHeader_2.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.fieldHeader_2.setObjectName("fieldHeader_2") + self.verticalLayout.addWidget(self.fieldHeader_2) self.labelTitle = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) @@ -53,15 +53,15 @@ self.labelTitle.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) self.labelTitle.setObjectName("labelTitle") self.verticalLayout.addWidget(self.labelTitle) - self.fieldName_3 = QtGui.QLabel(DlgPropsBrowserObject) + self.fieldHeader_3 = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.fieldName_3.sizePolicy().hasHeightForWidth()) - self.fieldName_3.setSizePolicy(sizePolicy) - self.fieldName_3.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) - self.fieldName_3.setObjectName("fieldName_3") - self.verticalLayout.addWidget(self.fieldName_3) + sizePolicy.setHeightForWidth(self.fieldHeader_3.sizePolicy().hasHeightForWidth()) + self.fieldHeader_3.setSizePolicy(sizePolicy) + self.fieldHeader_3.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.fieldHeader_3.setObjectName("fieldHeader_3") + self.verticalLayout.addWidget(self.fieldHeader_3) self.labelName = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) @@ -71,15 +71,15 @@ self.labelName.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) self.labelName.setObjectName("labelName") self.verticalLayout.addWidget(self.labelName) - self.fieldName_4 = QtGui.QLabel(DlgPropsBrowserObject) + self.fieldHeader_4 = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.fieldName_4.sizePolicy().hasHeightForWidth()) - self.fieldName_4.setSizePolicy(sizePolicy) - self.fieldName_4.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) - self.fieldName_4.setObjectName("fieldName_4") - self.verticalLayout.addWidget(self.fieldName_4) + sizePolicy.setHeightForWidth(self.fieldHeader_4.sizePolicy().hasHeightForWidth()) + self.fieldHeader_4.setSizePolicy(sizePolicy) + self.fieldHeader_4.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.fieldHeader_4.setObjectName("fieldHeader_4") + self.verticalLayout.addWidget(self.fieldHeader_4) self.labelLinkUrl = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) @@ -89,15 +89,15 @@ self.labelLinkUrl.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) self.labelLinkUrl.setObjectName("labelLinkUrl") self.verticalLayout.addWidget(self.labelLinkUrl) - self.fieldName_5 = QtGui.QLabel(DlgPropsBrowserObject) + self.fieldHeader_5 = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.fieldName_5.sizePolicy().hasHeightForWidth()) - self.fieldName_5.setSizePolicy(sizePolicy) - self.fieldName_5.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) - self.fieldName_5.setObjectName("fieldName_5") - self.verticalLayout.addWidget(self.fieldName_5) + sizePolicy.setHeightForWidth(self.fieldHeader_5.sizePolicy().hasHeightForWidth()) + self.fieldHeader_5.setSizePolicy(sizePolicy) + self.fieldHeader_5.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.fieldHeader_5.setObjectName("fieldHeader_5") + self.verticalLayout.addWidget(self.fieldHeader_5) self.labelImageUrl = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) @@ -128,15 +128,15 @@ def retranslateUi(self, DlgPropsBrowserObject): DlgPropsBrowserObject.setWindowTitle(QtGui.QApplication.translate("DlgPropsBrowserObject", "Dialog", None, QtGui.QApplication.UnicodeUTF8)) - self.fieldName.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "Type:", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldHeader.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "Type:", None, QtGui.QApplication.UnicodeUTF8)) self.labeType.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "unknown", None, QtGui.QApplication.UnicodeUTF8)) - self.fieldName_2.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "Title:", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldHeader_2.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "Title:", None, QtGui.QApplication.UnicodeUTF8)) self.labelTitle.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "unknown", None, QtGui.QApplication.UnicodeUTF8)) - self.fieldName_3.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "Name:", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldHeader_3.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "Name:", None, QtGui.QApplication.UnicodeUTF8)) self.labelName.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "unknown", None, QtGui.QApplication.UnicodeUTF8)) - self.fieldName_4.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "LinkUrl:", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldHeader_4.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "LinkUrl:", None, QtGui.QApplication.UnicodeUTF8)) self.labelLinkUrl.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "unknown", None, QtGui.QApplication.UnicodeUTF8)) - self.fieldName_5.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "ImageUrl:", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldHeader_5.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "ImageUrl:", None, QtGui.QApplication.UnicodeUTF8)) self.labelImageUrl.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "unknown", None, QtGui.QApplication.UnicodeUTF8)) Modified: trunk/fclient/fclient/impl/tpls/Ui_DlgSingleAppErrorTpl.py =================================================================== --- trunk/fclient/fclient/impl/tpls/Ui_DlgSingleAppErrorTpl.py 2008-07-31 17:37:10 UTC (rev 841) +++ trunk/fclient/fclient/impl/tpls/Ui_DlgSingleAppErrorTpl.py 2008-07-31 18:45:36 UTC (rev 842) @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/impl/tpls/DlgSingleAppErrorTpl.ui' +# Form implementation generated from reading ui file '/home/me/src/fclient/trunk/fclient/fclient/impl/tpls/DlgSingleAppErrorTpl.ui' # -# Created: Thu Jul 31 18:26:22 2008 +# Created: Thu Jul 31 20:24:37 2008 # by: PyQt4 UI code generator 4.4.3-snapshot-20080705 # # WARNING! All changes made in this file will be lost! @@ -36,15 +36,15 @@ self.verticalLayout_2.setObjectName("verticalLayout_2") self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") - self.fieldName = QtGui.QLabel(self.layoutWidget) - self.fieldName.setObjectName("fieldName") - self.verticalLayout.addWidget(self.fieldName) + self.fieldHeader = QtGui.QLabel(self.layoutWidget) + self.fieldHeader.setObjectName("fieldHeader") + self.verticalLayout.addWidget(self.fieldHeader) self.edHost = QtGui.QLineEdit(self.layoutWidget) self.edHost.setObjectName("edHost") self.verticalLayout.addWidget(self.edHost) - self.fieldName_2 = QtGui.QLabel(self.layoutWidget) - self.fieldName_2.setObjectName("fieldName_2") - self.verticalLayout.addWidget(self.fieldName_2) + self.fieldHeader_2 = QtGui.QLabel(self.layoutWidget) + self.fieldHeader_2.setObjectName("fieldHeader_2") + self.verticalLayout.addWidget(self.fieldHeader_2) self.spinPort = QtGui.QSpinBox(self.layoutWidget) self.spinPort.setObjectName("spinPort") self.verticalLayout.addWidget(self.spinPort) @@ -60,8 +60,8 @@ def retranslateUi(self, DlgSingleAppError): DlgSingleAppError.setWindowTitle(QtGui.QApplication.translate("DlgSingleAppError", "Dialog", None, QtGui.QApplication.UnicodeUTF8)) - self.fieldName.setText(QtGui.QApplication.translate("DlgSingleAppError", "Host: ", None, QtGui.QApplication.UnicodeUTF8)) - self.fieldName_2.setText(QtGui.QApplication.translate("DlgSingleAppError", "Port: ", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldHeader.setText(QtGui.QApplication.translate("DlgSingleAppError", "Host: ", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldHeader_2.setText(QtGui.QApplication.translate("DlgSingleAppError", "Port: ", None, QtGui.QApplication.UnicodeUTF8)) if __name__ == "__main__": Modified: trunk/fclient/fclient/impl/tpls/Ui_PrefsBrowserWidgetTpl.py =================================================================== --- trunk/fclient/fclient/impl/tpls/Ui_PrefsBrowserWidgetTpl.py 2008-07-31 17:37:10 UTC (rev 841) +++ trunk/fclient/fclient/impl/tpls/Ui_PrefsBrowserWidgetTpl.py 2008-07-31 18:45:36 UTC (rev 842) @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/impl/tpls/PrefsBrowserWidgetTpl.ui' +# Form implementation generated from reading ui file '/home/me/src/fclient/trunk/fclient/fclient/impl/tpls/PrefsBrowserWidgetTpl.ui' # -# Created: Sun Jul 27 13:41:50 2008 +# Created: Thu Jul 31 20:43:06 2008 # by: PyQt4 UI code generator 4.4.3-snapshot-20080705 # # WARNING! All changes made in this file will be lost! @@ -12,75 +12,69 @@ class Ui_PrefsBrowserWidget(object): def setupUi(self, PrefsBrowserWidget): PrefsBrowserWidget.setObjectName("PrefsBrowserWidget") - PrefsBrowserWidget.resize(532, 186) - self.gridLayout_3 = QtGui.QGridLayout(PrefsBrowserWidget) - self.gridLayout_3.setObjectName("gridLayout_3") - self.horizontalLayout_2 = QtGui.QHBoxLayout() - self.horizontalLayout_2.setObjectName("horizontalLayout_2") - self.label = QtGui.QLabel(PrefsBrowserWidget) - self.label.setObjectName("label") - self.horizontalLayout_2.addWidget(self.label) + PrefsBrowserWidget.resize(456, 253) + self.gridLayout = QtGui.QGridLayout(PrefsBrowserWidget) + self.gridLayout.setObjectName("gridLayout") + self.fieldHeader = QtGui.QLabel(PrefsBrowserWidget) + self.fieldHeader.setObjectName("fieldHeader") + self.gridLayout.addWidget(self.fieldHeader, 0, 0, 1, 1) self.edHomePage = QtGui.QLineEdit(PrefsBrowserWidget) self.edHomePage.setDragEnabled(True) self.edHomePage.setObjectName("edHomePage") - self.horizontalLayout_2.addWidget(self.edHomePage) - self.gridLayout_3.addLayout(self.horizontalLayout_2, 0, 0, 1, 1) + self.gridLayout.addWidget(self.edHomePage, 1, 0, 1, 1) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") - self.groupBox = QtGui.QGroupBox(PrefsBrowserWidget) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth()) - self.groupBox.setSizePolicy(sizePolicy) - self.groupBox.setObjectName("groupBox") - self.gridLayout = QtGui.QGridLayout(self.groupBox) - self.gridLayout.setObjectName("gridLayout") - self.ckOpenLinksInNewTab = QtGui.QCheckBox(self.groupBox) - self.ckOpenLinksInNewTab.setObjectName("ckOpenLinksInNewTab") - self.gridLayout.addWidget(self.ckOpenLinksInNewTab, 0, 0, 1, 1) - self.ckOpenBookmarksInNewTab = QtGui.QCheckBox(self.groupBox) - self.ckOpenBookmarksInNewTab.setObjectName("ckOpenBookmarksInNewTab") - self.gridLayout.addWidget(self.ckOpenBookmarksInNewTab, 4, 0, 1, 1) - self.ckOpenAddressBarInNewTab = QtGui.QCheckBox(self.groupBox) + self.verticalLayout_2 = QtGui.QVBoxLayout() + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.fieldHeader_2 = QtGui.QLabel(PrefsBrowserWidget) + self.fieldHeader_2.setObjectName("fieldHeader_2") + self.verticalLayout_2.addWidget(self.fieldHeader_2) + self.ckOpenAddressBarInNewTab = QtGui.QCheckBox(PrefsBrowserWidget) self.ckOpenAddressBarInNewTab.setObjectName("ckOpenAddressBarInNewTab") - self.gridLayout.addWidget(self.ckOpenAddressBarInNewTab, 1, 0, 1, 1) - self.horizontalLayout.addWidget(self.groupBox) - self.groupBox_2 = QtGui.QGroupBox(PrefsBrowserWidget) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.groupBox_2.sizePolicy().hasHeightForWidth()) - self.groupBox_2.setSizePolicy(sizePolicy) - self.groupBox_2.setObjectName("groupBox_2") - self.gridLayout_2 = QtGui.QGridLayout(self.groupBox_2) - self.gridLayout_2.setObjectName("gridLayout_2") - self.ckOpenHomePageOnNewTabCreated = QtGui.QCheckBox(self.groupBox_2) + self.verticalLayout_2.addWidget(self.ckOpenAddressBarInNewTab) + self.ckOpenBookmarksInNewTab = QtGui.QCheckBox(PrefsBrowserWidget) + self.ckOpenBookmarksInNewTab.setObjectName("ckOpenBookmarksInNewTab") + self.verticalLayout_2.addWidget(self.ckOpenBookmarksInNewTab) + self.ckOpenLinksInNewTab = QtGui.QCheckBox(PrefsBrowserWidget) + self.ckOpenLinksInNewTab.setObjectName("ckOpenLinksInNewTab") + self.verticalLayout_2.addWidget(self.ckOpenLinksInNewTab) + self.horizontalLayout.addLayout(self.verticalLayout_2) + self.line = QtGui.QFrame(PrefsBrowserWidget) + self.line.setFrameShape(QtGui.QFrame.VLine) + self.line.setFrameShadow(QtGui.QFrame.Sunken) + self.line.setObjectName("line") + self.horizontalLayout.addWidget(self.line) + self.verticalLayout = QtGui.QVBoxLayout() + self.verticalLayout.setObjectName("verticalLayout") + self.fieldHeader_3 = QtGui.QLabel(PrefsBrowserWidget) + self.fieldHeader_3.setObjectName("fieldHeader_3") + self.verticalLayout.addWidget(self.fieldHeader_3) + self.ckOpenHomePageOnNewTabCreated = QtGui.QCheckBox(PrefsBrowserWidget) self.ckOpenHomePageOnNewTabCreated.setObjectName("ckOpenHomePageOnNewTabCreated") - self.gridLayout_2.addWidget(self.ckOpenHomePageOnNewTabCreated, 0, 0, 1, 1) - self.ckBackIsClose = QtGui.QCheckBox(self.groupBox_2) + self.verticalLayout.addWidget(self.ckOpenHomePageOnNewTabCreated) + self.ckBackIsClose = QtGui.QCheckBox(PrefsBrowserWidget) self.ckBackIsClose.setObjectName("ckBackIsClose") - self.gridLayout_2.addWidget(self.ckBackIsClose, 1, 0, 1, 1) - self.ckAutoLoadImages = QtGui.QCheckBox(self.groupBox_2) + self.verticalLayout.addWidget(self.ckBackIsClose) + self.ckAutoLoadImages = QtGui.QCheckBox(PrefsBrowserWidget) self.ckAutoLoadImages.setObjectName("ckAutoLoadImages") - self.gridLayout_2.addWidget(self.ckAutoLoadImages, 2, 0, 1, 1) - self.horizontalLayout.addWidget(self.groupBox_2) - self.gridLayout_3.addLayout(self.horizontalLayout, 1, 0, 1, 1) - spacerItem = QtGui.QSpacerItem(20, 297, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_3.addItem(spacerItem, 2, 0, 1, 1) + self.verticalLayout.addWidget(self.ckAutoLoadImages) + self.horizontalLayout.addLayout(self.verticalLayout) + self.gridLayout.addLayout(self.horizontalLayout, 2, 0, 1, 1) + spacerItem = QtGui.QSpacerItem(20, 56, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout.addItem(spacerItem, 3, 0, 1, 1) self.retranslateUi(PrefsBrowserWidget) QtCore.QMetaObject.connectSlotsByName(PrefsBrowserWidget) def retranslateUi(self, PrefsBrowserWidget): PrefsBrowserWidget.setWindowTitle(QtGui.QApplication.translate("PrefsBrowserWidget", "Form", None, QtGui.QApplication.UnicodeUTF8)) - self.label.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Homepage:", None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox.setTitle(QtGui.QApplication.translate("PrefsBrowserWidget", "Open in new tab", None, QtGui.QApplication.UnicodeUTF8)) - self.ckOpenLinksInNewTab.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Links", None, QtGui.QApplication.UnicodeUTF8)) - self.ckOpenBookmarksInNewTab.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Bookmarks", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldHeader.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Homepage:", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldHeader_2.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Open in new tab:", None, QtGui.QApplication.UnicodeUTF8)) self.ckOpenAddressBarInNewTab.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Address bar", None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox_2.setTitle(QtGui.QApplication.translate("PrefsBrowserWidget", "Others", None, QtGui.QApplication.UnicodeUTF8)) - self.ckOpenHomePageOnNewTabCreated.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Open home page when a new tab is created", None, QtGui.QApplication.UnicodeUTF8)) + self.ckOpenBookmarksInNewTab.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Bookmarks", None, QtGui.QApplication.UnicodeUTF8)) + self.ckOpenLinksInNewTab.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Links", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldHeader_3.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Others:", None, QtGui.QApplication.UnicodeUTF8)) + self.ckOpenHomePageOnNewTabCreated.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Open homepage in new created tab", None, QtGui.QApplication.UnicodeUTF8)) self.ckBackIsClose.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Back is close", None, QtGui.QApplication.UnicodeUTF8)) self.ckAutoLoadImages.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Auto load images", None, QtGui.QApplication.UnicodeUTF8)) Modified: trunk/fclient/fclient/impl/tpls/Ui_PrefsConnectionExpertSettingsTpl.py =================================================================== --- trunk/fclient/fclient/impl/tpls/Ui_PrefsConnectionExpertSettingsTpl.py 2008-07-31 17:37:10 UTC (rev 841) +++ trunk/fclient/fclient/impl/tpls/Ui_PrefsConnectionExpertSettingsTpl.py 2008-07-31 18:45:36 UTC (rev 842) @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/impl/tpls/PrefsConnectionExpertSettingsTpl.ui' +# Form implementation generated from reading ui file '/home/me/src/fclient/trunk/fclient/fclient/impl/tpls/PrefsConnectionExpertSettingsTpl.ui' # -# Created: Wed Jul 30 17:47:37 2008 +# Created: Thu Jul 31 20:22:01 2008 # by: PyQt4 UI code generator 4.4.3-snapshot-20080705 # # WARNING! All changes made in this file will be lost! @@ -12,25 +12,20 @@ class Ui_PrefsConnectionExpertSettings(object): def setupUi(self, PrefsConnectionExpertSettings): PrefsConnectionExpertSettings.setObjectName("PrefsConnectionExpertSettings") - PrefsConnectionExpertSettings.resize(520, 550) - self.gridLayout_2 = QtGui.QGridLayout(PrefsConn... [truncated message content] |
From: <jU...@us...> - 2008-07-31 17:37:01
|
Revision: 841 http://fclient.svn.sourceforge.net/fclient/?rev=841&view=rev Author: jUrner Date: 2008-07-31 17:37:10 +0000 (Thu, 31 Jul 2008) Log Message: ----------- CSSing Modified Paths: -------------- trunk/fclient/fclient/impl/tpls/Ui_ViewConnectionWidgetTpl.py trunk/fclient/fclient/impl/tpls/ViewConnectionWidgetTpl.ui Modified: trunk/fclient/fclient/impl/tpls/Ui_ViewConnectionWidgetTpl.py =================================================================== --- trunk/fclient/fclient/impl/tpls/Ui_ViewConnectionWidgetTpl.py 2008-07-31 17:26:50 UTC (rev 840) +++ trunk/fclient/fclient/impl/tpls/Ui_ViewConnectionWidgetTpl.py 2008-07-31 17:37:10 UTC (rev 841) @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/impl/tpls/ViewConnectionWidgetTpl.ui' +# Form implementation generated from reading ui file '/home/me/src/fclient/trunk/fclient/fclient/impl/tpls/ViewConnectionWidgetTpl.ui' # -# Created: Sun Jul 27 20:14:51 2008 +# Created: Thu Jul 31 19:35:49 2008 # by: PyQt4 UI code generator 4.4.3-snapshot-20080705 # # WARNING! All changes made in this file will be lost! @@ -15,9 +15,9 @@ ViewConnectionWidget.resize(421, 558) self.gridLayout = QtGui.QGridLayout(ViewConnectionWidget) self.gridLayout.setObjectName("gridLayout") - self.label_5 = QtGui.QLabel(ViewConnectionWidget) - self.label_5.setObjectName("label_5") - self.gridLayout.addWidget(self.label_5, 0, 0, 1, 1) + self.fieldName = QtGui.QLabel(ViewConnectionWidget) + self.fieldName.setObjectName("fieldName") + self.gridLayout.addWidget(self.fieldName, 0, 0, 1, 1) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.verticalLayout = QtGui.QVBoxLayout() @@ -55,9 +55,9 @@ self.line_2.setFrameShadow(QtGui.QFrame.Sunken) self.line_2.setObjectName("line_2") self.gridLayout.addWidget(self.line_2, 3, 0, 1, 1) - self.label_6 = QtGui.QLabel(ViewConnectionWidget) - self.label_6.setObjectName("label_6") - self.gridLayout.addWidget(self.label_6, 4, 0, 1, 1) + self.fieldName_2 = QtGui.QLabel(ViewConnectionWidget) + self.fieldName_2.setObjectName("fieldName_2") + self.gridLayout.addWidget(self.fieldName_2, 4, 0, 1, 1) self.verticalLayout_5 = QtGui.QVBoxLayout() self.verticalLayout_5.setObjectName("verticalLayout_5") self.horizontalLayout_2 = QtGui.QHBoxLayout() @@ -96,11 +96,11 @@ def retranslateUi(self, ViewConnectionWidget): ViewConnectionWidget.setWindowTitle(QtGui.QApplication.translate("ViewConnectionWidget", "Form", None, QtGui.QApplication.UnicodeUTF8)) - self.label_5.setText(QtGui.QApplication.translate("ViewConnectionWidget", "<b>Fcp connection</b>", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldName.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Fcp connection:", None, QtGui.QApplication.UnicodeUTF8)) self.label.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Host:", None, QtGui.QApplication.UnicodeUTF8)) self.label_2.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Port:", None, QtGui.QApplication.UnicodeUTF8)) self.ckFcpAutoConnect.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Auto Connect", None, QtGui.QApplication.UnicodeUTF8)) - self.label_6.setText(QtGui.QApplication.translate("ViewConnectionWidget", "<b>Fproxy connection</b>", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldName_2.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Fproxy connection:", None, QtGui.QApplication.UnicodeUTF8)) self.label_3.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Host:", None, QtGui.QApplication.UnicodeUTF8)) self.label_4.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Port:", None, QtGui.QApplication.UnicodeUTF8)) self.btConnect.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Connect", None, QtGui.QApplication.UnicodeUTF8)) Modified: trunk/fclient/fclient/impl/tpls/ViewConnectionWidgetTpl.ui =================================================================== --- trunk/fclient/fclient/impl/tpls/ViewConnectionWidgetTpl.ui 2008-07-31 17:26:50 UTC (rev 840) +++ trunk/fclient/fclient/impl/tpls/ViewConnectionWidgetTpl.ui 2008-07-31 17:37:10 UTC (rev 841) @@ -14,9 +14,9 @@ </property> <layout class="QGridLayout" name="gridLayout" > <item row="0" column="0" > - <widget class="QLabel" name="label_5" > + <widget class="QLabel" name="fieldName" > <property name="text" > - <string><b>Fcp connection</b></string> + <string>Fcp connection:</string> </property> </widget> </item> @@ -91,9 +91,9 @@ </widget> </item> <item row="4" column="0" > - <widget class="QLabel" name="label_6" > + <widget class="QLabel" name="fieldName_2" > <property name="text" > - <string><b>Fproxy connection</b></string> + <string>Fproxy connection:</string> </property> </widget> </item> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-31 17:26:41
|
Revision: 840 http://fclient.svn.sourceforge.net/fclient/?rev=840&view=rev Author: jUrner Date: 2008-07-31 17:26:50 +0000 (Thu, 31 Jul 2008) Log Message: ----------- bit harsh to throw a critical at the user Modified Paths: -------------- trunk/fclient/fclient/impl/DlgDownloadKeyToDisk.py Modified: trunk/fclient/fclient/impl/DlgDownloadKeyToDisk.py =================================================================== --- trunk/fclient/fclient/impl/DlgDownloadKeyToDisk.py 2008-07-31 17:07:36 UTC (rev 839) +++ trunk/fclient/fclient/impl/DlgDownloadKeyToDisk.py 2008-07-31 17:26:50 UTC (rev 840) @@ -92,19 +92,19 @@ key = unicode(edKey.text()) if not key: - return QtGui.QMessageBox.critical(self, self.windowTitle(), 'Please enter a key to download') + return QtGui.QMessageBox.warning(self, self.windowTitle(), 'Please enter a key to download') try: self._fcpKey = fcp2.Key(key) except fcp2.ErrorKey: - return QtGui.QMessageBox.critical(self, self.windowTitle(), 'Looks like the key entered is not valid') + return QtGui.QMessageBox.warning(self, self.windowTitle(), 'Looks like the key entered is not valid') fileName = edFileName.text() if fileName.isEmpty(): - return QtGui.QMessageBox.critical(self, self.windowTitle(), 'Please enter a filename for the key') + return QtGui.QMessageBox.warning(self, self.windowTitle(), 'Please enter a filename for the key') directory = edDirectory.text() if directory.isEmpty(): - return QtGui.QMessageBox.critical(self, self.windowTitle(), 'Please enter a directory under wich to save the key') + return QtGui.QMessageBox.warning(self, self.windowTitle(), 'Please enter a directory under wich to save the key') self._fileName = os.path.join(unicode(directory), unicode(fileName)) self.done(self.Accepted) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-31 17:07:27
|
Revision: 839 http://fclient.svn.sourceforge.net/fclient/?rev=839&view=rev Author: jUrner Date: 2008-07-31 17:07:36 +0000 (Thu, 31 Jul 2008) Log Message: ----------- another reorg of the repos Removed Paths: ------------- trunk/fclient/src/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-31 17:05:38
|
Revision: 838 http://fclient.svn.sourceforge.net/fclient/?rev=838&view=rev Author: jUrner Date: 2008-07-31 17:05:46 +0000 (Thu, 31 Jul 2008) Log Message: ----------- ... Added Paths: ----------- trunk/fclient/fclient/ trunk/fclient/fclient/doc/ trunk/fclient/fclient/downloads/ trunk/fclient/fclient/fclient.py trunk/fclient/fclient/impl/ trunk/fclient/fclient/settings/ Removed Paths: ------------- trunk/fclient/fclient/doc/ trunk/fclient/fclient/downloads/ trunk/fclient/fclient/fclient.py trunk/fclient/fclient/impl/ trunk/fclient/fclient/settings/ trunk/fclient/src/fclient/ Deleted: trunk/fclient/fclient/fclient.py =================================================================== --- trunk/fclient/src/fclient/fclient.py 2008-07-31 16:50:50 UTC (rev 836) +++ trunk/fclient/fclient/fclient.py 2008-07-31 17:05:46 UTC (rev 838) @@ -1,88 +0,0 @@ - -from __future__ import absolute_import -if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below - import os; __path__ = [os.path.dirname(__file__)] - -import sys -from PyQt4 import QtGui - -from .impl import config -from .impl.lib.qt4ex import singleapp - -from .impl.MainWindow import MainWindow -from .impl.View import ViewWidget -from .impl.ViewBrowser import ViewBrowserWidget -from .impl.ViewConnection import ViewConnectionWidget -from .impl.ViewDownloads import ViewDownloadsWidget -from .impl.ViewLogger import ViewLoggerWidget - -from .impl.DlgSingleAppError import DlgSingleAppError -#************************************************************* -# -#************************************************************* -class SingleApp(singleapp.SingleApp): - - def onOtherAppIsStarting(self): - #TODO: looks like no way to bring the window to the foreground - # the calls do not work on x11. may work on windows though - # - ##QtGui.QApplication.instance().setActiveWindow(self.userData) - ##self.userData.activateWindow() - pass - -def main(): - - # parse commandline options - userHasStyleSheet = False - for arg in sys.argv: - arg = arg.lower() - if arg.startswith('-stylesheet=') or arg.startswith('-stylesheet '): - userHasStyleSheet = True - if not userHasStyleSheet: # use our own - sys.argv.append('-stylesheet=%s' % config.FcDefaultStyleSheet) - - # start single application server - singleApp = SingleApp( - host=config.fcSettings.value('SingleAppHost'), - port=config.fcSettings.value('SingleAppPort'), - magicToSend='{80a21244-c2ff-4afd-b8a2-c3b93b99332f}', - magicToRespond='{2e86f6f1-0707-415d-bfe6-6d485603a98c}' - ) - try: - singleApp.start() - except singleapp.ErrorOtherAppIsRunning: - print 'looks like another %s application is already running' % config.FcAppName - print 'exit' - sys.exit(5) - except singleapp.ErrorCanNotConnect: - app = QtGui.QApplication(sys.argv) - dlg = DlgSingleAppError() - dlg.exec_() - - else: - # start gui - app = QtGui.QApplication(sys.argv) - mainWindow = MainWindow() - singleApp.userData = mainWindow - - viewWidget = ViewWidget(mainWindow) - mainWindow.setCentralWidget(viewWidget) - viewWidget.addBottomViews(ViewLoggerWidget(mainWindow)) - viewWidget.addTopViews( - ViewConnectionWidget(mainWindow), - ViewBrowserWidget(mainWindow), - ViewDownloadsWidget(mainWindow), - ) - - mainWindow.show() - res = app.exec_() - sys.exit(res) - -#********************************************************************************** -# -#********************************************************************************** -if __name__ == '__main__': - main() - - - Copied: trunk/fclient/fclient/fclient.py (from rev 837, trunk/fclient/src/fclient/fclient.py) =================================================================== --- trunk/fclient/fclient/fclient.py (rev 0) +++ trunk/fclient/fclient/fclient.py 2008-07-31 17:05:46 UTC (rev 838) @@ -0,0 +1,88 @@ + +from __future__ import absolute_import +if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below + import os; __path__ = [os.path.dirname(__file__)] + +import sys +from PyQt4 import QtGui + +from .impl import config +from .impl.lib.qt4ex import singleapp + +from .impl.MainWindow import MainWindow +from .impl.View import ViewWidget +from .impl.ViewBrowser import ViewBrowserWidget +from .impl.ViewConnection import ViewConnectionWidget +from .impl.ViewDownloads import ViewDownloadsWidget +from .impl.ViewLogger import ViewLoggerWidget + +from .impl.DlgSingleAppError import DlgSingleAppError +#************************************************************* +# +#************************************************************* +class SingleApp(singleapp.SingleApp): + + def onOtherAppIsStarting(self): + #TODO: looks like no way to bring the window to the foreground + # the calls do not work on x11. may work on windows though + # + ##QtGui.QApplication.instance().setActiveWindow(self.userData) + ##self.userData.activateWindow() + pass + +def main(): + + # parse commandline options + userHasStyleSheet = False + for arg in sys.argv: + arg = arg.lower() + if arg.startswith('-stylesheet=') or arg.startswith('-stylesheet '): + userHasStyleSheet = True + if not userHasStyleSheet: # use our own + sys.argv.append('-stylesheet=%s' % config.FcDefaultStyleSheet) + + # start single application server + singleApp = SingleApp( + host=config.fcSettings.value('SingleAppHost'), + port=config.fcSettings.value('SingleAppPort'), + magicToSend='{80a21244-c2ff-4afd-b8a2-c3b93b99332f}', + magicToRespond='{2e86f6f1-0707-415d-bfe6-6d485603a98c}' + ) + try: + singleApp.start() + except singleapp.ErrorOtherAppIsRunning: + print 'looks like another %s application is already running' % config.FcAppName + print 'exit' + sys.exit(5) + except singleapp.ErrorCanNotConnect: + app = QtGui.QApplication(sys.argv) + dlg = DlgSingleAppError() + dlg.exec_() + + else: + # start gui + app = QtGui.QApplication(sys.argv) + mainWindow = MainWindow() + singleApp.userData = mainWindow + + viewWidget = ViewWidget(mainWindow) + mainWindow.setCentralWidget(viewWidget) + viewWidget.addBottomViews(ViewLoggerWidget(mainWindow)) + viewWidget.addTopViews( + ViewConnectionWidget(mainWindow), + ViewBrowserWidget(mainWindow), + ViewDownloadsWidget(mainWindow), + ) + + mainWindow.show() + res = app.exec_() + sys.exit(res) + +#********************************************************************************** +# +#********************************************************************************** +if __name__ == '__main__': + main() + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-31 16:58:34
|
Revision: 837 http://fclient.svn.sourceforge.net/fclient/?rev=837&view=rev Author: jUrner Date: 2008-07-31 16:58:43 +0000 (Thu, 31 Jul 2008) Log Message: ----------- ups, missing module Added Paths: ----------- trunk/fclient/src/fclient/impl/lib/numbers.py Added: trunk/fclient/src/fclient/impl/lib/numbers.py =================================================================== --- trunk/fclient/src/fclient/impl/lib/numbers.py (rev 0) +++ trunk/fclient/src/fclient/impl/lib/numbers.py 2008-07-31 16:58:43 UTC (rev 837) @@ -0,0 +1,314 @@ +"""Number crunching and others + +""" + +import re +#*************************************************************** +# +#*************************************************************** +class ByteSizeNames: + Binary = ('B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB') + Common = ('', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb', 'Eb', 'Zb', 'Yb') + + + +def format_num_bytes(num, binary=False, names=None, format_strings=('%i%s', '%01.2f%s') ): + """Formats a number representing a number of bytes to a human readable string + @param num: (int) number to fomat + @param binary: if True conversion factor is 1024, else factor is 1000 + @param names: (tuple) names to use as suffix or None to use default names (see L{ByteSizeNames}) + @param format_strings: (tuple) format strings to be used or None to use the default formating. + The first member of the tuple is used to format bytes, the seconds anything > one kilobyte + @return: (str) formated number + + >>> format_num_bytes(100) + '100B' + + >>> format_num_bytes(1000) + '1.00KB' + + >>> format_num_bytes(1024, binary=True) + '1.00KiB' + + >>> format_num_bytes(1000, names=('W', 'X', 'Y', 'Z')) + '1.00X' + + >>> format_num_bytes(1000, format_strings=('%s%i', '%01.4f%s')) + '1.0000KB' + + """ + if binary: + factor = 1024 + if names is None: + names = ByteSizeNames.Binary + else: + factor = 1000 + if names is None: + names = ByteSizeNames.Common + + name = names[0] + if num >= factor: + num = float(num) + for tmp_name in names[1: ]: + num /= factor + name = tmp_name + if num < factor: + break + else: + return format_strings[0] % (num, name) + return format_strings[1] % (num, name) + + +NumBytesPat = re.compile('''\A (\d+ \. \d+) | (\d+)''', re.X) +def num_bytes_to_bytes(num, binary=False, names=None): + """Converts a string containing a bytes size to an integer + @param num: (str) string to convert + @param binary: if True conversion factor is 1024, else factor is 1000 + @param names: (tuple) names to use as suffix or None to use default names (see L{ByteSizeNames}) + + @return: (int) number of bytes + @note: postfixes are handled case sensitive + + >>> num_bytes_to_bytes('1000B') + 1000 + + >>> num_bytes_to_bytes('1GB') + 1000000000 + + >>> num_bytes_to_bytes('1.2KB') + 1200 + + >>> num_bytes_to_bytes('1.5678B') + 2 + + >>> num_bytes_to_bytes('1MiB', binary=True) + 1048576 + + >>> num_bytes_to_bytes('1X', names=('X', )) + 1 + + >>> num_bytes_to_bytes('foo') + Traceback (most recent call last): + ... + ValueError: No number found in input string + + >>> num_bytes_to_bytes('1foo') + Traceback (most recent call last): + ... + ValueError: Unknown size postfix + """ + if names is None: + if binary: + names = ByteSizeNames.Binary + else: + names = ByteSizeNames.Common + names = list(names) + + match = NumBytesPat.match(num) + if match is None: + raise ValueError('No number found in input string') + + isfloat, isint = match.groups() + if isfloat: + z = len(isfloat) + tmp_num = float(isfloat) + else: + z = len(isint) + tmp_num = int(isint) + + postfix = num[z: ] + try: + exp = names.index(postfix) + except ValueError: + raise ValueError('Unknown size postfix') + factor = 1024 if binary else 1000 + + #TODO: 1.96B is returned rounded as 2. Should we complain? + return int(round(tmp_num * (factor ** exp))) + + +#*************************************************************** +# +#*************************************************************** +TimeDurationNames = { + 'seconds': 's', + 'minutes': 'm', + 'hours': 'h', + 'days': 'd', + 'years': 'y' + } +def format_time_delta(t1, t2, names=None): + """Pretty prints a time delta + @arg t1: duration starting time + @arg t2: duration ending time + @arg names: (optional) dict mapping names to names as they should be + to be printed (see TimeDurationNames) + + >>> import time + >>> t0 = time.time() + + >>> format_time_delta(t0, t0 +1) + '1s' + + >>> format_time_delta(t0, t0) + '0s' + + >>> format_time_delta(t0, t0 +1.4) + '1.4s' + + >>> format_time_delta(t0, t0 +60) + '1m' + + >>> format_time_delta(t0, t0 +12345) + '3.4h' + + >>> format_time_delta(t0, t0 +1234567890) + '39.1y' + + >>> format_time_delta(t0, t0 +1234567890, names={'years': 'leapers', 'seconds': 's', 'minutes': 'm', 'hours': 'h', 'days': 'd'}) + '39.1leapers' + + """ + mapping = ( + ('years', 1), + ('days', 365), + ('hours', 24), + ('minutes', 60), + ('seconds', 60), + ) + if names is None: + names = TimeDurationNames + + delta = t2 - t1 + if delta < 0: + t = n = 0 + name = 'seconds' + else: + start = (60 * 60 * 24 * 365) + for name, fac in mapping: + start = start / fac + t = delta / start + t = round(t, 1) + n = int(t) + if n: + break + + name = names[name] + if t > n: + return '%s%s' % (t, name) + else: + return '%s%s' % (n, name) + + +#***************************************************************** +# +#**************************************************************** +HEX_PREFIXES = ('0x', '0X', '&H', '&h') +NUM_DIGITS = "0123456789abcdefghijklmnopqrstuvwxyz" + + +def to_base(to_base, num, base=10, hex_prefixes=HEX_PREFIXES): + """Converts a number to the desired base + @param to_base: base to convert the number to (2-36 and 256) + @param num: number to convert + @param base: base of the number to convert + @param hex_prefixes: prefixes for hexadecimal numbers to be recognized by the function + + @return: (str) converted number + + + >>> to_base(2, 10) + '1010' + >>> to_base(10, '1010', base=2) + '10' + >>> to_base(2, '1010', base=2) + '1010' + + >>> to_base(10, '0xFF', base=16) + '255' + + >>> to_base(256, '0x61', base=16) + 'a' + >>> to_base(2, 'a', base=256) + '1100001' + + + >>> result = to_base(2, 'Hello World!', 256) + >>> result + '10010000110010101101100011011000110111100100000010101110110111101110010011011000110010000100001' + >>> result = to_base(256, result, base=2) + >>> result + 'Hello World!' + + """ + if num < 0: + raise ValueError('negative numbers not supported: %r' % num) + if to_base < 2 or to_base > 36 and not to_base == 256: + raise ValueError('bes must be in range 2-36 or 256, found: %r' % to_base) + if base < 2 or base > 36 and not base == 256: + raise ValueError('bes must be in range 2-36 or 256, found: %r' % base) + + if base == 256: + tmp_num = 0 + for char in num: + tmp_num = (tmp_num << 8) + ord(char) + num = tmp_num + else: + # let int() handle it + if base == 16: + num = strip_hex_prefix(num, hex_prefixes=hex_prefixes) + num = int('%s' % num, base) + + if to_base == 10 and base != 256: + return str(num) + + out = '' + if to_base == 256: + while num: + num, tail = divmod(num, to_base) + out += chr(tail) + return out[-1::-1] if out else '\x00' + else: + while num: + num, tail = divmod(num, to_base) + out += NUM_DIGITS[tail] + return out[-1::-1] if out else '0' + + + +def strip_hex_prefix(num, hex_prefixes=HEX_PREFIXES): + """Strips prefixes from hexadecimal numbers + @param num: number to strip prefix from + @param hex_prefixes: list containing prefixes to strip + @return: (str) stripped number + + >>> strip_hex_prefix('0xFF') + 'FF' + >>> strip_hex_prefix('&HFF') + 'FF' + >>> strip_hex_prefix(10) + '10' + >>> strip_hex_prefix('') + '' + + """ + if not isinstance(num, basestring): + num = '%s' % num + else: + pat = re.compile( + '\A(%s)' % '|'.join([re.escape(i) for i in hex_prefixes]) + ) + num = pat.sub('', num) + return num + + +#***************************************************************** +# +#**************************************************************** +if __name__ == '__main__': + import doctest + doctest.testmod() + + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-31 16:50:43
|
Revision: 836 http://fclient.svn.sourceforge.net/fclient/?rev=836&view=rev Author: jUrner Date: 2008-07-31 16:50:50 +0000 (Thu, 31 Jul 2008) Log Message: ----------- ... Modified Paths: -------------- trunk/web/intro.html trunk/web/screenshots-fclient.html Added Paths: ----------- trunk/web/img-fclient/ trunk/web/img-fclient/browser-1.png trunk/web/img-fclient/browser.png Property changes on: trunk/web/img-fclient/browser-1.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/web/img-fclient/browser.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/web/intro.html =================================================================== --- trunk/web/intro.html 2008-07-31 16:45:24 UTC (rev 835) +++ trunk/web/intro.html 2008-07-31 16:50:50 UTC (rev 836) @@ -9,7 +9,8 @@ <div class="topic"> - <b>fclient:</b> Gui frontend for freenet written in python and Qt. Not yet + <b>fclient:</b> Gui frontend for freenet written in python and Qt. The Gui + is yet under developement <br> [<a href="more-fclient.html" target="mainFrame">..more</a>] [<a href="download-fclient.html" target="mainFrame">download</a>] [<a href="screenshots-fclient.html" target="mainFrame">screenshots</a>] @@ -18,8 +19,9 @@ <div class="topic"> - <b>fcp2:</b> high level wrapper for the freenet client protocol version 2 written in python. Automatic - conversions from Fcp to python types, access to node and peer configurations and much more. + <b>fcp2:</b> high level wrapper for the freenet client protocol version 2 written in python. + Automatic conversions from Fcp to python types, access to node and peer configurations + and much more. The wrapper is yet under developement <br> [<a href="more-fcp2.html" target="mainFrame">..more</a>] [<a href="download-fcp2.html" target="mainFrame">download</a>] [<a href="screenshots-fcp2.html" target="mainFrame">screenshots</a>] </div> Modified: trunk/web/screenshots-fclient.html =================================================================== --- trunk/web/screenshots-fclient.html 2008-07-31 16:45:24 UTC (rev 835) +++ trunk/web/screenshots-fclient.html 2008-07-31 16:50:50 UTC (rev 836) @@ -11,8 +11,9 @@ <br> <br> - Not yet + a first screenshot of the gui under developement:<br> + <p style="text-indent: 3em"><img src="img-fclient/browser-1.png"> <div class="bottom_padding"></div> </body> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-31 16:45:16
|
Revision: 835 http://fclient.svn.sourceforge.net/fclient/?rev=835&view=rev Author: jUrner Date: 2008-07-31 16:45:24 +0000 (Thu, 31 Jul 2008) Log Message: ----------- adapt to fcp2.Client changes ++ roughly estimate dl size by CHK block size Modified Paths: -------------- trunk/fclient/src/fclient/impl/ViewDownloads.py Modified: trunk/fclient/src/fclient/impl/ViewDownloads.py =================================================================== --- trunk/fclient/src/fclient/impl/ViewDownloads.py 2008-07-31 16:44:10 UTC (rev 834) +++ trunk/fclient/src/fclient/impl/ViewDownloads.py 2008-07-31 16:45:24 UTC (rev 835) @@ -44,12 +44,17 @@ from .lib import fcp2 from .lib.fcp2.lib import pmstruct from .lib.qt4ex import treewidgetwrap +from .lib import numbers from . import DlgDownloadKeyToDisk from .tpls.Ui_ViewDownloadsWidgetTpl import Ui_ViewDownloadsWidget #********************************************************************************** # +#********************************************************************************** +BLOCK_SIZE = 32768 # from CHKBlock.java +#********************************************************************************** +# #********************************************************************************** class DownloadsViewObject(config.ViewObject): @@ -197,9 +202,9 @@ #********************************************************************************** class TreeItem(QtGui.QTreeWidgetItem): - def __init__(self, fcpIdentifier, *params): + def __init__(self, fcpRequest, *params): QtGui.QTreeWidgetItem.__init__(self, *params) - self.fcpIdentifier = fcpIdentifier + self.fcpRequest = fcpRequest # can be used to expose properties for stylesheets for example @@ -252,13 +257,11 @@ self.fcHeadeLabels = {} self.fcpRequests = {} - self.foo = True - ############################ ## private methods ############################ def _createItemFromFcpRequest(self, fcpRequest): - item= TreeItem(fcpRequest['Identifier'], self.tree) + item= TreeItem(fcpRequest, self.tree) fileName = fcpRequest['Filename'] mimeType = mimetypes.guess_type(fileName)[0] icon = config.fcResources.getIcon( @@ -287,7 +290,7 @@ self.fcHeadeLabels = { self.HeaderIndexName: self.trUtf8('Name'), self.HeaderIndexSize: self.trUtf8('Size'), - self.HeaderIndexMimeType: self.trUtf8('Type'), + self.HeaderIndexMimeType: self.trUtf8('MimeType'), self.HeaderIndexStatus: self.trUtf8('Status'), self.HeaderIndexProgress: self.trUtf8('Progress'), } @@ -324,14 +327,18 @@ def downloadFile(self, fcpKey, fileName, **kws): """""" + fileName = unicode(fileName) - fcpIdentifier = config.fcpClient.getFile( + fcpRequest = config.fcpClient.getFile( fcpKey, fileName, persistentUserData=PersistentRequestData(ClientName=unicode(self.objectName())).dump(), + #handleFilenameCollision=True, + handlePermanentRedirect=True, **kws ) - item = self._createItemFromFcpRequest(config.fcpClient.getRequest(fcpIdentifier)) + item = self._createItemFromFcpRequest(fcpRequest) + def populateMenu(self, menu): menu.addAction(self.fcActions['ActionDownloadKeyToDisk']) @@ -350,7 +357,6 @@ handleFilenameCollision=True, ) - def onRemoveSelectedRequests(self, action): tree = self.controlById(self.IdTree) for item in tree.selectedItems(): @@ -360,11 +366,11 @@ it = treewidgetwrap.TreeWidgetIterator(parent) it.next() for tmp_item in it: - config.fcpClient.removeRequest(tmp_item.fcpIdentifier) - del self.fcpRequests[tmp_item.fcpIdentifier] + del self.fcpRequests[tmp_item.fcpRequest['Identifier']] + config.fcpClient.removeRequest(tmp_item.fcpRequest) + tmp_item.fcpRequest = None parent.removeChild(item) - - + def onTreeCustomContextMenuRequested(self, pt): tree = self.controlById(self.IdTree) pt = tree.viewport().mapToGlobal(pt) @@ -388,35 +394,49 @@ def onFcpRequestCompleted(self, fcpEvent, fcpRequest): - item = self.fcpRequests.get(fcpRequest['Identifier'], None) + requestIdentifier = fcpRequest['Identifier'] + + item = self.fcpRequests.get(requestIdentifier, None) if item is not None: progressBar = self.tree.itemWidget(item, self.HeaderIndexProgress) progressBar.setRange(0, 1) progressBar.setValue(progressBar.maximum()) + item.setData( + self.HeaderIndexSize, + QtCore.Qt.DisplayRole, + QtCore.QVariant(numbers.format_num_bytes(fcpRequest['MetadataSize'])) + ) + item.setData( + self.HeaderIndexMimeType, + QtCore.Qt.DisplayRole, + QtCore.QVariant(fcpRequest['MetadataContentType']) + ) + def onFcpRequestFailed(self, fcpEvent, fcpRequest): pass #TODO: not tested def onFcpRequestModified(self, fcpEvent, fcpRequest): - if fcp2.ConstRequestModified.Identifier in fcpRequest['Modified']: - newFcpIdentifier = fcpRequest['Identifier'] - oldFcpIdentifier = fcpRequest['Modified'][fcp2.ConstRequestModified.Identifier] - item = self.fcpRequests.get(oldFcpIdentifier, None) - if item is not None: - del self.fcpRequests[oldFcpIdentifier] + + requestIdentifier = fcpRequest['Modified'].get(fcp2.ConstRequestModified.Identifier, None) + if requestIdentifier is None: + requestIdentifier = fcpRequest['Identifier'] + item = self.fcpRequests.get(requestIdentifier, None) + + if item is not None: + if fcp2.ConstRequestModified.Identifier in fcpRequest['Modified']: + newFcpIdentifier = fcpRequest['Identifier'] + del self.fcpRequests[requestIdentifier] self.fcpRequests[newFcpIdentifier] = item - item.fcpIdentifier = newFcpIdentifier - - if fcp2.ConstRequestModified.Filename in fcpRequest['Modified']: - item = self.fcpRequests.get(fcpRequest['Identifier'], None) - if item is not None: + + if fcp2.ConstRequestModified.Filename in fcpRequest['Modified']: item.setData( - self.HeaderIndexName, - QtCore.Qt.DisplayRole, - QtCore.QVariant(os.path.basename(fcpRequest['Filename'])) - ) + self.HeaderIndexName, + QtCore.Qt.DisplayRole, + QtCore.QVariant(os.path.basename(fcpRequest['Filename'])) + ) def onFcpRequestProgress(self, fcpEvent, fcpRequest): @@ -426,6 +446,14 @@ progressBar.setRange(0, fcpRequest['ProgressRequired']) progressBar.setValue(fcpRequest['ProgressSucceeded']) + + #TODO: take a wild guess at the size. no other way to do it currently + estimatedSize = int((BLOCK_SIZE * fcpRequest['ProgressRequired']) + 1) + item.setData( + self.HeaderIndexSize, + QtCore.Qt.DisplayRole, + QtCore.QVariant(self.trUtf8('< ') + numbers.format_num_bytes(estimatedSize)), + ) def onFcpRequestRemoved(self, fcpEvent, fcpRequest): @@ -440,8 +468,7 @@ else: if requestData.get('ClientName', None) == self.objectName(): item = self._createItemFromFcpRequest(fcpRequest) - - + #********************************************************************************** # #********************************************************************************** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-31 16:44:01
|
Revision: 834 http://fclient.svn.sourceforge.net/fclient/?rev=834&view=rev Author: jUrner Date: 2008-07-31 16:44:10 +0000 (Thu, 31 Jul 2008) Log Message: ----------- bit better handling of dl and open link Modified Paths: -------------- trunk/fclient/src/fclient/impl/ViewBrowser.py Modified: trunk/fclient/src/fclient/impl/ViewBrowser.py =================================================================== --- trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-31 16:42:53 UTC (rev 833) +++ trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-31 16:44:10 UTC (rev 834) @@ -25,9 +25,11 @@ # x. user staring gui for first time. maybe we should not connext untill the user connects explicitely # x. looks like on error loading page reload does not work # x. when loading a page, until fproxy reacts reload is enabled instead of stop. hitting reloading will trigger an error +# page, but reloads the current page as expected. no idea how to handle error page poping up. # x. icons on find bar push button text tio the side. no idea # x. on find action, give feedback when no matching text was found on page -# some shortcuts for actions are still missing +# x. some shortcuts for actions are still missing +# x. rework to support dynamic retranslation #****************************************************************************************** """ @@ -593,6 +595,12 @@ handleFilenameCollision=True, ) return True + + QtGui.QMessageBox.critical( + self, + config.FcAppName + self.trUtf8(' - Browser error'), + self.trUtf8('Can not download key (key is invalid)') + ) return False ######################################### @@ -681,7 +689,7 @@ act.setText(self.trUtf8('Open image in new tab')) act = browser.pageAction(page.OpenFrameInNewWindow) act.setText(self.trUtf8('Open frame in new tab')) - + # customize page page.setLinkDelegationPolicy(page.DelegateAllLinks) @@ -712,6 +720,14 @@ return menu ######################################### + ## overwritten methods + ######################################### + #TODO: retranslate adjusted browser actions for all browsers + #TODO: retranslate all tab texts we inserted. mabe a flag tabHasCustomText + def retranslateUi(self, me): + Ui_ViewBrowserWidget.retranslateUi(self, me) + + ######################################### ## overwritten events ######################################### def closeEvent(self): @@ -762,6 +778,12 @@ menu.addAction(browser.pageAction(page.Copy)) menu.addAction(self.fcActions['ActionObjectProperties']) + #TODO: QwebView assumes we can download queries - we can't + if browser.pageAction(page.DownloadLinkToDisk).isEnabled(): + result = config.qStringToFcpKey(hitTestResult.linkUrl().toString()) + if result is None: + browser.pageAction(page.DownloadLinkToDisk).setEnabled(False) + action = menu.exec_(pt) if action == browser.pageAction(page.OpenLinkInNewWindow): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-31 16:42:47
|
Revision: 833 http://fclient.svn.sourceforge.net/fclient/?rev=833&view=rev Author: jUrner Date: 2008-07-31 16:42:53 +0000 (Thu, 31 Jul 2008) Log Message: ----------- let css do the job of styling Modified Paths: -------------- trunk/fclient/src/fclient/impl/res/stylesheets/default.css trunk/fclient/src/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui trunk/fclient/src/fclient/impl/tpls/DlgPropsBrowserObjectTpl.ui trunk/fclient/src/fclient/impl/tpls/DlgSingleAppErrorTpl.ui trunk/fclient/src/fclient/impl/tpls/PrefsSingleAppTpl.ui trunk/fclient/src/fclient/impl/tpls/Ui_DlgDownloadKeyToDiskTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_DlgPropsBrowserObjectTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_DlgSingleAppErrorTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_PrefsSingleAppTpl.py Modified: trunk/fclient/src/fclient/impl/res/stylesheets/default.css =================================================================== --- trunk/fclient/src/fclient/impl/res/stylesheets/default.css 2008-07-31 16:41:55 UTC (rev 832) +++ trunk/fclient/src/fclient/impl/res/stylesheets/default.css 2008-07-31 16:42:53 UTC (rev 833) @@ -1,2 +1,27 @@ -/* fclient default stylesheet */ +/*********************************************************************************************** +fclient default stylesheet + +Notes: +---------- +x. multiple widgets of the same Css class should follow QTDesigners naming convention.. + + myObjectName + myObjectName_2 + myObjectName_3 + (..) + +**********************************************************************************************/ + +/* style for "Name: | |" labels. for example "Host: |9999|" */ +QLabel#fieldName, +QLabel#fieldName_2, +QLabel#fieldName_3, +QLabel#fieldName_4, +QLabel#fieldName_5, +QLabel#fieldName_6, +QLabel#fieldName_7, +QLabel#fieldName_8, +QLabel#fieldName_9{ + font: bold; + } \ No newline at end of file Modified: trunk/fclient/src/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui =================================================================== --- trunk/fclient/src/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui 2008-07-31 16:41:55 UTC (rev 832) +++ trunk/fclient/src/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui 2008-07-31 16:42:53 UTC (rev 833) @@ -16,9 +16,9 @@ <item row="0" column="0" > <layout class="QVBoxLayout" name="verticalLayout" > <item> - <widget class="QLabel" name="label" > + <widget class="QLabel" name="fieldName" > <property name="text" > - <string><b>Key:</b></string> + <string>Key:</string> </property> </widget> </item> @@ -30,9 +30,9 @@ </widget> </item> <item> - <widget class="QLabel" name="label_3" > + <widget class="QLabel" name="fieldName_2" > <property name="text" > - <string><b>File name:</b></string> + <string>File name:</string> </property> </widget> </item> @@ -40,9 +40,9 @@ <widget class="QLineEdit" name="edFileName" /> </item> <item> - <widget class="QLabel" name="label_2" > + <widget class="QLabel" name="fieldName_3" > <property name="text" > - <string><b>Directory:</b></string> + <string>Directory:</string> </property> </widget> </item> Modified: trunk/fclient/src/fclient/impl/tpls/DlgPropsBrowserObjectTpl.ui =================================================================== --- trunk/fclient/src/fclient/impl/tpls/DlgPropsBrowserObjectTpl.ui 2008-07-31 16:41:55 UTC (rev 832) +++ trunk/fclient/src/fclient/impl/tpls/DlgPropsBrowserObjectTpl.ui 2008-07-31 16:42:53 UTC (rev 833) @@ -16,7 +16,7 @@ <item row="0" column="0" > <layout class="QVBoxLayout" name="verticalLayout" > <item> - <widget class="QLabel" name="label" > + <widget class="QLabel" name="fieldName" > <property name="sizePolicy" > <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > <horstretch>0</horstretch> @@ -24,7 +24,7 @@ </sizepolicy> </property> <property name="text" > - <string><b>Type:</b></string> + <string>Type:</string> </property> <property name="alignment" > <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> @@ -48,7 +48,7 @@ </widget> </item> <item> - <widget class="QLabel" name="label_2" > + <widget class="QLabel" name="fieldName_2" > <property name="sizePolicy" > <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > <horstretch>0</horstretch> @@ -56,7 +56,7 @@ </sizepolicy> </property> <property name="text" > - <string><b>Title:</b></string> + <string>Title:</string> </property> <property name="alignment" > <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> @@ -80,7 +80,7 @@ </widget> </item> <item> - <widget class="QLabel" name="label_99" > + <widget class="QLabel" name="fieldName_3" > <property name="sizePolicy" > <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > <horstretch>0</horstretch> @@ -88,7 +88,7 @@ </sizepolicy> </property> <property name="text" > - <string><b>Name:</b></string> + <string>Name:</string> </property> <property name="alignment" > <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> @@ -112,7 +112,7 @@ </widget> </item> <item> - <widget class="QLabel" name="label_4" > + <widget class="QLabel" name="fieldName_4" > <property name="sizePolicy" > <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > <horstretch>0</horstretch> @@ -120,7 +120,7 @@ </sizepolicy> </property> <property name="text" > - <string><b>LinkUrl:</b></string> + <string>LinkUrl:</string> </property> <property name="alignment" > <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> @@ -144,7 +144,7 @@ </widget> </item> <item> - <widget class="QLabel" name="label_5" > + <widget class="QLabel" name="fieldName_5" > <property name="sizePolicy" > <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > <horstretch>0</horstretch> @@ -152,7 +152,7 @@ </sizepolicy> </property> <property name="text" > - <string><b>ImageUrl:</b></string> + <string>ImageUrl:</string> </property> <property name="alignment" > <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> Modified: trunk/fclient/src/fclient/impl/tpls/DlgSingleAppErrorTpl.ui =================================================================== --- trunk/fclient/src/fclient/impl/tpls/DlgSingleAppErrorTpl.ui 2008-07-31 16:41:55 UTC (rev 832) +++ trunk/fclient/src/fclient/impl/tpls/DlgSingleAppErrorTpl.ui 2008-07-31 16:42:53 UTC (rev 833) @@ -13,20 +13,37 @@ <string>Dialog</string> </property> <layout class="QGridLayout" name="gridLayout" > + <item row="1" column="0" > + <widget class="Line" name="line" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="QDialogButtonBox" name="buttonBox" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons" > + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> <item row="0" column="0" > <widget class="QSplitter" name="splitter" > <property name="orientation" > <enum>Qt::Horizontal</enum> </property> <widget class="QTextEdit" name="textEdit" /> - <widget class="QWidget" name="" > + <widget class="QWidget" name="layoutWidget" > <layout class="QVBoxLayout" name="verticalLayout_2" > <item> <layout class="QVBoxLayout" name="verticalLayout" > <item> - <widget class="QLabel" name="label" > + <widget class="QLabel" name="fieldName" > <property name="text" > - <string><b>Host: </b></string> + <string>Host: </string> </property> </widget> </item> @@ -34,9 +51,9 @@ <widget class="QLineEdit" name="edHost" /> </item> <item> - <widget class="QLabel" name="label_3" > + <widget class="QLabel" name="fieldName_2" > <property name="text" > - <string><b>Port: </b></string> + <string>Port: </string> </property> </widget> </item> @@ -62,29 +79,9 @@ </widget> </widget> </item> - <item row="1" column="0" > - <widget class="Line" name="line" > - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item row="2" column="0" > - <widget class="QDialogButtonBox" name="buttonBox" > - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons" > - <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> - </property> - </widget> - </item> </layout> - <zorder>textEdit</zorder> <zorder>line</zorder> <zorder>buttonBox</zorder> - <zorder>textEdit</zorder> - <zorder>textEdit</zorder> <zorder>splitter</zorder> </widget> <resources/> Modified: trunk/fclient/src/fclient/impl/tpls/PrefsSingleAppTpl.ui =================================================================== --- trunk/fclient/src/fclient/impl/tpls/PrefsSingleAppTpl.ui 2008-07-31 16:41:55 UTC (rev 832) +++ trunk/fclient/src/fclient/impl/tpls/PrefsSingleAppTpl.ui 2008-07-31 16:42:53 UTC (rev 833) @@ -32,9 +32,9 @@ <item row="1" column="0" > <layout class="QVBoxLayout" name="verticalLayout" > <item> - <widget class="QLabel" name="label_2" > + <widget class="QLabel" name="fieldName" > <property name="text" > - <string><b>Single application host: </b></string> + <string>Single application host: </string> </property> </widget> </item> @@ -42,9 +42,9 @@ <widget class="QLineEdit" name="edHost" /> </item> <item> - <widget class="QLabel" name="label_3" > + <widget class="QLabel" name="fieldName_2" > <property name="text" > - <string><b>Single application port: </b></string> + <string>Single application port: </string> </property> </widget> </item> Modified: trunk/fclient/src/fclient/impl/tpls/Ui_DlgDownloadKeyToDiskTpl.py =================================================================== --- trunk/fclient/src/fclient/impl/tpls/Ui_DlgDownloadKeyToDiskTpl.py 2008-07-31 16:41:55 UTC (rev 832) +++ trunk/fclient/src/fclient/impl/tpls/Ui_DlgDownloadKeyToDiskTpl.py 2008-07-31 16:42:53 UTC (rev 833) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui' # -# Created: Sun Jul 27 21:01:10 2008 +# Created: Thu Jul 31 18:23:06 2008 # by: PyQt4 UI code generator 4.4.3-snapshot-20080705 # # WARNING! All changes made in this file will be lost! @@ -17,22 +17,22 @@ self.gridLayout.setObjectName("gridLayout") self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") - self.label = QtGui.QLabel(DlgDownloadKeyToDisk) - self.label.setObjectName("label") - self.verticalLayout.addWidget(self.label) + self.fieldName = QtGui.QLabel(DlgDownloadKeyToDisk) + self.fieldName.setObjectName("fieldName") + self.verticalLayout.addWidget(self.fieldName) self.edKey = QtGui.QLineEdit(DlgDownloadKeyToDisk) self.edKey.setDragEnabled(True) self.edKey.setObjectName("edKey") self.verticalLayout.addWidget(self.edKey) - self.label_3 = QtGui.QLabel(DlgDownloadKeyToDisk) - self.label_3.setObjectName("label_3") - self.verticalLayout.addWidget(self.label_3) + self.fieldName_2 = QtGui.QLabel(DlgDownloadKeyToDisk) + self.fieldName_2.setObjectName("fieldName_2") + self.verticalLayout.addWidget(self.fieldName_2) self.edFileName = QtGui.QLineEdit(DlgDownloadKeyToDisk) self.edFileName.setObjectName("edFileName") self.verticalLayout.addWidget(self.edFileName) - self.label_2 = QtGui.QLabel(DlgDownloadKeyToDisk) - self.label_2.setObjectName("label_2") - self.verticalLayout.addWidget(self.label_2) + self.fieldName_3 = QtGui.QLabel(DlgDownloadKeyToDisk) + self.fieldName_3.setObjectName("fieldName_3") + self.verticalLayout.addWidget(self.fieldName_3) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.edDirectory = QtGui.QLineEdit(DlgDownloadKeyToDisk) @@ -64,9 +64,9 @@ def retranslateUi(self, DlgDownloadKeyToDisk): DlgDownloadKeyToDisk.setWindowTitle(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "Dialog", None, QtGui.QApplication.UnicodeUTF8)) - self.label.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "<b>Key:</b>", None, QtGui.QApplication.UnicodeUTF8)) - self.label_3.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "<b>File name:</b>", None, QtGui.QApplication.UnicodeUTF8)) - self.label_2.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "<b>Directory:</b>", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldName.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "Key:", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldName_2.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "File name:", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldName_3.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "Directory:", None, QtGui.QApplication.UnicodeUTF8)) self.btChooseDirectory.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "...", None, QtGui.QApplication.UnicodeUTF8)) Modified: trunk/fclient/src/fclient/impl/tpls/Ui_DlgPropsBrowserObjectTpl.py =================================================================== --- trunk/fclient/src/fclient/impl/tpls/Ui_DlgPropsBrowserObjectTpl.py 2008-07-31 16:41:55 UTC (rev 832) +++ trunk/fclient/src/fclient/impl/tpls/Ui_DlgPropsBrowserObjectTpl.py 2008-07-31 16:42:53 UTC (rev 833) @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/tpls/DlgPropsBrowserObjectTpl.ui' +# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/impl/tpls/DlgPropsBrowserObjectTpl.ui' # -# Created: Fri Jul 25 21:08:39 2008 +# Created: Thu Jul 31 18:25:16 2008 # by: PyQt4 UI code generator 4.4.3-snapshot-20080705 # # WARNING! All changes made in this file will be lost! @@ -17,15 +17,15 @@ self.gridLayout.setObjectName("gridLayout") self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") - self.label = QtGui.QLabel(DlgPropsBrowserObject) + self.fieldName = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth()) - self.label.setSizePolicy(sizePolicy) - self.label.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) - self.label.setObjectName("label") - self.verticalLayout.addWidget(self.label) + sizePolicy.setHeightForWidth(self.fieldName.sizePolicy().hasHeightForWidth()) + self.fieldName.setSizePolicy(sizePolicy) + self.fieldName.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.fieldName.setObjectName("fieldName") + self.verticalLayout.addWidget(self.fieldName) self.labeType = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) @@ -35,15 +35,15 @@ self.labeType.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) self.labeType.setObjectName("labeType") self.verticalLayout.addWidget(self.labeType) - self.label_2 = QtGui.QLabel(DlgPropsBrowserObject) + self.fieldName_2 = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth()) - self.label_2.setSizePolicy(sizePolicy) - self.label_2.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) - self.label_2.setObjectName("label_2") - self.verticalLayout.addWidget(self.label_2) + sizePolicy.setHeightForWidth(self.fieldName_2.sizePolicy().hasHeightForWidth()) + self.fieldName_2.setSizePolicy(sizePolicy) + self.fieldName_2.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.fieldName_2.setObjectName("fieldName_2") + self.verticalLayout.addWidget(self.fieldName_2) self.labelTitle = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) @@ -53,15 +53,15 @@ self.labelTitle.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) self.labelTitle.setObjectName("labelTitle") self.verticalLayout.addWidget(self.labelTitle) - self.label_99 = QtGui.QLabel(DlgPropsBrowserObject) + self.fieldName_3 = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label_99.sizePolicy().hasHeightForWidth()) - self.label_99.setSizePolicy(sizePolicy) - self.label_99.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) - self.label_99.setObjectName("label_99") - self.verticalLayout.addWidget(self.label_99) + sizePolicy.setHeightForWidth(self.fieldName_3.sizePolicy().hasHeightForWidth()) + self.fieldName_3.setSizePolicy(sizePolicy) + self.fieldName_3.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.fieldName_3.setObjectName("fieldName_3") + self.verticalLayout.addWidget(self.fieldName_3) self.labelName = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) @@ -71,15 +71,15 @@ self.labelName.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) self.labelName.setObjectName("labelName") self.verticalLayout.addWidget(self.labelName) - self.label_4 = QtGui.QLabel(DlgPropsBrowserObject) + self.fieldName_4 = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth()) - self.label_4.setSizePolicy(sizePolicy) - self.label_4.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) - self.label_4.setObjectName("label_4") - self.verticalLayout.addWidget(self.label_4) + sizePolicy.setHeightForWidth(self.fieldName_4.sizePolicy().hasHeightForWidth()) + self.fieldName_4.setSizePolicy(sizePolicy) + self.fieldName_4.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.fieldName_4.setObjectName("fieldName_4") + self.verticalLayout.addWidget(self.fieldName_4) self.labelLinkUrl = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) @@ -89,15 +89,15 @@ self.labelLinkUrl.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) self.labelLinkUrl.setObjectName("labelLinkUrl") self.verticalLayout.addWidget(self.labelLinkUrl) - self.label_5 = QtGui.QLabel(DlgPropsBrowserObject) + self.fieldName_5 = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label_5.sizePolicy().hasHeightForWidth()) - self.label_5.setSizePolicy(sizePolicy) - self.label_5.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) - self.label_5.setObjectName("label_5") - self.verticalLayout.addWidget(self.label_5) + sizePolicy.setHeightForWidth(self.fieldName_5.sizePolicy().hasHeightForWidth()) + self.fieldName_5.setSizePolicy(sizePolicy) + self.fieldName_5.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.fieldName_5.setObjectName("fieldName_5") + self.verticalLayout.addWidget(self.fieldName_5) self.labelImageUrl = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) @@ -128,15 +128,15 @@ def retranslateUi(self, DlgPropsBrowserObject): DlgPropsBrowserObject.setWindowTitle(QtGui.QApplication.translate("DlgPropsBrowserObject", "Dialog", None, QtGui.QApplication.UnicodeUTF8)) - self.label.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "<b>Type:</b>", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldName.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "Type:", None, QtGui.QApplication.UnicodeUTF8)) self.labeType.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "unknown", None, QtGui.QApplication.UnicodeUTF8)) - self.label_2.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "<b>Title:</b>", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldName_2.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "Title:", None, QtGui.QApplication.UnicodeUTF8)) self.labelTitle.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "unknown", None, QtGui.QApplication.UnicodeUTF8)) - self.label_99.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "<b>Name:</b>", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldName_3.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "Name:", None, QtGui.QApplication.UnicodeUTF8)) self.labelName.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "unknown", None, QtGui.QApplication.UnicodeUTF8)) - self.label_4.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "<b>LinkUrl:</b>", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldName_4.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "LinkUrl:", None, QtGui.QApplication.UnicodeUTF8)) self.labelLinkUrl.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "unknown", None, QtGui.QApplication.UnicodeUTF8)) - self.label_5.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "<b>ImageUrl:</b>", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldName_5.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "ImageUrl:", None, QtGui.QApplication.UnicodeUTF8)) self.labelImageUrl.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "unknown", None, QtGui.QApplication.UnicodeUTF8)) Modified: trunk/fclient/src/fclient/impl/tpls/Ui_DlgSingleAppErrorTpl.py =================================================================== --- trunk/fclient/src/fclient/impl/tpls/Ui_DlgSingleAppErrorTpl.py 2008-07-31 16:41:55 UTC (rev 832) +++ trunk/fclient/src/fclient/impl/tpls/Ui_DlgSingleAppErrorTpl.py 2008-07-31 16:42:53 UTC (rev 833) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/impl/tpls/DlgSingleAppErrorTpl.ui' # -# Created: Wed Jul 30 11:43:40 2008 +# Created: Thu Jul 31 18:26:22 2008 # by: PyQt4 UI code generator 4.4.3-snapshot-20080705 # # WARNING! All changes made in this file will be lost! @@ -15,43 +15,43 @@ DlgSingleAppError.resize(410, 277) self.gridLayout = QtGui.QGridLayout(DlgSingleAppError) self.gridLayout.setObjectName("gridLayout") + self.line = QtGui.QFrame(DlgSingleAppError) + self.line.setFrameShape(QtGui.QFrame.HLine) + self.line.setFrameShadow(QtGui.QFrame.Sunken) + self.line.setObjectName("line") + self.gridLayout.addWidget(self.line, 1, 0, 1, 1) + self.buttonBox = QtGui.QDialogButtonBox(DlgSingleAppError) + self.buttonBox.setOrientation(QtCore.Qt.Horizontal) + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) + self.buttonBox.setObjectName("buttonBox") + self.gridLayout.addWidget(self.buttonBox, 2, 0, 1, 1) self.splitter = QtGui.QSplitter(DlgSingleAppError) self.splitter.setOrientation(QtCore.Qt.Horizontal) self.splitter.setObjectName("splitter") self.textEdit = QtGui.QTextEdit(self.splitter) self.textEdit.setObjectName("textEdit") - self.widget = QtGui.QWidget(self.splitter) - self.widget.setObjectName("widget") - self.verticalLayout_2 = QtGui.QVBoxLayout(self.widget) + self.layoutWidget = QtGui.QWidget(self.splitter) + self.layoutWidget.setObjectName("layoutWidget") + self.verticalLayout_2 = QtGui.QVBoxLayout(self.layoutWidget) self.verticalLayout_2.setObjectName("verticalLayout_2") self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") - self.label = QtGui.QLabel(self.widget) - self.label.setObjectName("label") - self.verticalLayout.addWidget(self.label) - self.edHost = QtGui.QLineEdit(self.widget) + self.fieldName = QtGui.QLabel(self.layoutWidget) + self.fieldName.setObjectName("fieldName") + self.verticalLayout.addWidget(self.fieldName) + self.edHost = QtGui.QLineEdit(self.layoutWidget) self.edHost.setObjectName("edHost") self.verticalLayout.addWidget(self.edHost) - self.label_3 = QtGui.QLabel(self.widget) - self.label_3.setObjectName("label_3") - self.verticalLayout.addWidget(self.label_3) - self.spinPort = QtGui.QSpinBox(self.widget) + self.fieldName_2 = QtGui.QLabel(self.layoutWidget) + self.fieldName_2.setObjectName("fieldName_2") + self.verticalLayout.addWidget(self.fieldName_2) + self.spinPort = QtGui.QSpinBox(self.layoutWidget) self.spinPort.setObjectName("spinPort") self.verticalLayout.addWidget(self.spinPort) self.verticalLayout_2.addLayout(self.verticalLayout) spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.verticalLayout_2.addItem(spacerItem) self.gridLayout.addWidget(self.splitter, 0, 0, 1, 1) - self.line = QtGui.QFrame(DlgSingleAppError) - self.line.setFrameShape(QtGui.QFrame.HLine) - self.line.setFrameShadow(QtGui.QFrame.Sunken) - self.line.setObjectName("line") - self.gridLayout.addWidget(self.line, 1, 0, 1, 1) - self.buttonBox = QtGui.QDialogButtonBox(DlgSingleAppError) - self.buttonBox.setOrientation(QtCore.Qt.Horizontal) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) - self.buttonBox.setObjectName("buttonBox") - self.gridLayout.addWidget(self.buttonBox, 2, 0, 1, 1) self.retranslateUi(DlgSingleAppError) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), DlgSingleAppError.accept) @@ -60,8 +60,8 @@ def retranslateUi(self, DlgSingleAppError): DlgSingleAppError.setWindowTitle(QtGui.QApplication.translate("DlgSingleAppError", "Dialog", None, QtGui.QApplication.UnicodeUTF8)) - self.label.setText(QtGui.QApplication.translate("DlgSingleAppError", "<b>Host: </b>", None, QtGui.QApplication.UnicodeUTF8)) - self.label_3.setText(QtGui.QApplication.translate("DlgSingleAppError", "<b>Port: </b>", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldName.setText(QtGui.QApplication.translate("DlgSingleAppError", "Host: ", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldName_2.setText(QtGui.QApplication.translate("DlgSingleAppError", "Port: ", None, QtGui.QApplication.UnicodeUTF8)) if __name__ == "__main__": Modified: trunk/fclient/src/fclient/impl/tpls/Ui_PrefsSingleAppTpl.py =================================================================== --- trunk/fclient/src/fclient/impl/tpls/Ui_PrefsSingleAppTpl.py 2008-07-31 16:41:55 UTC (rev 832) +++ trunk/fclient/src/fclient/impl/tpls/Ui_PrefsSingleAppTpl.py 2008-07-31 16:42:53 UTC (rev 833) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/impl/tpls/PrefsSingleAppTpl.ui' # -# Created: Wed Jul 30 12:28:11 2008 +# Created: Thu Jul 31 18:28:07 2008 # by: PyQt4 UI code generator 4.4.3-snapshot-20080705 # # WARNING! All changes made in this file will be lost! @@ -23,15 +23,15 @@ self.gridLayout.addWidget(self.label, 0, 0, 1, 2) self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") - self.label_2 = QtGui.QLabel(PrefsSingleApp) - self.label_2.setObjectName("label_2") - self.verticalLayout.addWidget(self.label_2) + self.fieldName = QtGui.QLabel(PrefsSingleApp) + self.fieldName.setObjectName("fieldName") + self.verticalLayout.addWidget(self.fieldName) self.edHost = QtGui.QLineEdit(PrefsSingleApp) self.edHost.setObjectName("edHost") self.verticalLayout.addWidget(self.edHost) - self.label_3 = QtGui.QLabel(PrefsSingleApp) - self.label_3.setObjectName("label_3") - self.verticalLayout.addWidget(self.label_3) + self.fieldName_2 = QtGui.QLabel(PrefsSingleApp) + self.fieldName_2.setObjectName("fieldName_2") + self.verticalLayout.addWidget(self.fieldName_2) self.spinPort = QtGui.QSpinBox(PrefsSingleApp) self.spinPort.setObjectName("spinPort") self.verticalLayout.addWidget(self.spinPort) @@ -47,8 +47,8 @@ def retranslateUi(self, PrefsSingleApp): PrefsSingleApp.setWindowTitle(QtGui.QApplication.translate("PrefsSingleApp", "Form", None, QtGui.QApplication.UnicodeUTF8)) self.label.setText(QtGui.QApplication.translate("PrefsSingleApp", "The gui uses a socket connection to enshure only one instance is running at a time. Use the boxes below to adjust host and port of the connection to your needs.", None, QtGui.QApplication.UnicodeUTF8)) - self.label_2.setText(QtGui.QApplication.translate("PrefsSingleApp", "<b>Single application host: </b>", None, QtGui.QApplication.UnicodeUTF8)) - self.label_3.setText(QtGui.QApplication.translate("PrefsSingleApp", "<b>Single application port: </b>", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldName.setText(QtGui.QApplication.translate("PrefsSingleApp", "Single application host: ", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldName_2.setText(QtGui.QApplication.translate("PrefsSingleApp", "Single application port: ", None, QtGui.QApplication.UnicodeUTF8)) if __name__ == "__main__": This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-31 16:41:46
|
Revision: 832 http://fclient.svn.sourceforge.net/fclient/?rev=832&view=rev Author: jUrner Date: 2008-07-31 16:41:55 +0000 (Thu, 31 Jul 2008) Log Message: ----------- methods no longer return requestIdentifier. instead return request directly Modified Paths: -------------- trunk/fclient/src/fclient/impl/lib/fcp2/client.py trunk/fclient/src/fclient/impl/lib/fcp2/test/test_client.py Modified: trunk/fclient/src/fclient/impl/lib/fcp2/client.py =================================================================== --- trunk/fclient/src/fclient/impl/lib/fcp2/client.py 2008-07-31 16:40:52 UTC (rev 831) +++ trunk/fclient/src/fclient/impl/lib/fcp2/client.py 2008-07-31 16:41:55 UTC (rev 832) @@ -144,9 +144,17 @@ # #FIX: at least some are implemented in the client #-------------------------------------------------------------------------------------------------------------------------------------------------- +# [0002483: PersistentGet never arrives] +# +# Client.GetkeyInfo() is most likely not a good idea. from my observations requests are flagged +# in downloads.dat wether they are successful or not. looks like an unsuccessful Client.GetkeyInfo(), +# even though failure is intended, will mark dls as Succeded=false in downloads.dat with unwanted +# side effects +# +# FIX none, drop Client.GetkeyInfo()? +#------------------------------------------------------------------------------------------------------------------------------------------------- - # Todos #------------------------------------------------------------------------------------------------------------------------------------------------ # clean up @@ -817,7 +825,7 @@ initialRequest['RequestStatus'] |= consts.ConstRequestStatus.Success initialRequest['MetadataContentType'] = msg.get('Metadata.ContentType', '') - initialRequest['MetadataSize'] = msg.get('DataLength', '') + initialRequest['MetadataSize'] = msg.get('DataLength', 0) initialRequest['ProgressSucceeeded'] = initialRequest['ProgressRequired'] # except from GetData all requests are complete here. Next GetData will run through AllData... @@ -866,7 +874,7 @@ # check if it is one of our requests for key information if code == consts.ConstFetchError.TooBig and initialRequest['IsGetKeyInfo']: initialRequest['MetadataContentType'] = msg.get('ExpectedMetadata.ContentType', '') - initialRequest['DataLength'] = msg.get('ExpectedDataLength', -1) + initialRequest['MetadataSize'] = msg.get('ExpectedDataLength', 0) initialRequest['RequestStatus'] |= consts.ConstRequestStatus.Success self._finalizeRequest(msg, initialRequest, self.events.RequestCompleted) return True @@ -1295,7 +1303,7 @@ @param handlePermanentRedirect: (bool) if True, permanent redirect are handled automatically. for example USK@.../-1 will look for the current edition. if handlePermanentRedirect is True, the request is automatically resend to retrieve the current edition - @return: (str) request identifier + @return: request @event: L{events.Events.RequestCompleted} triggered as soon as the request is complete @event: L{events.Events.RequestFailed} triggered if the request failes @@ -1330,7 +1338,7 @@ userData=userData, ) self.sendMessage(msg) - return msg['Identifier'] + return msg def getFile(self, @@ -1408,7 +1416,7 @@ userData=userData, ) self.sendMessage(msg) - return msg['Identifier'] + return msg def getKeyInfo(self, @@ -1438,7 +1446,7 @@ @param handlePermanentRedirect: (bool) if True, permanent redirect are handled automatically. for example USK@.../-1 will look for the current edition. if handlePermanentRedirect is True, the request is automatically resend to retrieve the current edition - @return: (str) request identifier + @return: request @event: RequestCompleted(event, message) triggered when the request is complete @event: RequestFailed(event, message) triggered when the request failes @@ -1474,14 +1482,14 @@ userData=userData, ) self.sendMessage(msg) - return msg['Identifier'] + return msg def subscribeUSK(self, uri, dontPoll=True): """Asks the node to notify the client when an USK is updated @param uri: (L{key.KeyUSK}) key to subscribe to @param dontPoll: if True, does whatever ??? - @return: (str) identifer of the request + @return: request @note: this request can not be removed or modified so the L{consts.ConstRequestStatus.Completed} flag is always set @@ -1492,10 +1500,10 @@ URI=uri, DontPoll=dontPoll, ) - self.registerRequest(msg, consts.ConstRequestType.SubscribeUSK) + self.registerRequest(msg) msg['RequestStatus'] |= consts.ConstRequestStatus.Completed self.sendMessage(msg) - return msg['Identifier'] + return msg ######################################################## @@ -1529,11 +1537,14 @@ @param userData: any non persistent data to associate to the request @param persistentUserData: any string to associate to the request as persistent data + @return: request + @event: (L{events.Events.RequestCompleted}) triggered when the request is complete @event: (L{events.Events.RequestFailed}) triggered when the request failes @event: (L{events.Events.RequestFetchable}) triggered as soon as the request is fetchable @event: (L{events.Events.RequestCompressionStarted}) triggered when the request is about to be compressed @event: (L{events.Events.RequestCompressionCompleted}) triggered as soon as compressing of the request is completed + @note: if the upload is successful the node will create a L{consts.ConstKeyType.CHK} key under wich the data can be retreieved. The key can be accessed as 'URI' member of the request as soon @@ -1579,7 +1590,7 @@ userData=userData, ) self.sendMessage(msg) - return msg['Identifier'] + return msg def putDir(self, @@ -1606,6 +1617,8 @@ if it encounters an unreadavle file @param defaultName: name of the directory item that should be displayed when accessing the directory without any filename appended to the uri + + @return: request @note: for other params see L{putData} @note: once uploaded, items of the directory can be accessed under Key/MyItemName/MyItemSubname @@ -1651,7 +1664,7 @@ userData=userData, ) self.sendMessage(msg) - return msg['Identifier'] + return msg def putFile(self, @@ -1670,6 +1683,7 @@ """Uploads a file @param uri: (L{key._KeyBase}) key under wich to upload the file @param filename: (str) file to upload + @return: request @note: for other params see L{putData} @@ -1711,7 +1725,7 @@ userData=userData, ) self.sendMessage(msg) - return msg['Identifier'] + return msg def putMultiple(self, @@ -1732,6 +1746,7 @@ @param uri: (L{key._KeyBase}) key under wich to upload the file @param items: (list) list of items to upload + @return: request @note: for other params see L{putDir} @note: to upload multiple items at once pass a dict for each item containig the following members: @@ -1847,7 +1862,7 @@ userData=userData, ) self.sendMessage(msg) - return msg['Identifier'] + return msg def putRedirect(self, @@ -1867,7 +1882,7 @@ @param priorityClass: (L{consts.ConstPriority}) priority of the request @param persistentUserData: (str) persistent data to be assosiated to the request @param userData: (any) any data to be associated to the request at runtime - @return: (str) request identifier + @return: request """ # if uri.KeyType == consts.ConstKeyType.CHK: @@ -1902,7 +1917,7 @@ userData=userData, ) self.sendMessage(msg) - return msg['Identifier'] + return msg ######################################################## ## @@ -1924,9 +1939,9 @@ return self._requests - def modifyRequest(self, requestIdentifier, persistentUserData=None, priorityClass=None): + def modifyRequest(self, request, persistentUserData=None, priorityClass=None): """Modifies a request - @param requestIdentifier: identifier of the request to modify + @param request: request to modify @param persistentUserData: (str) persistent user data or None @param priorityClass: (L{consts.ConstPriority}) new priority or None @@ -1939,65 +1954,63 @@ @todo: currently we ignore any attempts to change priority class for requests with persistence == connection Fcp does not provide means to do so. """ - initialRequest = self._requests[requestIdentifier] - if not initialRequest == message.MsgClientGet or \ - initialRequest == message.MsgClientPut or \ - initialRequest == message.MsgClientPutDiskDir or \ - initialRequest == message.MsgClientPutComplexDir: - raise ValueError('Can not modify request: %s' % initialRequest.name) + if not request == message.MsgClientGet or \ + request == message.MsgClientPut or \ + request == message.MsgClientPutDiskDir or \ + request == message.MsgClientPutComplexDir: + raise ValueError('Can not modify request: %s' % request.name) #FIX: [0002083] # no way to change priority for non-persistent requests..this is simply not implemented in the protocol # persistentUserData is ok, priority can not be changed. no idea how to handle this. - if initialRequest['Persistence'] == consts.ConstPersistence.Connection: + if request['Persistence'] == consts.ConstPersistence.Connection: modified = {} #if priorityClass is not None: # raise ValueError('Can not modify priority of requests with Persistence=connection') if persistentUserData is not None: - initialRequest['PersistentUserData'] = persistentUserData - initialRequest['ClientToken'] = initialRequest.updatePersistentParams() + request['PersistentUserData'] = persistentUserData + request['ClientToken'] = request.updatePersistentParams() modified[consts.ConstRequestModified.PersistentUserData] = None - initialRequest['Modified'] = modified - self.events.RequestModified(initialRequest) + request['Modified'] = modified + self.events.RequestModified(request) return #/FIX: [0002083] msg = message.MsgModifyPersistentRequest( - Identifier=initialRequest['Identifier'], + Identifier=request['Identifier'], Global=False, ) if persistentUserData is not None: - oldClientToken = initialRequest['ClientToken'] - initialRequest['PersistentUserData'] = persistentUserData - initialRequest.updatePersistentParams() - msg['ClientToken'] = initialRequest['ClientToken'] - initialRequest['ClientToken'] = oldClientToken + oldClientToken = request['ClientToken'] + request['PersistentUserData'] = persistentUserData + request.updatePersistentParams() + msg['ClientToken'] = request['ClientToken'] + request['ClientToken'] = oldClientToken if priorityClass is not None: msg['PriorityClass'] = priorityClass self.sendMessage(msg) - def removeRequest(self, requestIdentifier): + def removeRequest(self, request): """Removes a request - @param requestIdentifier: (str) identifier of the request to remove + @param request: request to remove """ - initialRequest = self._requests[requestIdentifier] - initialRequest['RequestStatus'] |= consts.ConstRequestStatus.Removed | consts.ConstRequestStatus.Completed - if initialRequest == message.MsgClientGet or \ - initialRequest == message.MsgClientPut or \ - initialRequest == message.MsgClientPutDiskDir or \ - initialRequest == message.MsgClientPutComplexDir: + request['RequestStatus'] |= consts.ConstRequestStatus.Removed | consts.ConstRequestStatus.Completed + if request == message.MsgClientGet or \ + request == message.MsgClientPut or \ + request == message.MsgClientPutDiskDir or \ + request == message.MsgClientPutComplexDir: self.sendMessage( message.MsgRemoveRequest( Global=False, - Identifier=requestIdentifier, + Identifier=request['Identifier'], ) ) else: - del self._requests[requestIdentifier] + del self._requests[request['Identifier']] ######################################################## ## @@ -2123,7 +2136,7 @@ """Requests information about a plugin @param pluginName: (str) name of the plugin to request info for @param detailed: (bool) If True, detailed information is returned - @return: (str) request identifier + @return: request """ msg = message.MsgGetPluginInfo( PluginName=pluginName, @@ -2131,7 +2144,7 @@ ) self.registerRequest(msg) self.sendMessage(msg) - return msg['Identifier'] + return msg def sendPluginMessage(self, pluginName, identifier, params, data=None): @@ -2170,7 +2183,7 @@ """Generates a public / private keypair @param keyPairType: type of keypair to generate (either L{consts.ConstKeyType.SSK} or L{consts.ConstKeyType.SSK}) - @return: identifier of the request + @return: request @event: L{events.Events.KeypairGenerated} triggered as soon as the request is complete """ @@ -2179,6 +2192,6 @@ msg = message.MsgGenerateSSK(KeyPairType=keyPairType) self.registerRequest(msg) self.sendMessage(msg) - return msg['Identifier'] + return msg Modified: trunk/fclient/src/fclient/impl/lib/fcp2/test/test_client.py =================================================================== --- trunk/fclient/src/fclient/impl/lib/fcp2/test/test_client.py 2008-07-31 16:40:52 UTC (rev 831) +++ trunk/fclient/src/fclient/impl/lib/fcp2/test/test_client.py 2008-07-31 16:41:55 UTC (rev 832) @@ -879,16 +879,15 @@ def test_100_request_registered(self): self.connectClient() myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getData(myKey) + myRequest = self.client.getData(myKey) requestsAll = self.client.getRequests() - self.failUnless(myIdentifier in requestsAll) - myRequest = self.client.getRequest(myIdentifier) - + self.failUnless(myRequest['Identifier'] in requestsAll) + def test_300_message_send(self): self.connectClient() myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getData(myKey) + myRequest = self.client.getData(myKey) requestsAll = self.client.getRequests() self.assertHasNextMessage( @@ -905,13 +904,13 @@ self.connectClient() myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getData(myKey) + myRequest = self.client.getData(myKey) requestsAll = self.client.getRequests() self.assertHasNextMessage(fcp2.MsgClientGet) self.sendResponseMessage( 'SimpleProgress', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], Total=0, Required=0, Failed=0, @@ -933,13 +932,13 @@ self.connectClient() myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getData(myKey) + myRequest = self.client.getData(myKey) requestsAll = self.client.getRequests() self.assertHasNextMessage(fcp2.MsgClientGet) data = 'foo' params = { - 'Identifier': myIdentifier, + 'Identifier': myRequest, 'Global': 'false', 'DataLength': len(data), 'Metadata.ContentType': 'any', @@ -953,7 +952,7 @@ self.sendResponseMessage( 'AllData', data=data, - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], Global='false', DataLength=len(data), ) @@ -970,7 +969,7 @@ ) # non persistent requests are removed emidiately - self.failIf(myIdentifier in requestsAll) + self.failIf(myRequest in requestsAll) self.assertHasNextEvent(None) self.assertHasNextMessage(None) @@ -980,14 +979,14 @@ def test_600_completed_with_error(self): self.connectClient() myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getData(myKey) + myRequest = self.client.getData(myKey) requestsAll = self.client.getRequests() self.assertHasNextMessage(fcp2.MsgClientGet) self.sendResponseMessage( fcp2.MsgGetFailed.name, Code='28', # All data not found - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], Global='false', # blah.. more here ) @@ -1001,7 +1000,7 @@ ) # non persistent requests are removed emidiately - self.failIf(myIdentifier in requestsAll) + self.failIf(myRequest in requestsAll) self.assertHasNextEvent(None) self.assertHasNextMessage(None) @@ -1012,14 +1011,14 @@ self.connectClient() myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getData(myKey, persistence=fcp2.ConstPersistence.Forever) + myRequest = self.client.getData(myKey, persistence=fcp2.ConstPersistence.Forever) requestsAll = self.client.getRequests() self.assertHasNextMessage(fcp2.MsgClientGet) data = 'foo' params = { - 'Identifier': myIdentifier, + 'Identifier': myRequest['Identifier'], 'Global': 'false', 'DataLength': len(data), 'Metadata.ContentType': 'any', @@ -1040,7 +1039,7 @@ def test_800_peristent_request_not_removed_on_success(self): self.connectClient() myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getData(myKey, persistence=fcp2.ConstPersistence.Forever) + myRequest = self.client.getData(myKey, persistence=fcp2.ConstPersistence.Forever) requestsAll = self.client.getRequests() self.assertHasNextMessage(fcp2.MsgClientGet) @@ -1048,7 +1047,7 @@ self.sendResponseMessage( 'AllData', data=data, - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], Global='false', DataLength=len(data), ) @@ -1056,7 +1055,7 @@ self.assertHasNextEvent(self.client.events.RequestCompleted) # persistent requests are not removed emidiately - self.failUnless(myIdentifier in requestsAll) + self.failUnless(myRequest['Identifier'] in requestsAll) self.assertHasNextEvent(None) self.assertHasNextMessage(None) @@ -1066,14 +1065,14 @@ def test_900_peristent_request_not_removed_on_error(self): self.connectClient() myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getData(myKey, persistence=fcp2.ConstPersistence.Forever) + myRequest = self.client.getData(myKey, persistence=fcp2.ConstPersistence.Forever) requestsAll = self.client.getRequests() self.assertHasNextMessage(fcp2.MsgClientGet) self.sendResponseMessage( 'GetFailed', Code='28', # All data not found - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], Global='false', # blah.. more here ) @@ -1081,7 +1080,7 @@ self.assertHasNextEvent(self.client.events.RequestFailed) # persistent requests are not removed emidiately - self.failUnless(myIdentifier in requestsAll) + self.failUnless(myRequest['Identifier'] in requestsAll) self.assertHasNextEvent(None) self.assertHasNextMessage(None) @@ -1091,38 +1090,36 @@ def test_910_restore_peristent_request_failure(self): self.connectClient() requestsAll = self.client.getRequests() - myIdentifier = '123456789' + myRequest = '123456789' self.sendResponseMessage( 'PersistentGet', - Identifier=myIdentifier, + Identifier=myRequest, ClientToken='i-am-invalid', Global='false', callNext=False ) self.assertRaises(fcp2.ErrorMessageParse, self.client.next) - self.failIf(myIdentifier in requestsAll) + self.failIf(myRequest in requestsAll) def test_920_restore_peristent_request_success(self): self.connectClient() requestsAll = self.client.getRequests() myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getData(myKey, persistence=fcp2.ConstPersistence.Forever) - self.failUnless(myIdentifier in requestsAll) - myRequest = self.client.getRequest(myIdentifier) - del requestsAll[myIdentifier] + myRequest = self.client.getData(myKey, persistence=fcp2.ConstPersistence.Forever) + self.failUnless(myRequest['Identifier'] in requestsAll) + del requestsAll[myRequest['Identifier']] self.sendResponseMessage( 'PersistentGet', **myRequest.params ) - self.failUnless(myIdentifier in requestsAll) - myRequest = self.client.getRequest(myIdentifier) + self.failUnless(myRequest['Identifier'] in requestsAll) msg = self.assertHasNextEvent( self.client.events.RequestStarted, fcp2.MsgClientGet, - ('Identifier', myIdentifier), + ('Identifier', myRequest['Identifier']), ('RequestStatus', fcp2.ConstRequestStatus.Restored), # no RequestStatus.Pending flag should be set here ) @@ -1136,34 +1133,32 @@ def test_100_request_registered(self): self.connectClient() myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getFile(myKey, 'foo.txt') + myRequest = self.client.getFile(myKey, 'foo.txt') requestsAll = self.client.getRequests() - self.failUnless(myIdentifier in requestsAll) - myRequest = self.client.getRequest(myIdentifier) - + self.failUnless(myRequest['Identifier'] in requestsAll) + def test_200_key_object_is_accepted(self): self.connectClient() myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getFile(myKey, 'foo.txt') + myRequest = self.client.getFile(myKey, 'foo.txt') requestsAll = self.client.getRequests() def test_300_dda_denied(self): self.connectClient() myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getFile( + myRequest = self.client.getFile( myKey, os.path.join(DIR, 'DDATest.txt') ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() self.assertHasNextMessage(fcp2.MsgClientGet) self.sendResponseMessage( 'ProtocolError', Code=25, # DDADenied - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], ExtraDescription='An error occured', Fatal='false', Global='false', @@ -1220,7 +1215,7 @@ **msg.params ) - self.failUnless(myIdentifier in requestsAll) + self.failUnless(myRequest ['Identifier']in requestsAll) self.assertHasNextEvent(self.client.events.RequestStarted) self.assertHasNextMessage(None) @@ -1236,32 +1231,30 @@ def test_100_request_registered(self): self.connectClient() myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getKeyInfo(myKey) + myRequest = self.client.getKeyInfo(myKey) requestsAll = self.client.getRequests() - self.failUnless(myIdentifier in requestsAll) - myRequest = self.client.getRequest(myIdentifier) - + self.failUnless(myRequest['Identifier'] in requestsAll) + def test_200_key_object_is_accepted(self): self.connectClient() myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getKeyInfo(myKey) + myRequest = self.client.getKeyInfo(myKey) requestsAll = self.client.getRequests() def test_300_getKeyInfo_Success(self): self.connectClient() myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getKeyInfo(myKey) - myRequest = self.client.getRequest(myIdentifier) + myRequest = self.client.getKeyInfo(myKey) requestsAll = self.client.getRequests() self.assertHasNextMessage(fcp2.MsgClientGet) data = 'foo' params = { - 'Identifier': myIdentifier, + 'Identifier': myRequest['Identifier'], 'Global': 'false', 'DataLength': 123456, 'Metadata.ContentType': 'any', @@ -1278,7 +1271,7 @@ fcp2.ConstRequestStatus.Completed ), ) - self.failIf(myIdentifier in requestsAll) + self.failIf(myRequest in requestsAll) self.assertHasNextEvent(None) self.assertHasNextMessage(None) self.failUnless(self.ioOpen()) @@ -1290,15 +1283,14 @@ # test specdial case where ProtocolError.TooBig is handled as success # request a arbitrary uri myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getKeyInfo(myKey) - myRequest = self.client.getRequest(myIdentifier) + myRequest = self.client.getKeyInfo(myKey) requestsAll = self.client.getRequests() self.assertHasNextMessage(fcp2.MsgClientGet) self.sendResponseMessage( 'GetFailed', Code='21', # Too big - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], Global='false', # blah.. more here ) @@ -1310,7 +1302,7 @@ fcp2.ConstRequestStatus.Completed ), ) - self.failIf(myIdentifier in requestsAll) + self.failIf(myRequest in requestsAll) self.assertHasNextEvent(None) self.assertHasNextMessage(None) self.failUnless(self.ioOpen()) @@ -1321,15 +1313,14 @@ # request a arbitrary file myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getKeyInfo(myKey) - myRequest = self.client.getRequest(myIdentifier) + myRequest = self.client.getKeyInfo(myKey) requestsAll = self.client.getRequests() self.assertHasNextMessage(fcp2.MsgClientGet) self.sendResponseMessage( 'GetFailed', Code='28', # All data not found - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], Global='false', # blah.. more here ) @@ -1341,7 +1332,7 @@ fcp2.ConstRequestStatus.Completed ), ) - self.failIf(myIdentifier in requestsAll) + self.failIf(myRequest in requestsAll) self.assertHasNextEvent(None) self.assertHasNextMessage(None) self.failUnless(self.ioOpen()) @@ -1488,19 +1479,17 @@ self.connectClient() myKey = fcp2.KeyKSK('foo') - myIdentifier = self.client.putData( + myRequest = self.client.putData( myKey, 'any data here' ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() - self.assertHasNextMessage(fcp2.MsgClientPut) - self.failUnless(myIdentifier in requestsAll) + self.failUnless(myRequest['Identifier'] in requestsAll) self.sendResponseMessage( 'PutSuccessful', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], URI=myKey ) @@ -1522,20 +1511,18 @@ self.connectClient() myKey = fcp2.KeyKSK('foo') - myIdentifier = self.client.putData( + myRequest = self.client.putData( myKey, 'any data here' ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() - self.assertHasNextMessage(fcp2.MsgClientPut) - self.failUnless(myIdentifier in requestsAll) + self.failUnless(myRequest['Identifier'] in requestsAll) self.sendResponseMessage( 'PutFailed', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], Code='5', # rout not found ) @@ -1561,19 +1548,17 @@ self.connectClient() myKey = fcp2.KeyKSK('foo') - myIdentifier = self.client.putDir( + myRequest = self.client.putDir( myKey, 'myDirectory' ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() - self.assertHasNextMessage(fcp2.MsgClientPutDiskDir) - self.failUnless(myIdentifier in requestsAll) + self.failUnless(myRequest['Identifier'] in requestsAll) self.sendResponseMessage( 'PutSuccessful', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], URI=myKey ) @@ -1595,19 +1580,18 @@ self.connectClient() myKey = fcp2.KeyKSK('foo') - myIdentifier = self.client.putDir( + myRequest = self.client.putDir( myKey, 'myDirectory' ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() self.assertHasNextMessage(fcp2.MsgClientPutDiskDir) - self.failUnless(myIdentifier in requestsAll) + self.failUnless(myRequest['Identifier'] in requestsAll) self.sendResponseMessage( 'PutFailed', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], Code='5', # rout not found ) @@ -1633,19 +1617,17 @@ self.connectClient() myKey = fcp2.KeyKSK('foo') - myIdentifier = self.client.putFile( + myRequest = self.client.putFile( myKey, 'myFile.txt' ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() - self.assertHasNextMessage(fcp2.MsgClientPut) - self.failUnless(myIdentifier in requestsAll) + self.failUnless(myRequest['Identifier'] in requestsAll) self.sendResponseMessage( 'PutSuccessful', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], URI=myKey ) @@ -1667,19 +1649,17 @@ self.connectClient() myKey = fcp2.KeyKSK('foo') - myIdentifier = self.client.putFile( + myRequest = self.client.putFile( myKey, 'myFile.txt' ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() - self.assertHasNextMessage(fcp2.MsgClientPut) - self.failUnless(myIdentifier in requestsAll) + self.failUnless(myRequest['Identifier'] in requestsAll) self.sendResponseMessage( 'PutFailed', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], Code='5', # rout not found ) @@ -1728,11 +1708,10 @@ # request a arbitrary file myKey = fcp2.KeyKSK('foo') - myIdentifier = self.client.putMultiple( + myRequest = self.client.putMultiple( myKey, items ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() msg = self.assertHasNextMessage( @@ -1759,11 +1738,11 @@ #for k, v in sorted(msg.params.items()): # print k, v - self.failUnless(myIdentifier in requestsAll) + self.failUnless(myRequest['Identifier'] in requestsAll) self.sendResponseMessage( 'PutSuccessful', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], URI=myKey ) @@ -1821,19 +1800,18 @@ # request a arbitrary file myRedirect = fcp2.KeyKSK('foo') myKey = fcp2.Key('CHK@' + DummyKeyData) - myIdentifier = self.client.putRedirect( + myRequest = self.client.putRedirect( myRedirect, myKey, ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() self.assertHasNextMessage(fcp2.MsgClientPut) - self.failUnless(myIdentifier in requestsAll) + self.failUnless(myRequest['Identifier'] in requestsAll) self.sendResponseMessage( 'PutSuccessful', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], URI=myRedirect ) @@ -1857,19 +1835,18 @@ # request a arbitrary file myRedirect = fcp2.KeyKSK('foo') myKey = fcp2.Key('CHK@' + DummyKeyData) - myIdentifier = self.client.putRedirect( + myRequest = self.client.putRedirect( myRedirect, myKey, ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() self.assertHasNextMessage(fcp2.MsgClientPut) - self.failUnless(myIdentifier in requestsAll) + self.failUnless(myRequest['Identifier'] in requestsAll) self.sendResponseMessage( 'PutFailed', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], Code='5', # rout not found ) @@ -1897,14 +1874,13 @@ # request a arbitrary file myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getFile( + myRequest = self.client.getFile( myKey, 'arbitryry.txt', persistentUserData='foo', priorityClass=fcp2.ConstPriority.Medium, persistence=fcp2.ConstPersistence.Reboot, ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() self.assertHasNextMessage(fcp2.MsgClientGet) @@ -1919,7 +1895,7 @@ # test modify persistent user data - self.client.modifyRequest(myIdentifier, persistentUserData='bar', priorityClass=fcp2.ConstPriority.High) + self.client.modifyRequest(myRequest, persistentUserData='bar', priorityClass=fcp2.ConstPriority.High) msg = self.assertHasNextMessage(fcp2.MsgModifyPersistentRequest) # respond to the file request @@ -1937,7 +1913,7 @@ self.assertHasNextEvent(None) self.assertHasNextMessage(None) - del requestsAll[myIdentifier] + del requestsAll[myRequest['Identifier']] self.failIf(requestsAll) @@ -1946,13 +1922,12 @@ # request a arbitrary file myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getFile( + myRequest = self.client.getFile( myKey, 'arbitryry.txt', persistentUserData='foo', priorityClass=fcp2.ConstPriority.Medium, ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() self.assertHasNextMessage(fcp2.MsgClientGet) @@ -1966,7 +1941,7 @@ self.assertHasNextEvent(self.client.events.RequestStarted) # test modify persistent user data - self.client.modifyRequest(myIdentifier, persistentUserData='bar', priorityClass=fcp2.ConstPriority.High) + self.client.modifyRequest(myRequest, persistentUserData='bar', priorityClass=fcp2.ConstPriority.High) # no way to modify priority in Fcp. The client ignores all attempts to do so currently # no message is send,instead the event is triggered emidiately @@ -1988,7 +1963,7 @@ self.assertHasNextEvent(None) self.assertHasNextMessage(None) - del requestsAll[myIdentifier] + del requestsAll[myRequest['Identifier']] self.failIf(requestsAll) #*********************************************************************************** # @@ -2000,11 +1975,10 @@ # request a file myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getFile( + myRequest = self.client.getFile( myKey, 'arbitrary.txt' ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() self.assertHasNextMessage(fcp2.MsgClientGet) @@ -2020,7 +1994,7 @@ self.messages = [] # now cancel request - self.client.removeRequest(myIdentifier) + self.client.removeRequest(myRequest) self.assertHasNextMessage(fcp2.MsgRemoveRequest) # of our request should be marked as removed @@ -2032,7 +2006,7 @@ self.sendResponseMessage( 'GetFailed', Code='25', # fetch error canceled - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], ) @@ -2045,7 +2019,7 @@ fcp2.ConstRequestStatus.Completed ), ) - self.failIf(myIdentifier in requestsAll) + self.failIf(myRequest in requestsAll) self.assertHasNextEvent(None) self.assertHasNextMessage(None) @@ -2061,12 +2035,12 @@ self.connectClient() # throw an invalid PersistentRequest at the client - myIdentifier = '123456789' + myRequest = '123456789' self.assertRaises( fcp2.ErrorMessageParse, self.sendResponseMessage, 'PersistentGet', - Identifier=myIdentifier, + Identifier=myRequest, Global='false', ClientToken='i-am-invalid', # me is invalid ...me! ReturnType='disk', @@ -2092,19 +2066,18 @@ # we need a valid identifier to restore a request, so hack a bit myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getFile( + myRequest = self.client.getFile( myKey, 'arbitryry.txt' ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() self.assertHasNextMessage(fcp2.MsgClientGet) - self.client.removeRequest(myIdentifier) + self.client.removeRequest(myRequest) self.sendResponseMessage( 'PersistentRequestRemoved', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], ) self.assertHasNextMessage(fcp2.MsgRemoveRequest) self.assertHasNextEvent(self.client.events.RequestRemoved) @@ -2112,7 +2085,7 @@ # throw a PersistentGet at the client with the identifier we hacked self.sendResponseMessage( 'PersistentGet', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], Global='false', ReturnType='disk', Verbosity='1', @@ -2125,15 +2098,15 @@ msg = self.assertHasNextEvent( self.client.events.RequestStarted, fcp2.MsgClientGet, - ('Identifier', myIdentifier), + ('Identifier', myRequest['Identifier']), ('RequestStatus', fcp2.ConstRequestStatus.Restored), # no RequestStatus.Pending flag should be set here ) - self.failUnless(myIdentifier in requestsAll) + self.failUnless(myRequest['Identifier'] in requestsAll) self.assertHasNextEvent(None) self.assertHasNextMessage(None) - del requestsAll[myIdentifier] + del requestsAll[myRequest['Identifier']] self.failIf(requestsAll) #*********************************************************************************** @@ -2146,11 +2119,10 @@ # request a file myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getFile( + myRequest = self.client.getFile( myKey, os.path.join(DIR, 'DDATest.txt') ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() # client schould send a ClientGet @@ -2160,7 +2132,7 @@ self.sendResponseMessage( 'ProtocolError', Code=25, # DDADenied - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], ExtraDescription='An error occured', Fatal=False, Global=False, @@ -2228,11 +2200,10 @@ # request a file myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getFile( + myRequest = self.client.getFile( myKey, os.path.join(DIR, 'DDATest.txt') ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() # client schould send a ClientGet @@ -2242,7 +2213,7 @@ self.sendResponseMessage( 'ProtocolError', Code=25, # DDADenied - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], ExtraDescription='An error occured', Fatal=False, Global=False, @@ -2302,11 +2273,10 @@ # request a file myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.putFile( + myRequest = self.client.putFile( myKey, os.path.join(DIR, 'DDATest.txt') ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() # client schould send a ClientGet @@ -2316,7 +2286,7 @@ self.sendResponseMessage( 'ProtocolError', Code=25, # DDADenied - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], ExtraDescription='An error occured', Fatal=False, Global=False, @@ -2381,11 +2351,10 @@ # request a file myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.putFile( + myRequest = self.client.putFile( myKey, os.path.join(DIR, 'DDATest.txt') ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() # client schould send a ClientGet @@ -2395,7 +2364,7 @@ self.sendResponseMessage( 'ProtocolError', Code=25, # DDADenied - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], ExtraDescription='An error occured', Fatal=False, Global=False, @@ -2458,12 +2427,12 @@ # request a file myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getFile( + myRequest = self.client.getFile( myKey, os.path.join(DIR, 'test.txt') ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() + myOldIdentifier = myRequest['Identifier'] # client schould send a ClientGet self.assertHasNextMessage(fcp2.MsgClientGet) @@ -2472,7 +2441,7 @@ # respond with an IdentifierCollision self.sendResponseMessage( 'IdentifierCollision', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], ) # client schould send a new ClientGet @@ -2487,8 +2456,8 @@ self.failUnless(fcp2.ConstRequestModified.Identifier in msg['Modified']) oldIdentifier = msg['Modified'][fcp2.ConstRequestModified.Identifier] newIdentifier = msg['Identifier'] - self.assertEqual(oldIdentifier, myIdentifier) - self.assertNotEqual(newIdentifier, myIdentifier) + self.assertEqual(oldIdentifier, myOldIdentifier) + self.assertNotEqual(newIdentifier, myOldIdentifier) self.assertHasNextEvent(None) self.assertHasNextMessage(None) @@ -2506,12 +2475,11 @@ self.tmpfiles.append(fpath) myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getFile( + myRequest = self.client.getFile( myKey, fpath, handleFilenameCollision=True, ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() # client schould send a ClientGet @@ -2520,7 +2488,7 @@ # now respond with a ProtocolError self.sendResponseMessage( 'ProtocolError', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], Code='10', # disk target exists ExtraDescription='An error occured', Fatal='false', @@ -2545,7 +2513,7 @@ self.assertHasNextEvent(None) self.assertHasNextMessage(None) - del requestsAll[myIdentifier] + del requestsAll[myRequest['Identifier']] self.failIf(requestsAll) @@ -2558,12 +2526,11 @@ self.tmpfiles.append(fpath) myKey = fcp2.Key('KSK@foo') - myIdentifier = self.client.getFile( + myRequest = self.client.getFile( myKey, fpath, handleFilenameCollision=False, ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() # client schould send a ClientGet @@ -2576,7 +2543,7 @@ # now respond with a ProtocolError self.sendResponseMessage( 'ProtocolError', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], Code='10', # disk target exists ExtraDescription='An error occured', Fatal='false', @@ -2607,11 +2574,10 @@ # request a file myKey = fcp2.Key('USK@blah,blah,blah/foo/-1') - myIdentifier = self.client.getData( + myRequest = self.client.getData( myKey, handlePermanentRedirect=True, ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() # client schould send a ClientGet @@ -2620,7 +2586,7 @@ # respond with a Getfailed self.sendResponseMessage( 'GetFailed', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], Code=27, # PermanentRedirect RedirectURI=fcp2.Key('USK@blah,blah,blah/foo/99'), ) @@ -2649,11 +2615,10 @@ # request a file myKey = fcp2.Key('USK@blah,blah,blah/foo/-1') - myIdentifier = self.client.getData( + myRequest = self.client.getData( myKey, handlePermanentRedirect=False, ) - myRequest = self.client.getRequest(myIdentifier) requestsAll = self.client.getRequests() # client schould send a ClientGet @@ -2662,7 +2627,7 @@ # respond with a Getfailed self.sendResponseMessage( 'GetFailed', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], Code=27, # PermanentRedirect RedirectURI=fcp2.Key('USK@blah,blah,blah/foo/99'), ) @@ -2726,27 +2691,26 @@ def test_getPluginInfo_Success(self): self.connectClient() - myIdentifier = self.client.getPluginInfo('hi there') - myRequest = self.client.getRequest(myIdentifier) + myRequest = self.client.getPluginInfo('hi there') requestsAll = self.client.getRequests() + self.failUnless(myRequest['Identifier'] in requestsAll) - self.failUnless(myIdentifier in requestsAll) self.assertHasNextMessage( fcp2.MsgGetPluginInfo, - ('Identifier', myIdentifier), + ('Identifier', myRequest['Identifier']), ('PluginName', 'hi there'), ) self.sendResponseMessage( fcp2.MsgPluginInfo.name, PluginName='hi there', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], ) msg = self.assertHasNextEvent( self.client.events.PluginInfo, fcp2.MsgGetPluginInfo, - ('Identifier', myIdentifier), + ('Identifier', myRequest['Identifier']), ('PluginName', 'hi there'), ('RequestStatus', fcp2.ConstRequestStatus.Success | fcp2.ConstRequestStatus.RemovedFromQueue | @@ -2754,7 +2718,7 @@ ), ) - self.failIf(myIdentifier in requestsAll) + self.failIf(myRequest in requestsAll) self.failUnless(myRequest['RequestStatus'] & fcp2.ConstRequestStatus.Completed) self.assertHasNextEvent(None) @@ -2765,35 +2729,34 @@ def test_getPluginInfo_Failure(self): self.connectClient() - myIdentifier = self.client.getPluginInfo('hi there') - myRequest = self.client.getRequest(myIdentifier) + myRequest = self.client.getPluginInfo('hi there') requestsAll = self.client.getRequests() + self.failUnless(myRequest['Identifier'] in requestsAll) - self.failUnless(myIdentifier in requestsAll) self.assertHasNextMessage( fcp2.MsgGetPluginInfo, - ('Identifier', myIdentifier), + ('Identifier', myRequest['Identifier']), ('PluginName', 'hi there'), ) self.sendResponseMessage( fcp2.MsgProtocolError.name, Code=32, # No such plugin - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], ) msg = self.assertHasNextEvent( self.client.events.PluginInfoFailed, fcp2.MsgGetPluginInfo, #('PluginName', 'hi there'), - ('Identifier', myIdentifier), + ('Identifier', myRequest['Identifier']), ('RequestStatus', fcp2.ConstRequestStatus.Error | fcp2.ConstRequestStatus.RemovedFromQueue | fcp2.ConstRequestStatus.Completed ), ) - self.failIf(myIdentifier in requestsAll) + self.failIf(myRequest in requestsAll) self.failUnless(myRequest['RequestStatus'] & fcp2.ConstRequestStatus.Completed) self.assertHasNextEvent(None) @@ -2808,14 +2771,14 @@ def test_sendPluginMessage_Success(self): self.connectClient() - myIdentifier = '123456789' - myRequest = self.client.sendPluginMessage('hi there', myIdentifier, {'foo': "bar"}) + myRequest = '123456789' + myRequest = self.client.sendPluginMessage('hi there', myRequest, {'foo': "bar"}) requestsAll = self.client.getRequests() - self.failIf(myIdentifier in requestsAll) + self.failIf(myRequest in requestsAll) self.assertHasNextMessage( fcp2.MsgFCPPluginMessage, - ('Identifier', myIdentifier), + ('Identifier', myRequest['Identifier']), ('PluginName', 'hi there'), ('foo', 'bar'), ) @@ -2823,7 +2786,7 @@ self.sendResponseMessage( fcp2.MsgFCPPluginReply.name, PluginName='hi there', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], baz='12345', ) @@ -2831,7 +2794,7 @@ self.client.events.PluginMessage, fcp2.MsgFCPPluginReply, ('PluginName', 'hi there'), - ('Identifier', myIdentifier), + ('Identifier', myRequest['Identifier']), ('baz', '12345'), ) @@ -2843,14 +2806,14 @@ def test_sendPluginMessage_Failure(self): self.connectClient() - myIdentifier = '1234567889' - myRequest = self.client.sendPluginMessage('hi there', myIdentifier, {'foo': "bar"}) + myRequest = '1234567889' + myRequest = self.client.sendPluginMessage('hi there', myRequest, {'foo': "bar"}) requestsAll = self.client.getRequests() - self.failIf(myIdentifier in requestsAll) + self.failIf(myRequest['Identifier'] in requestsAll) self.assertHasNextMessage( fcp2.MsgFCPPluginMessage, - ('Identifier', myIdentifier), + ('Identifier', myRequest['Identifier']), ('PluginName', 'hi there'), ('foo', 'bar'), ) @@ -2858,16 +2821,16 @@ self.sendResponseMessage( fcp2.MsgProtocolError.name, Code=32, # No such plugin - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], ) msg = self.assertHasNextEvent( self.client.events.ProtocolError, fcp2.MsgProtocolError, - ('Identifier', myIdentifier), + ('Identifier', myRequest['Identifier']), ) - self.failIf(myIdentifier in requestsAll) + self.failIf(myRequest in requestsAll) self.assertHasNextEvent(None) self.assertHasNextMessage(None) @@ -2876,30 +2839,30 @@ def test_sendPluginMessage_Identifiercollision(self): self.connectClient() - myIdentifier = '1234567889' - myRequest = self.client.sendPluginMessage('hi there', myIdentifier, {'foo': "bar"}) + myRequest = '1234567889' + myRequest = self.client.sendPluginMessage('hi there', myRequest, {'foo': "bar"}) requestsAll = self.client.getRequests() - self.failIf(myIdentifier in requestsAll) + self.failIf(myRequest in requestsAll) self.assertHasNextMessage( fcp2.MsgFCPPluginMessage, - ('Identifier', myIdentifier), + ('Identifier', myRequest['Identifier']), ('PluginName', 'hi there'), ('foo', 'bar'), ) self.sendResponseMessage( fcp2.MsgIdentifierCollision.name, - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], ) msg = self.assertHasNextEvent( self.client.events.IdentifierCollision, fcp2.MsgIdentifierCollision, - ('Identifier', myIdentifier), + ('Identifier', myRequest['Identifier']), ) - self.failIf(myIdentifier in requestsAll) + self.failIf(myRequest in requestsAll) self.assertHasNextEvent(None) self.assertHasNextMessage(None) @@ -2913,8 +2876,7 @@ def test_10000_GeberateSSKKeypair(self): self.connectClient() - myIdentifier = self.client.generateKeypair(fcp2.ConstKeyType.SSK) - myRequest = self.client.getRequest(myIdentifier) + myRequest = self.client.generateKeypair(fcp2.ConstKeyType.SSK) requestsAll = self.client.getRequests() self.assertHasNextMessage(fcp2.MsgGenerateSSK) @@ -2922,7 +2884,7 @@ pub = fcp2.Key('SSK@' + DummyKeyData + '/') self.sendResponseMessage( 'SSKKeypair', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], RequestURI=pub, InsertURI=priv, ) @@ -2930,7 +2892,7 @@ msg = self.assertHasNextEvent( self.client.events.KeypairGenerated, fcp2.MsgGenerateSSK, - ('Identifier', myIdentifier), + ('Identifier', myRequest['Identifier']), ('RequestURI',pub), ('InsertURI',priv), ('RequestStatus', fcp2.ConstRequestStatus.Success | @@ -2938,7 +2900,7 @@ fcp2.ConstRequestStatus.Completed ), ) - self.failIf(myIdentifier in requestsAll) + self.failIf(myRequest in requestsAll) self.failUnless(myRequest['RequestStatus'] & fcp2.ConstRequestStatus.Completed) self.assertHasNextEvent(None) @@ -2949,9 +2911,7 @@ def test_10001_GeberateUSKKeypair(self): self.connectClient() - myIdentifier = self.client.generateKeypair(fcp2.ConstKeyType.USK) - - myRequest = self.client.getRequest(myIdentifier) + myRequest = self.client.generateKeypair(fcp2.ConstKeyType.USK) requestsAll = self.client.getRequests() self.assertHasNextMessage(fcp2.MsgGenerateSSK) @@ -2960,7 +2920,7 @@ self.sendResponseMessage( 'SSKKeypair', - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], RequestURI=pub, InsertURI=priv, ) @@ -2969,7 +2929,7 @@ msg = self.assertHasNextEvent( self.client.events.KeypairGenerated, fcp2.MsgGenerateSSK, - ('Identifier', myIdentifier), + ('Identifier', myRequest['Identifier']), ('RequestURI',pub), ('InsertURI',priv), ('RequestStatus', fcp2.ConstRequestStatus.Success | @@ -2977,7 +2937,7 @@ fcp2.ConstRequestStatus.Completed ), ) - self.failIf(myIdentifier in requestsAll) + self.failIf(myRequest in requestsAll) self.failUnless(myRequest['RequestStatus'] & fcp2.ConstRequestStatus.Completed) self.assertHasNextEvent(None) @@ -2993,17 +2953,15 @@ self.connectClient() myKey = fcp2.KeyUSK(DummyKeyData, 'foo', 0) - myIdentifier = self.client.subscribeUSK(myKey) - myRequest = self.client.getRequest(myIdentifier) + myRequest = self.client.subscribeUSK(myKey) requestsAll = self.client.getRequests() - self.failUnless(myIdentifier in requestsAll) - myRequest = self.client.getRequest(myIdentifier) - + self.failUnless(myRequest['Identifier'] in requestsAll) + self.assertHasNextMessage( fcp2.MsgSubscribeUSK, ('URI', myKey), ) - self.failUnless(myIdentifier in requestsAll) + self.failUnless(myRequest['Identifier'] in requestsAll) # usk update requests are permanent, so the completed flag shuld always be set myRequest['RequestStatus'] == fcp2.ConstRequestStatus.Completed @@ -3011,7 +2969,7 @@ self.sendResponseMessage( 'SubscribedUSKUpdate', Edition=99, - Identifier=myIdentifier, + Identifier=myRequest['Identifier'], URI=myKey ) @@ -3019,7 +2977,7 @@ self.client.events.USKUpdated, fcp2.MsgSubscribeUSK, ('Edition', 99), - ('Identifier', myIdentifier), + ('Identifier', myRequest['Identifier']), ('URI', myKey), ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-31 16:40:43
|
Revision: 831 http://fclient.svn.sourceforge.net/fclient/?rev=831&view=rev Author: jUrner Date: 2008-07-31 16:40:52 +0000 (Thu, 31 Jul 2008) Log Message: ----------- remove unused params Modified Paths: -------------- trunk/fclient/src/fclient/impl/lib/fcp2/message.py Modified: trunk/fclient/src/fclient/impl/lib/fcp2/message.py =================================================================== --- trunk/fclient/src/fclient/impl/lib/fcp2/message.py 2008-07-31 16:40:17 UTC (rev 830) +++ trunk/fclient/src/fclient/impl/lib/fcp2/message.py 2008-07-31 16:40:52 UTC (rev 831) @@ -269,7 +269,6 @@ } _SubscribeUSKParams = { - _PrivateParam('RequestType'): consts.ConstRequestType.Null, # identifies sub message types _PrivateParam('RequestStatus'): consts.ConstRequestStatus.Null, _PrivateParam('InitTime'): 0, # when was the request started? _PrivateParam('UserData'): None, @@ -277,7 +276,6 @@ } _PluginInfoParams = { - _PrivateParam('RequestType'): consts.ConstRequestType.Null, # identifies sub message types _PrivateParam('RequestStatus'): consts.ConstRequestStatus.Null, _PrivateParam('InitTime'): 0, # when was the request started? } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-31 16:40:08
|
Revision: 830 http://fclient.svn.sourceforge.net/fclient/?rev=830&view=rev Author: jUrner Date: 2008-07-31 16:40:17 +0000 (Thu, 31 Jul 2008) Log Message: ----------- remove unused consts Modified Paths: -------------- trunk/fclient/src/fclient/impl/lib/fcp2/consts.py Modified: trunk/fclient/src/fclient/impl/lib/fcp2/consts.py =================================================================== --- trunk/fclient/src/fclient/impl/lib/fcp2/consts.py 2008-07-31 10:29:19 UTC (rev 829) +++ trunk/fclient/src/fclient/impl/lib/fcp2/consts.py 2008-07-31 16:40:17 UTC (rev 830) @@ -460,32 +460,6 @@ Completed =0x10000000 RemovedFromQueue = 0x2000000 -class ConstRequestType(_BaseBitFlags): - """Consts indicating the type of a request""" - - Null = 0 - GetData = 0x1 - GetFile = 0x2 - GetKeyInfo = 0x4 - PutData = 0x8 - PutFile = 0x10 - PutDir = 0x20 - PutMultiple = 0x40 - PutRedirect = 0x80 - - GenerateSSKKeypair = 0x1000 - GenerateUSKKeypair = 0x2000 - - PluginInfo = 0x2000000 - PluginMessage = 0x4000000 - - SubscribeUSK = 0x10000000000 - - MaskGet = GetData | GetFile | GetKeyInfo - MaskGenerateKeypair = GenerateSSKKeypair | GenerateUSKKeypair - MaskPlugin = PluginInfo | PluginMessage - MaskPut = PutData | PutFile | PutDir | PutMultiple | PutRedirect - class ConstReturnType: Direct = 'direct' Disk = 'disk' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-31 10:29:10
|
Revision: 829 http://fclient.svn.sourceforge.net/fclient/?rev=829&view=rev Author: jUrner Date: 2008-07-31 10:29:19 +0000 (Thu, 31 Jul 2008) Log Message: ----------- not used Removed Paths: ------------- trunk/fclient/src/fclient/impl/lib/fcp2/lib/numbers.py Deleted: trunk/fclient/src/fclient/impl/lib/fcp2/lib/numbers.py =================================================================== --- trunk/fclient/src/fclient/impl/lib/fcp2/lib/numbers.py 2008-07-30 22:26:06 UTC (rev 828) +++ trunk/fclient/src/fclient/impl/lib/fcp2/lib/numbers.py 2008-07-31 10:29:19 UTC (rev 829) @@ -1,314 +0,0 @@ -"""Number crunching and others - -""" - -import re -#*************************************************************** -# -#*************************************************************** -class ByteSizeNames: - Binary = ('B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB') - Common = ('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB') - - - -def format_num_bytes(num, binary=False, names=None, format_strings=('%i%s', '%01.2f%s') ): - """Formats a number representing a number of bytes to a human readable string - @param num: (int) number to fomat - @param binary: if True conversion factor is 1024, else factor is 1000 - @param names: (tuple) names to use as suffix or None to use default names (see L{ByteSizeNames}) - @param format_strings: (tuple) format strings to be used or None to use the default formating. - The first member of the tuple is used to format bytes, the seconds anything > one kilobyte - @return: (str) formated number - - >>> format_num_bytes(100) - '100B' - - >>> format_num_bytes(1000) - '1.00KB' - - >>> format_num_bytes(1024, binary=True) - '1.00KiB' - - >>> format_num_bytes(1000, names=('W', 'X', 'Y', 'Z')) - '1.00X' - - >>> format_num_bytes(1000, format_strings=('%s%i', '%01.4f%s')) - '1.0000KB' - - """ - if binary: - factor = 1024 - if names is None: - names = ByteSizeNames.Binary - else: - factor = 1000 - if names is None: - names = ByteSizeNames.Common - - name = names[0] - if num >= factor: - num = float(num) - for tmp_name in names[1: ]: - num /= factor - name = tmp_name - if num < factor: - break - else: - return format_strings[0] % (num, name) - return format_strings[1] % (num, name) - - -NumBytesPat = re.compile('''\A (\d+ \. \d+) | (\d+)''', re.X) -def num_bytes_to_bytes(num, binary=False, names=None): - """Converts a string containing a bytes size to an integer - @param num: (str) string to convert - @param binary: if True conversion factor is 1024, else factor is 1000 - @param names: (tuple) names to use as suffix or None to use default names (see L{ByteSizeNames}) - - @return: (int) number of bytes - @note: postfixes are handled case sensitive - - >>> num_bytes_to_bytes('1000B') - 1000 - - >>> num_bytes_to_bytes('1GB') - 1000000000 - - >>> num_bytes_to_bytes('1.2KB') - 1200 - - >>> num_bytes_to_bytes('1.5678B') - 2 - - >>> num_bytes_to_bytes('1MiB', binary=True) - 1048576 - - >>> num_bytes_to_bytes('1X', names=('X', )) - 1 - - >>> num_bytes_to_bytes('foo') - Traceback (most recent call last): - ... - ValueError: No number found in input string - - >>> num_bytes_to_bytes('1foo') - Traceback (most recent call last): - ... - ValueError: Unknown size postfix - """ - if names is None: - if binary: - names = ByteSizeNames.Binary - else: - names = ByteSizeNames.Common - names = list(names) - - match = NumBytesPat.match(num) - if match is None: - raise ValueError('No number found in input string') - - isfloat, isint = match.groups() - if isfloat: - z = len(isfloat) - tmp_num = float(isfloat) - else: - z = len(isint) - tmp_num = int(isint) - - postfix = num[z: ] - try: - exp = names.index(postfix) - except ValueError: - raise ValueError('Unknown size postfix') - factor = 1024 if binary else 1000 - - #TODO: 1.96B is returned rounded as 2. Should we complain? - return int(round(tmp_num * (factor ** exp))) - - -#*************************************************************** -# -#*************************************************************** -TimeDurationNames = { - 'seconds': 's', - 'minutes': 'm', - 'hours': 'h', - 'days': 'd', - 'years': 'y' - } -def format_time_delta(t1, t2, names=None): - """Pretty prints a time delta - @arg t1: duration starting time - @arg t2: duration ending time - @arg names: (optional) dict mapping names to names as they should be - to be printed (see TimeDurationNames) - - >>> import time - >>> t0 = time.time() - - >>> format_time_delta(t0, t0 +1) - '1s' - - >>> format_time_delta(t0, t0) - '0s' - - >>> format_time_delta(t0, t0 +1.4) - '1.4s' - - >>> format_time_delta(t0, t0 +60) - '1m' - - >>> format_time_delta(t0, t0 +12345) - '3.4h' - - >>> format_time_delta(t0, t0 +1234567890) - '39.1y' - - >>> format_time_delta(t0, t0 +1234567890, names={'years': 'leapers', 'seconds': 's', 'minutes': 'm', 'hours': 'h', 'days': 'd'}) - '39.1leapers' - - """ - mapping = ( - ('years', 1), - ('days', 365), - ('hours', 24), - ('minutes', 60), - ('seconds', 60), - ) - if names is None: - names = TimeDurationNames - - delta = t2 - t1 - if delta < 0: - t = n = 0 - name = 'seconds' - else: - start = (60 * 60 * 24 * 365) - for name, fac in mapping: - start = start / fac - t = delta / start - t = round(t, 1) - n = int(t) - if n: - break - - name = names[name] - if t > n: - return '%s%s' % (t, name) - else: - return '%s%s' % (n, name) - - -#***************************************************************** -# -#**************************************************************** -HEX_PREFIXES = ('0x', '0X', '&H', '&h') -NUM_DIGITS = "0123456789abcdefghijklmnopqrstuvwxyz" - - -def to_base(to_base, num, base=10, hex_prefixes=HEX_PREFIXES): - """Converts a number to the desired base - @param to_base: base to convert the number to (2-36 and 256) - @param num: number to convert - @param base: base of the number to convert - @param hex_prefixes: prefixes for hexadecimal numbers to be recognized by the function - - @return: (str) converted number - - - >>> to_base(2, 10) - '1010' - >>> to_base(10, '1010', base=2) - '10' - >>> to_base(2, '1010', base=2) - '1010' - - >>> to_base(10, '0xFF', base=16) - '255' - - >>> to_base(256, '0x61', base=16) - 'a' - >>> to_base(2, 'a', base=256) - '1100001' - - - >>> result = to_base(2, 'Hello World!', 256) - >>> result - '10010000110010101101100011011000110111100100000010101110110111101110010011011000110010000100001' - >>> result = to_base(256, result, base=2) - >>> result - 'Hello World!' - - """ - if num < 0: - raise ValueError('negative numbers not supported: %r' % num) - if to_base < 2 or to_base > 36 and not to_base == 256: - raise ValueError('bes must be in range 2-36 or 256, found: %r' % to_base) - if base < 2 or base > 36 and not base == 256: - raise ValueError('bes must be in range 2-36 or 256, found: %r' % base) - - if base == 256: - tmp_num = 0 - for char in num: - tmp_num = (tmp_num << 8) + ord(char) - num = tmp_num - else: - # let int() handle it - if base == 16: - num = strip_hex_prefix(num, hex_prefixes=hex_prefixes) - num = int('%s' % num, base) - - if to_base == 10 and base != 256: - return str(num) - - out = '' - if to_base == 256: - while num: - num, tail = divmod(num, to_base) - out += chr(tail) - return out[-1::-1] if out else '\x00' - else: - while num: - num, tail = divmod(num, to_base) - out += NUM_DIGITS[tail] - return out[-1::-1] if out else '0' - - - -def strip_hex_prefix(num, hex_prefixes=HEX_PREFIXES): - """Strips prefixes from hexadecimal numbers - @param num: number to strip prefix from - @param hex_prefixes: list containing prefixes to strip - @return: (str) stripped number - - >>> strip_hex_prefix('0xFF') - 'FF' - >>> strip_hex_prefix('&HFF') - 'FF' - >>> strip_hex_prefix(10) - '10' - >>> strip_hex_prefix('') - '' - - """ - if not isinstance(num, basestring): - num = '%s' % num - else: - pat = re.compile( - '\A(%s)' % '|'.join([re.escape(i) for i in hex_prefixes]) - ) - num = pat.sub('', num) - return num - - -#***************************************************************** -# -#**************************************************************** -if __name__ == '__main__': - import doctest - doctest.testmod() - - - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-30 22:25:59
|
Revision: 828 http://fclient.svn.sourceforge.net/fclient/?rev=828&view=rev Author: jUrner Date: 2008-07-30 22:26:06 +0000 (Wed, 30 Jul 2008) Log Message: ----------- ups, broken import Modified Paths: -------------- trunk/fclient/src/fclient/impl/ViewDownloads.py Modified: trunk/fclient/src/fclient/impl/ViewDownloads.py =================================================================== --- trunk/fclient/src/fclient/impl/ViewDownloads.py 2008-07-30 22:19:52 UTC (rev 827) +++ trunk/fclient/src/fclient/impl/ViewDownloads.py 2008-07-30 22:26:06 UTC (rev 828) @@ -43,7 +43,7 @@ from . import config from .lib import fcp2 from .lib.fcp2.lib import pmstruct -from .lib.qt4ex import treewidgetwrap, progressbarwrap +from .lib.qt4ex import treewidgetwrap from . import DlgDownloadKeyToDisk This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-30 22:19:44
|
Revision: 827 http://fclient.svn.sourceforge.net/fclient/?rev=827&view=rev Author: jUrner Date: 2008-07-30 22:19:52 +0000 (Wed, 30 Jul 2008) Log Message: ----------- connection attempt duration was flawed. fixed pt2 Modified Paths: -------------- trunk/fclient/src/fclient/impl/lib/fcp2/client.py trunk/fclient/src/fclient/impl/lib/fcp2/iohandler.py Modified: trunk/fclient/src/fclient/impl/lib/fcp2/client.py =================================================================== --- trunk/fclient/src/fclient/impl/lib/fcp2/client.py 2008-07-30 22:18:50 UTC (rev 826) +++ trunk/fclient/src/fclient/impl/lib/fcp2/client.py 2008-07-30 22:19:52 UTC (rev 827) @@ -489,7 +489,7 @@ msg = self.next(dispatch=False) if msg == message.MsgClientSocketTimeout: disconnectReason = consts.ConstDisconnectReason.NoNodeHello - timeElapsed += time.time() - t0 + timeElapsed = time.time() - t0 yield None elif msg == message.MsgNodeHello: self._nodeHelloMessage = msg Modified: trunk/fclient/src/fclient/impl/lib/fcp2/iohandler.py =================================================================== --- trunk/fclient/src/fclient/impl/lib/fcp2/iohandler.py 2008-07-30 22:18:50 UTC (rev 826) +++ trunk/fclient/src/fclient/impl/lib/fcp2/iohandler.py 2008-07-30 22:19:52 UTC (rev 827) @@ -210,7 +210,7 @@ # continue polling consts.ConstLogger.IOHandler.info(consts.ConstLogMessages.RetryingConnect) - timeElapsed += time.time() - t0 + timeElapsed = time.time() - t0 time.sleep(timeout) raise StopIteration This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-30 22:18:42
|
Revision: 826 http://fclient.svn.sourceforge.net/fclient/?rev=826&view=rev Author: jUrner Date: 2008-07-30 22:18:50 +0000 (Wed, 30 Jul 2008) Log Message: ----------- whatevs Modified Paths: -------------- trunk/fclient/src/fclient/impl/tpls/PrefsConnectionExpertSettingsTpl.ui trunk/fclient/src/fclient/impl/tpls/Ui_PrefsConnectionExpertSettingsTpl.py Modified: trunk/fclient/src/fclient/impl/tpls/PrefsConnectionExpertSettingsTpl.ui =================================================================== --- trunk/fclient/src/fclient/impl/tpls/PrefsConnectionExpertSettingsTpl.ui 2008-07-30 22:18:33 UTC (rev 825) +++ trunk/fclient/src/fclient/impl/tpls/PrefsConnectionExpertSettingsTpl.ui 2008-07-30 22:18:50 UTC (rev 826) @@ -5,20 +5,14 @@ <rect> <x>0</x> <y>0</y> - <width>505</width> - <height>524</height> + <width>520</width> + <height>550</height> </rect> </property> <property name="windowTitle" > <string>Form</string> </property> <layout class="QGridLayout" name="gridLayout_2" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>0</number> - </property> <item row="0" column="0" > <widget class="QTabWidget" name="tabWidget" > <property name="sizePolicy" > @@ -35,8 +29,8 @@ <rect> <x>0</x> <y>0</y> - <width>501</width> - <height>472</height> + <width>498</width> + <height>490</height> </rect> </property> <attribute name="title" > @@ -50,8 +44,14 @@ </property> <item> <widget class="QLabel" name="label_5" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="text" > - <string>Adjusts the name the client uses to connect to the node. Use this for example to adjust the connection name in case the name is already in use by other clients. WARNING: changing this will loose all your current qequests</string> + <string>Adjusts the name the client uses to connect to the node. Use this for example to adjust the connection name in case the name is already in use by other clients. WARNING: changing this will loose your current qequests untill you connect under that name again</string> </property> <property name="alignment" > <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> @@ -67,12 +67,12 @@ <item> <layout class="QHBoxLayout" name="horizontalLayout" > <property name="spacing" > - <number>6</number> + <number>0</number> </property> <item> <widget class="QLabel" name="label" > <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Fixed" > + <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> Modified: trunk/fclient/src/fclient/impl/tpls/Ui_PrefsConnectionExpertSettingsTpl.py =================================================================== --- trunk/fclient/src/fclient/impl/tpls/Ui_PrefsConnectionExpertSettingsTpl.py 2008-07-30 22:18:33 UTC (rev 825) +++ trunk/fclient/src/fclient/impl/tpls/Ui_PrefsConnectionExpertSettingsTpl.py 2008-07-30 22:18:50 UTC (rev 826) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/impl/tpls/PrefsConnectionExpertSettingsTpl.ui' # -# Created: Sun Jul 27 20:12:51 2008 +# Created: Wed Jul 30 17:47:37 2008 # by: PyQt4 UI code generator 4.4.3-snapshot-20080705 # # WARNING! All changes made in this file will be lost! @@ -12,10 +12,8 @@ class Ui_PrefsConnectionExpertSettings(object): def setupUi(self, PrefsConnectionExpertSettings): PrefsConnectionExpertSettings.setObjectName("PrefsConnectionExpertSettings") - PrefsConnectionExpertSettings.resize(505, 524) + PrefsConnectionExpertSettings.resize(520, 550) self.gridLayout_2 = QtGui.QGridLayout(PrefsConnectionExpertSettings) - self.gridLayout_2.setMargin(0) - self.gridLayout_2.setSpacing(0) self.gridLayout_2.setObjectName("gridLayout_2") self.tabWidget = QtGui.QTabWidget(PrefsConnectionExpertSettings) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) @@ -25,7 +23,7 @@ self.tabWidget.setSizePolicy(sizePolicy) self.tabWidget.setObjectName("tabWidget") self.tab = QtGui.QWidget() - self.tab.setGeometry(QtCore.QRect(0, 0, 501, 472)) + self.tab.setGeometry(QtCore.QRect(0, 0, 498, 490)) self.tab.setObjectName("tab") self.gridLayout = QtGui.QGridLayout(self.tab) self.gridLayout.setObjectName("gridLayout") @@ -33,16 +31,21 @@ self.verticalLayout.setSpacing(0) self.verticalLayout.setObjectName("verticalLayout") self.label_5 = QtGui.QLabel(self.tab) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label_5.sizePolicy().hasHeightForWidth()) + self.label_5.setSizePolicy(sizePolicy) self.label_5.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) self.label_5.setWordWrap(True) self.label_5.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByKeyboard) self.label_5.setObjectName("label_5") self.verticalLayout.addWidget(self.label_5) self.horizontalLayout = QtGui.QHBoxLayout() - self.horizontalLayout.setSpacing(6) + self.horizontalLayout.setSpacing(0) self.horizontalLayout.setObjectName("horizontalLayout") self.label = QtGui.QLabel(self.tab) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth()) @@ -138,7 +141,7 @@ def retranslateUi(self, PrefsConnectionExpertSettings): PrefsConnectionExpertSettings.setWindowTitle(QtGui.QApplication.translate("PrefsConnectionExpertSettings", "Form", None, QtGui.QApplication.UnicodeUTF8)) - self.label_5.setText(QtGui.QApplication.translate("PrefsConnectionExpertSettings", "Adjusts the name the client uses to connect to the node. Use this for example to adjust the connection name in case the name is already in use by other clients. WARNING: changing this will loose all your current qequests", None, QtGui.QApplication.UnicodeUTF8)) + self.label_5.setText(QtGui.QApplication.translate("PrefsConnectionExpertSettings", "Adjusts the name the client uses to connect to the node. Use this for example to adjust the connection name in case the name is already in use by other clients. WARNING: changing this will loose your current qequests untill you connect under that name again", None, QtGui.QApplication.UnicodeUTF8)) self.label.setText(QtGui.QApplication.translate("PrefsConnectionExpertSettings", "Connection name:", None, QtGui.QApplication.UnicodeUTF8)) self.label_6.setText(QtGui.QApplication.translate("PrefsConnectionExpertSettings", "How long should the client try to connect to the node before finally giving up? How long should he wait before retrying to establish a connection? WARNING: setting timeout to low values may cause the gui to slow down", None, QtGui.QApplication.UnicodeUTF8)) self.label_3.setText(QtGui.QApplication.translate("PrefsConnectionExpertSettings", "Connect duration: ", None, QtGui.QApplication.UnicodeUTF8)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-30 22:18:26
|
Revision: 825 http://fclient.svn.sourceforge.net/fclient/?rev=825&view=rev Author: jUrner Date: 2008-07-30 22:18:33 +0000 (Wed, 30 Jul 2008) Log Message: ----------- icons for mimetypes ++ this and that Modified Paths: -------------- trunk/fclient/src/fclient/impl/ViewDownloads.py Modified: trunk/fclient/src/fclient/impl/ViewDownloads.py =================================================================== --- trunk/fclient/src/fclient/impl/ViewDownloads.py 2008-07-30 22:17:39 UTC (rev 824) +++ trunk/fclient/src/fclient/impl/ViewDownloads.py 2008-07-30 22:18:33 UTC (rev 825) @@ -24,18 +24,27 @@ # warnings # x. it may take a while untill the final DataFound message arrives when a request is % completed. feedback would be nice # x. DataFound for a request the file has been removed by the user. no idea what happens. have to test this -#************************************************************************************************************** +# x. when the node is about to start up, looks like persistents may arrive or not. check + # x. how to get early information about mimetype/size? maybe use FcpClient.getFileInfo() + # x. show/hide header izems + # x. sort by header + # x. indicate over all time / dl speed + # x. indicate status / remove items by status + # x. ...whatevs + #************************************************************************************************************** from __future__ import absolute_import if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below import os; __path__ = [os.path.dirname(__file__)] - + +import mimetypes import os from PyQt4 import QtCore, QtGui from . import config from .lib import fcp2 from .lib.fcp2.lib import pmstruct -from .lib.qt4ex import treewidgetwrap +from .lib.qt4ex import treewidgetwrap, progressbarwrap + from . import DlgDownloadKeyToDisk from .tpls.Ui_ViewDownloadsWidgetTpl import Ui_ViewDownloadsWidget @@ -51,8 +60,6 @@ self.displayName=self.trUtf8('Downloads') self.icon=QtGui.QIcon() - - #********************************************************************************** # #********************************************************************************** @@ -129,7 +136,13 @@ trigger=parent.onRemoveSelectedRequests, isEnabled=False, ) + +class DownloadsWidgetSettings(config.SettingsBase): + + _key_ = config.IdViewCDownloadsWidget + _settings_ = ( + ) #********************************************************************************** # #********************************************************************************** @@ -189,6 +202,19 @@ self.fcpIdentifier = fcpIdentifier +# can be used to expose properties for stylesheets for example +class ProgressBar(QtGui.QProgressBar): + + def __init__(self, parent): + QtGui.QProgressBar.__init__(self, parent) + # self.__foo = True + + #def foo(self): + # return self.__foo + #def setFoo(self, value): + # self.__foo = value + #foo = QtCore.pyqtProperty("bool",foo, setFoo) + #********************************************************************************** # #********************************************************************************** @@ -198,8 +224,10 @@ HeaderIndexName = 0 - HeaderIndexFoo = 1 - HeaderIndexProgress = 2 + HeaderIndexSize = 1 + HeaderIndexMimeType = 2 + HeaderIndexStatus = 3 + HeaderIndexProgress = 4 def __init__(self, parent, idGlobalFeedback=config.IdMainWindow): QtGui.QWidget.__init__(self, parent) @@ -207,6 +235,7 @@ self.setupUi(self) config.ObjectRegistry.register(self) + self.fcSettings = DownloadsWidgetSettings(self).restore() self.fcActions = DownloadsWidgetActions(self) self.fcViewObject = DownloadsViewObject(self) self.fcGlobalFeedback = DownloadsWidgetGlobalFeedback(self, idGlobalFeedback) @@ -222,19 +251,28 @@ config.fcpClient.events += self.fcpEvents self.fcHeadeLabels = {} self.fcpRequests = {} + + self.foo = True ############################ ## private methods ############################ def _createItemFromFcpRequest(self, fcpRequest): item= TreeItem(fcpRequest['Identifier'], self.tree) + fileName = fcpRequest['Filename'] + mimeType = mimetypes.guess_type(fileName)[0] + icon = config.fcResources.getIcon( + config.mimeTypeIconName(mimeType), + config.fcSettings.value('IconSize'), + config.fcSettings.value('IconTheme'), + ) + item.setIcon(0, icon) item.setData( self.HeaderIndexName, QtCore.Qt.DisplayRole, QtCore.QVariant(os.path.basename(fcpRequest['Filename'])) ) - - progressBar = QtGui.QProgressBar(self) + progressBar = ProgressBar(self) progressBar.setRange(0, 0) self.tree.setItemWidget(item, self.HeaderIndexProgress, progressBar) self.fcpRequests[fcpRequest['Identifier']] = item @@ -248,7 +286,9 @@ tree = self.controlById(self.IdTree) self.fcHeadeLabels = { self.HeaderIndexName: self.trUtf8('Name'), - self.HeaderIndexFoo: self.trUtf8('Foo'), + self.HeaderIndexSize: self.trUtf8('Size'), + self.HeaderIndexMimeType: self.trUtf8('Type'), + self.HeaderIndexStatus: self.trUtf8('Status'), self.HeaderIndexProgress: self.trUtf8('Progress'), } tree.setHeaderLabels([i[1] for i in sorted(self.fcHeadeLabels.items())]) @@ -267,6 +307,7 @@ # setup tree tree = self.controlById(self.IdTree) tree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) + tree.setRootIsDecorated(False) tree.setSelectionMode(tree.ExtendedSelection) tree.setUniformRowHeights(True) self.connect(tree, QtCore.SIGNAL('customContextMenuRequested(const QPoint &)'), self.onTreeCustomContextMenuRequested) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-30 22:17:31
|
Revision: 824 http://fclient.svn.sourceforge.net/fclient/?rev=824&view=rev Author: jUrner Date: 2008-07-30 22:17:39 +0000 (Wed, 30 Jul 2008) Log Message: ----------- get iconsize/theme from config Modified Paths: -------------- trunk/fclient/src/fclient/impl/ViewBrowser.py Modified: trunk/fclient/src/fclient/impl/ViewBrowser.py =================================================================== --- trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-30 22:16:59 UTC (rev 823) +++ trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-30 22:17:39 UTC (rev 824) @@ -234,8 +234,6 @@ ('OpenHomePageOnNewTabCreated', 'Bool', False, config.SettingScopeUser), ('BackIsClose', 'Bool', False, config.SettingScopeUser), #TODO: not implemented ('HomePage', 'String', QtCore.QString(), config.SettingScopeUser), - ('IconSize', 'UInt', 32, config.SettingScopeUser), - ('IconTheme', 'String', QtCore.QString('crystal'), config.SettingScopeUser), ('AutoLoadImages', 'Bool', True, config.SettingScopeUser), #TODO: not yet implemented ('MaxTabText', 'UInt', 20, config.SettingScopeUser), #NOTE: make shure Max >= Min and Max and Min > 0 ('MinTabText', 'UInt', 7, config.SettingScopeUser), @@ -266,8 +264,8 @@ def __init__(self, parent): config.ActionsBase.__init__(self, parent) - iconSize = parent.fcSettings.value('IconSize') - iconTheme = parent.fcSettings.value('IconTheme') + iconSize = config.fcSettings.value('IconSize') + iconTheme = config.fcSettings.value('IconTheme') #TODO: shortcut self.action( @@ -480,8 +478,8 @@ self.fcGlobalFeedback = BrowserWidgetGlobalFeedback(self, idGlobalFeedback) # setup - iconSize = self.fcSettings.value('IconSize') - iconTheme = self.fcSettings.value('IconTheme') + iconSize = config.fcSettings.value('IconSize') + iconTheme = config.fcSettings.value('IconTheme') # setup tab bar tabWidget = self.controlById(self.IdTabBrowsers) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-30 22:16:51
|
Revision: 823 http://fclient.svn.sourceforge.net/fclient/?rev=823&view=rev Author: jUrner Date: 2008-07-30 22:16:59 +0000 (Wed, 30 Jul 2008) Log Message: ----------- support for mimetype icons ++ this and that Modified Paths: -------------- trunk/fclient/src/fclient/impl/config.py Modified: trunk/fclient/src/fclient/impl/config.py =================================================================== --- trunk/fclient/src/fclient/impl/config.py 2008-07-30 22:15:46 UTC (rev 822) +++ trunk/fclient/src/fclient/impl/config.py 2008-07-30 22:16:59 UTC (rev 823) @@ -30,6 +30,7 @@ FcDownloadDir = QtCore.QString(os.path.join(_fclientDir, 'downloads')) FcResDir = QtCore.QString(os.path.join(_implDir, 'res')) FcSettingsDir = QtCore.QString(os.path.join(_fclientDir, 'settings')) +FcDefaultStyleSheet = os.path.join(unicode(FcResDir), 'stylesheets', 'default.css') del _implDir, _fclientDir #********************************************************************************** # looks like QObject.findChild() does not always work. docs mention troubles @@ -106,7 +107,8 @@ ('SettingsDir', 'String', QtCore.QString(FcSettingsDir), SettingScopeUser), # if not None, settings are stored locally in the app folder ('SettingsAllUsers', 'Bool', False, SettingScopeUser), # store settings for all users? - ('IconTheme', 'String', 'crystal', SettingScopeUser), #TODO: global icon theme? + ('IconTheme', 'String', QtCore.QString('crystal'), SettingScopeUser), #TODO: global icon theme? + ('IconSize', 'UInt', 32, SettingScopeUser), ('DownloadDir', 'String', FcDownloadDir, SettingScopeUser), ) @@ -161,7 +163,8 @@ #******************************************************************************** # #******************************************************************************** -#TODO: maybe find a better place +#TODO: maybe find a better place for the following + def qStringToFcpKey(qString): """converts a qString to a fcp key @return: fcp key or None if the key could not be converted @@ -213,3 +216,61 @@ return key, '' return r.group(1), r.group(2) + + +# mapping from known mimetypes to icons +_TmpKnownMimeTypes = ( + ('mimetype-archive', ( + 'application/zip', + 'application/x-tar', + 'application/rar', + ) + ), + ('mimetype-audio', ( + 'audio/x-ms-wma', + 'audio/x-wav', + 'audio/mpeg', + ) + ), + ('mimetype-executable', ( + 'application/x-msdos-program', + ) + ), + ('mimetype-html', ( + 'text/html', + ) + ), + ('mimetype-image', ( + 'image/gif', + 'image/jpeg', + 'image/png', + 'image/x-icon', + 'image/pcx', + 'image/pcx', + ) + ), + ('mimetype-pdf', ( + 'application/pdf', + ) + ), + ('mimetype-video', ( + 'video/mpeg', + 'video/mp4', + 'video/ogg', + 'video/x-ms-asf', + 'video/x-ms-wmv', + 'video/x-msvideo', + ) + ), + ) +KnownMimeTypes = {} +for a, b in _TmpKnownMimeTypes: + for b in b: + KnownMimeTypes[b] = a +del _TmpKnownMimeTypes, a, b + +def mimeTypeIconName(mimeType): + return KnownMimeTypes.get(mimeType, 'mimetype-unknown') + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-30 22:15:42
|
Revision: 822 http://fclient.svn.sourceforge.net/fclient/?rev=822&view=rev Author: jUrner Date: 2008-07-30 22:15:46 +0000 (Wed, 30 Jul 2008) Log Message: ----------- icons for mimetypes Added Paths: ----------- trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/mimetype-archive.png trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/mimetype-audio.png trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/mimetype-executable.png trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/mimetype-html.png trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/mimetype-image.png trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/mimetype-pdf.png trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/mimetype-unknown.png trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/mimetype-video.png trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/mimetype-archive.png trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/mimetype-audio.png trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/mimetype-executable.png trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/mimetype-html.png trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/mimetype-image.png trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/mimetype-pdf.png trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/mimetype-unknown.png trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/mimetype-video.png trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/mimetype-archive.png trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/mimetype-audio.png trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/mimetype-executable.png trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/mimetype-html.png trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/mimetype-image.png trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/mimetype-pdf.png trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/mimetype-unknown.png trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/mimetype-video.png Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/mimetype-archive.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/mimetype-audio.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/mimetype-executable.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/mimetype-html.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/mimetype-image.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/mimetype-pdf.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/mimetype-unknown.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/mimetype-video.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/mimetype-archive.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/mimetype-audio.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/mimetype-executable.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/mimetype-html.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/mimetype-image.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/mimetype-pdf.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/mimetype-unknown.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/mimetype-video.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/mimetype-archive.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/mimetype-audio.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/mimetype-executable.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/mimetype-html.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/mimetype-image.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/mimetype-pdf.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/mimetype-unknown.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/mimetype-video.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-30 22:13:37
|
Revision: 821 http://fclient.svn.sourceforge.net/fclient/?rev=821&view=rev Author: jUrner Date: 2008-07-30 22:13:44 +0000 (Wed, 30 Jul 2008) Log Message: ----------- default style sheet for the gui Added Paths: ----------- trunk/fclient/src/fclient/impl/res/stylesheets/ trunk/fclient/src/fclient/impl/res/stylesheets/default.css Added: trunk/fclient/src/fclient/impl/res/stylesheets/default.css =================================================================== --- trunk/fclient/src/fclient/impl/res/stylesheets/default.css (rev 0) +++ trunk/fclient/src/fclient/impl/res/stylesheets/default.css 2008-07-30 22:13:44 UTC (rev 821) @@ -0,0 +1,2 @@ +/* fclient default stylesheet */ + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |