Commit e4fa10bc authored by Michael Büsch's avatar Michael Büsch

gui: Fix open/save dialog for PyQt4

Signed-off-by: Michael Büsch's avatarMichael Buesch <[email protected]>
parent 1831de73
...@@ -173,7 +173,11 @@ class MainWidget(QWidget): ...@@ -173,7 +173,11 @@ class MainWidget(QWidget):
return True return True
def load(self): def load(self):
fn, fil = QFileDialog.getOpenFileName(self, if isPyQt and isQt4:
getOpenFileName = QFileDialog.getOpenFileNameAndFilter
else:
getOpenFileName = QFileDialog.getOpenFileName
fn, fil = getOpenFileName(self,
"Open project", "", "Open project", "",
"Awlsim project or AWL/STL source (*.awlpro *.awl);;" "Awlsim project or AWL/STL source (*.awlpro *.awl);;"
"Awlsim project (*.awlpro);;" "Awlsim project (*.awlpro);;"
...@@ -200,7 +204,11 @@ class MainWidget(QWidget): ...@@ -200,7 +204,11 @@ class MainWidget(QWidget):
def save(self, newFile=False): def save(self, newFile=False):
if newFile or not self.filename: if newFile or not self.filename:
fn, fil = QFileDialog.getSaveFileName(self, if isPyQt and isQt4:
getSaveFileName = QFileDialog.getSaveFileNameAndFilter
else:
getSaveFileName = QFileDialog.getSaveFileName
fn, fil = getSaveFileName(self,
"Awlsim project save as", "", "Awlsim project save as", "",
"Awlsim project (*.awlpro)", "Awlsim project (*.awlpro)",
"*.awlpro") "*.awlpro")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment