SF.net SVN: fclient:[962] trunk/fclient/fclient
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-08-22 13:20:50
|
Revision: 962
http://fclient.svn.sourceforge.net/fclient/?rev=962&view=rev
Author: jUrner
Date: 2008-08-22 13:20:59 +0000 (Fri, 22 Aug 2008)
Log Message:
-----------
fix. requests could get added multiple times ++ clear dls on fcpClient disconnect
Modified Paths:
--------------
trunk/fclient/fclient/README
trunk/fclient/fclient/impl/BaseRequestsWidget/BaseRequestsWidget.py
Modified: trunk/fclient/fclient/README
===================================================================
--- trunk/fclient/fclient/README 2008-08-22 13:04:37 UTC (rev 961)
+++ trunk/fclient/fclient/README 2008-08-22 13:20:59 UTC (rev 962)
@@ -19,7 +19,9 @@
bugfixes:
- x. many
+ x. downloadsWidget did not notice dls already present and could add the same dl multiple times. fixed
+
+ x. many more
*******************************************************************
Modified: trunk/fclient/fclient/impl/BaseRequestsWidget/BaseRequestsWidget.py
===================================================================
--- trunk/fclient/fclient/impl/BaseRequestsWidget/BaseRequestsWidget.py 2008-08-22 13:04:37 UTC (rev 961)
+++ trunk/fclient/fclient/impl/BaseRequestsWidget/BaseRequestsWidget.py 2008-08-22 13:20:59 UTC (rev 962)
@@ -38,6 +38,7 @@
# to realize that this is a serious problem...
# x. byte amount postfixes must be transllated ++ use Kib or Kb or let the user decide?
# x. sometimes groups of dls get not removed
+# x. tree is cleared on fcpClient disconnect. maybe a bit harsh. have to think about a better way to handle this
#**************************************************************************************************************
# some fixes for relative imports
# see --> [http://bugs.python.org/issue1510172] absolute/rellative import not working (works only current dir and below)
@@ -332,6 +333,9 @@
@note: if you add a newly created request, make shure to set the requests PersistentUserData
to the result of the call to L{persistentFcpRequestData}
"""
+ if fcpRequest['Identifier'] in self.fcpRequests:
+ raise ValueError('Request already present')
+
tree = self.controlById(self.IdTree)
root = tree.invisibleRootItem()
item= TreeItem(fcpRequest, root)
@@ -473,12 +477,14 @@
def onFcpClientConnected(self, event, msg):
for action in self.fcActions:
action.setEnabled(True)
-
-
+
def onFcpClientDisconnected(self, event, msg):
+ tree = self.controlById(self.IdTree)
+ tree.clear()
+ self.fcpRequests = {}
for action in self.fcActions:
action.setEnabled(False)
-
+
def onFcpConfigData(self, fcpEvent, fcpRequest):
pass
@@ -552,6 +558,8 @@
def onFcpClientRequestStarted(self, fcpEvent, fcpRequest):
if fcpRequest['RequestStatus'] & fcp2.ConstRequestStatus.Restored:
+ if fcpRequest['Identifier'] in self.fcpRequests:
+ return
try:
requestData = PersistentRequestData.load(fcpRequest['PersistentUserData'])
except pmstruct.PMStructError:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|