|
@@ -58,7 +58,7 @@ class labkeySlicerPythonExtensionWidget(ScriptedLoadableModuleWidget):
|
|
|
except:
|
|
|
fhome=os.environ['HOMEDRIVE']+os.environ['HOMEPATH']
|
|
|
self.startDir=os.path.join(fhome,"temp")
|
|
|
-
|
|
|
+
|
|
|
|
|
|
self.userCertButton=qt.QPushButton("Load")
|
|
|
self.userCertButton.toolTip="Load user certificate (crt)"
|
|
@@ -95,7 +95,7 @@ class labkeySlicerPythonExtensionWidget(ScriptedLoadableModuleWidget):
|
|
|
#add item list for each found file/directory
|
|
|
self.fileList=qt.QListWidget(parent=self)
|
|
|
self.fileList.toolTip="Select remote file"
|
|
|
- self.fileList.currentItemChanged.connect(self.onFileListItemChanged)
|
|
|
+ self.fileList.itemDoubleClicked.connect(self.onFileListDoubleClicked)
|
|
|
self.currentRemoteDir=''
|
|
|
|
|
|
#add dummy entry
|
|
@@ -239,31 +239,29 @@ class labkeySlicerPythonExtensionWidget(ScriptedLoadableModuleWidget):
|
|
|
|
|
|
self.network.connectRemote(str(self.serverURL.text),uname,self.auth_pwd)
|
|
|
|
|
|
- def onFileListItemChanged(self,curr,prev):
|
|
|
- pText="None"
|
|
|
- if prev != None:
|
|
|
- pText=prev.text()
|
|
|
- if curr == None:
|
|
|
- print "Selected items: {0} -> None".format(pText)
|
|
|
+ def onFileListDoubleClicked(self,item):
|
|
|
+ if item == None:
|
|
|
+ print "Selected items: None"
|
|
|
return
|
|
|
|
|
|
- print "Selected items: {0} -> None".format(pText)
|
|
|
+ iText=item.text()
|
|
|
+ print "Selected items: {0} ".format(iText)
|
|
|
|
|
|
|
|
|
#this is hard -> compose path string from currentRemoteDir and selection
|
|
|
- if curr.text().find('..')==0:
|
|
|
+ if item.text().find('..')==0:
|
|
|
#one up
|
|
|
idx=self.currentRemoteDir.rfind('/')
|
|
|
if idx<0:
|
|
|
self.currentRemoteDir=''
|
|
|
else:
|
|
|
self.currentRemoteDir=self.currentRemoteDir[:idx]
|
|
|
- elif curr.text().find('.')==0:
|
|
|
+ elif item.text().find('.')==0:
|
|
|
pass
|
|
|
else:
|
|
|
if len(self.currentRemoteDir)>0:
|
|
|
self.currentRemoteDir+='/'
|
|
|
- self.currentRemoteDir+=curr.text()
|
|
|
+ self.currentRemoteDir+=item.text()
|
|
|
print "Listing {0}".format(self.currentRemoteDir)
|
|
|
flist=self.network.toRelativePath(
|
|
|
self.network.listDir(self.currentRemoteDir))
|