moved filetype filtes into constant
This commit is contained in:
@ -13,6 +13,13 @@ from .shortcut import shortcut
|
|||||||
from .webview import WebView
|
from .webview import WebView
|
||||||
|
|
||||||
|
|
||||||
|
FILETYPE_FILTERS = [
|
||||||
|
"HDF5 files (*.h5)",
|
||||||
|
"All files (*)"
|
||||||
|
]
|
||||||
|
FILETYPE_FILTERS = ";;".join(FILETYPE_FILTERS)
|
||||||
|
|
||||||
|
|
||||||
class MainWindow(QMainWindow):
|
class MainWindow(QMainWindow):
|
||||||
|
|
||||||
sig_make_new_plot = pyqtSignal(str, PlotDescription)
|
sig_make_new_plot = pyqtSignal(str, PlotDescription)
|
||||||
@ -123,13 +130,7 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
|
|
||||||
def on_file_save(self):
|
def on_file_save(self):
|
||||||
filters = [
|
fn, _chosen_filter = QFileDialog.getSaveFileName(self, filter=FILETYPE_FILTERS)
|
||||||
"HDF5 files (*.h5)",
|
|
||||||
"All files (*)"
|
|
||||||
]
|
|
||||||
filters = ";;".join(filters)
|
|
||||||
|
|
||||||
fn, _chosen_filter = QFileDialog.getSaveFileName(self, filter=filters)
|
|
||||||
if not fn:
|
if not fn:
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -142,13 +143,7 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
|
|
||||||
def on_file_open(self):
|
def on_file_open(self):
|
||||||
filters = [
|
fns, _chosen_filter = QFileDialog.getOpenFileNames(self, filter=FILETYPE_FILTERS)
|
||||||
"HDF5 files (*.h5)",
|
|
||||||
"All files (*)"
|
|
||||||
]
|
|
||||||
filters = ";;".join(filters)
|
|
||||||
|
|
||||||
fns, _chosen_filter = QFileDialog.getOpenFileNames(self, filter=filters)
|
|
||||||
if not fns:
|
if not fns:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user