Only append .fc file extension if not added in the file dialog.
This commit is contained in:
parent
5c3214105c
commit
fd134f77c6
@ -525,7 +525,12 @@ class Flowchart(Node):
|
|||||||
self.restoreState(state, clear=True)
|
self.restoreState(state, clear=True)
|
||||||
self.viewBox.autoRange()
|
self.viewBox.autoRange()
|
||||||
self.sigFileLoaded.emit(fileName)
|
self.sigFileLoaded.emit(fileName)
|
||||||
|
|
||||||
|
def saveFileSelected(self, fileName):
|
||||||
|
if not fileName.endswith('.fc'):
|
||||||
|
fileName += '.fc'
|
||||||
|
self.saveFile(fileName=fileName)
|
||||||
|
|
||||||
def saveFile(self, fileName=None, startDir=None, suggestedFileName='flowchart.fc'):
|
def saveFile(self, fileName=None, startDir=None, suggestedFileName='flowchart.fc'):
|
||||||
"""Save this flowchart to a .fc file
|
"""Save this flowchart to a .fc file
|
||||||
"""
|
"""
|
||||||
@ -537,11 +542,8 @@ class Flowchart(Node):
|
|||||||
self.fileDialog = FileDialog(None, "Save Flowchart..", startDir, "Flowchart (*.fc)")
|
self.fileDialog = FileDialog(None, "Save Flowchart..", startDir, "Flowchart (*.fc)")
|
||||||
self.fileDialog.setAcceptMode(QtGui.QFileDialog.AcceptSave)
|
self.fileDialog.setAcceptMode(QtGui.QFileDialog.AcceptSave)
|
||||||
self.fileDialog.show()
|
self.fileDialog.show()
|
||||||
self.fileDialog.fileSelected.connect(self.saveFile)
|
self.fileDialog.fileSelected.connect(self.saveFileSelected)
|
||||||
return
|
return
|
||||||
fileName = unicode(fileName)
|
|
||||||
if not fileName.endswith('.fc'):
|
|
||||||
fileName += '.fc'
|
|
||||||
fileName = asUnicode(fileName)
|
fileName = asUnicode(fileName)
|
||||||
configfile.writeConfigFile(self.saveState(), fileName)
|
configfile.writeConfigFile(self.saveState(), fileName)
|
||||||
self.sigFileSaved.emit(fileName)
|
self.sigFileSaved.emit(fileName)
|
||||||
|
Loading…
Reference in New Issue
Block a user