← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3917: Fix load/save in GUI-QT5.

 

------------------------------------------------------------
revno: 3917
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Fri 2016-07-08 21:37:53 +0200
message:
  Fix load/save in GUI-QT5.
modified:
  gui/qt5/__init__.py


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'gui/qt5/__init__.py'
--- gui/qt5/__init__.py	2016-07-04 17:53:54 +0000
+++ gui/qt5/__init__.py	2016-07-08 19:37:53 +0000
@@ -135,13 +135,17 @@
 		self.displayArea.setWidget(se)
 	def loadSlot(self):
 		f=QFileDialog.getOpenFileName(self,'Load simulation','','Yade simulations (*.xml *.xml.bz2 *.xml.gz *.yade *.yade.gz *.yade.bz2);; *.*')
-		f=str(f)
+		f=str(f[0])
 		if not f: return # cancelled
 		self.deactivateControls()
 		O.load(f)
 	def saveSlot(self):
 		f=QFileDialog.getSaveFileName(self,'Save simulation','','Yade simulations (*.xml *.xml.bz2 *.xml.gz *.yade *.yade.gz *.yade.bz2);; *.*')
-		f=str(f)
+		f=str(f[0])
+		splf = f.split('.')
+		if (len(splf) == 1):
+			print('No extension is found in the file name! Added .xml.bz2')
+			f = f+'.xml.bz2'
 		if not f: return # cancelled
 		O.save(f)
 	def reloadSlot(self):