Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Lewis <jtl1728@rit.edu>2009-12-15 23:15:04 (GMT)
committer Justin Lewis <jtl1728@rit.edu>2009-12-15 23:15:04 (GMT)
commit7bc1caec059875b0c2e49abcd48ab54cc83c724a (patch)
treece270598cd18b3ca16dfbaf26ba16583f29a3df3
parent511312a6b1a935ba6fd62f3da5fdaba5561287fa (diff)
Fixed bug that was when resuming and was server and now client
Now the server sets its download percent to 100 to prevent it from trying to download it and the client now ignores status text when it gets file list from server.
-rw-r--r--FileShare.activity/FileShareActivity.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/FileShare.activity/FileShareActivity.py b/FileShare.activity/FileShareActivity.py
index 7ce7def..4ba0237 100644
--- a/FileShare.activity/FileShareActivity.py
+++ b/FileShare.activity/FileShareActivity.py
@@ -125,7 +125,8 @@ class FileShareActivity(Activity):
tags = "" if not jobject.metadata.has_key('tags') else str( jobject.metadata['tags'] )
size = os.path.getsize( bundle_path )
- self._addFileToUIList( [objectHash, title, desc, tags, size, 0, ''] )
+ # Note, server sets download percent to 100 incase of opening in future as client
+ self._addFileToUIList( [objectHash, title, desc, tags, size, 100, _('Added when server')] )
finally:
chooser.destroy()
@@ -160,9 +161,6 @@ class FileShareActivity(Activity):
self._installBundle( bundle_path )
self._alert(_("Installed bundle to Jorunal"))
-
-
-
def requestDownloadFile(self, widget, data=None):
_logger.info('Requesting to Download file')
if self.treeview.get_selection().count_selected_rows() != 0:
@@ -314,6 +312,8 @@ class FileShareActivity(Activity):
if iter:
model.set_value( iter, 5, progress )
model.set_value( iter, 6, value )
+ self.sharedFiles[id][5] = progress
+ self.sharedFiles[id][6] = value
def _shared_cb(self, activity):
_logger.debug('Activity is now shared')
@@ -447,7 +447,13 @@ class FileShareActivity(Activity):
if action == "filelist":
filelist = simplejson.loads( request )
for key in filelist:
- self._addFileToUIList(filelist[key])
+ if not self.sharedFiles.has_key(key):
+ #Clean last two data sets incase of client now server
+ item = filelist[key]
+ item[5] = 0 #0 percent downloaded
+ item[6] = "" #No download status
+
+ self._addFileToUIList(item)
elif action == "fileadd":
self._addFileToUIList( simplejson.loads( request ) )
elif action == "filerem":