diff --git a/pyqtgraph/flowchart/Flowchart.py b/pyqtgraph/flowchart/Flowchart.py index 4edea91b..ae03d4c2 100644 --- a/pyqtgraph/flowchart/Flowchart.py +++ b/pyqtgraph/flowchart/Flowchart.py @@ -27,6 +27,7 @@ from .. import configfile as configfile from .. import dockarea as dockarea from . import FlowchartGraphicsView from .. import functions as fn +from ..python2_3 import asUnicode def strDict(d): return dict([(str(k), v) for k, v in d.items()]) @@ -519,12 +520,12 @@ class Flowchart(Node): self.fileDialog.fileSelected.connect(self.loadFile) return ## NOTE: was previously using a real widget for the file dialog's parent, but this caused weird mouse event bugs.. - fileName = unicode(fileName) + fileName = asUnicode(fileName) state = configfile.readConfigFile(fileName) self.restoreState(state, clear=True) self.viewBox.autoRange() self.sigFileLoaded.emit(fileName) - + def saveFile(self, fileName=None, startDir=None, suggestedFileName='flowchart.fc'): """Save this flowchart to a .fc file """ @@ -534,11 +535,12 @@ class Flowchart(Node): if startDir is None: startDir = '.' self.fileDialog = FileDialog(None, "Save Flowchart..", startDir, "Flowchart (*.fc)") + self.fileDialog.setDefaultSuffix("fc") self.fileDialog.setAcceptMode(QtGui.QFileDialog.AcceptSave) self.fileDialog.show() self.fileDialog.fileSelected.connect(self.saveFile) return - fileName = unicode(fileName) + fileName = asUnicode(fileName) configfile.writeConfigFile(self.saveState(), fileName) self.sigFileSaved.emit(fileName) @@ -662,7 +664,7 @@ class FlowchartCtrlWidget(QtGui.QWidget): #self.setCurrentFile(newFile) def fileSaved(self, fileName): - self.setCurrentFile(unicode(fileName)) + self.setCurrentFile(asUnicode(fileName)) self.ui.saveBtn.success("Saved.") def saveClicked(self): @@ -691,7 +693,7 @@ class FlowchartCtrlWidget(QtGui.QWidget): #self.setCurrentFile(newFile) def setCurrentFile(self, fileName): - self.currentFileName = unicode(fileName) + self.currentFileName = asUnicode(fileName) if fileName is None: self.ui.fileNameLabel.setText("[ new ]") else: diff --git a/pyqtgraph/flowchart/Node.py b/pyqtgraph/flowchart/Node.py index e7ce9360..880c04aa 100644 --- a/pyqtgraph/flowchart/Node.py +++ b/pyqtgraph/flowchart/Node.py @@ -373,7 +373,7 @@ class Node(QtCore.QObject): pos = self.graphicsItem().pos() state = {'pos': (pos.x(), pos.y()), 'bypass': self.isBypassed()} termsEditable = self._allowAddInput | self._allowAddOutput - for term in self._inputs.values() + self._outputs.values(): + for term in list(self._inputs.values()) + list(self._outputs.values()): termsEditable |= term._renamable | term._removable | term._multiable if termsEditable: state['terminals'] = self.saveTerminals()