diff --git a/sources/qetdiagrameditor.cpp b/sources/qetdiagrameditor.cpp index c3a02bbda..dfc5991e8 100644 --- a/sources/qetdiagrameditor.cpp +++ b/sources/qetdiagrameditor.cpp @@ -1828,7 +1828,7 @@ bool QETDiagramEditor::openProject() this, tr("Open a file"), open_dialog_dir.absolutePath(), - tr("QElectroTech project(*.qet *.qetz);;XML Files (*.xml);;All files (*)") + QETProject::openFileFilter() + ";;" + tr("XML Files (*.xml);;All files (*)") ); if (filepath.isEmpty()) return(false); diff --git a/sources/qetproject.cpp b/sources/qetproject.cpp index a3af26ee7..45ef03635 100644 --- a/sources/qetproject.cpp +++ b/sources/qetproject.cpp @@ -2654,6 +2654,15 @@ bool QETProject::isContainerPath(const QString &path) return path.endsWith(QLatin1String(".qetz"), Qt::CaseInsensitive); } +/** + @brief QETProject::openFileFilter + @return the file-dialog filter for a project to open: .qet and .qetz +*/ +QString QETProject::openFileFilter() +{ + return tr("QElectroTech project (*.qet *.qetz)"); +} + /** @brief QETProject::writeContainer Write the project document @p project to @p path as a .qetz: the same diff --git a/sources/qetproject.h b/sources/qetproject.h index 621097e55..e2c7f0f9d 100644 --- a/sources/qetproject.h +++ b/sources/qetproject.h @@ -455,6 +455,7 @@ class QETProject : public QObject ProjectState openFile(QFile *file); public: static bool isContainerPath(const QString &path); + static QString openFileFilter(); /// Saving writes a .qetz: one read from a .qet is saved as /// a .qetz beside it, the .qet left as it is /// (stage D1) diff --git a/sources/ui/configpage/projectconfigpages.cpp b/sources/ui/configpage/projectconfigpages.cpp index 07aeef58b..50da7433a 100644 --- a/sources/ui/configpage/projectconfigpages.cpp +++ b/sources/ui/configpage/projectconfigpages.cpp @@ -1166,7 +1166,7 @@ void ProjectAutoNumConfigPage::importFromProject() this, tr("Import numbering from a project"), m_project->currentDir(), - tr("Project QElectroTech (*.qet *.qetz)")); + QETProject::openFileFilter()); if (path.isEmpty()) { return; }