mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-15 18:14:14 +02:00
Use one file filter for opening a project
File > Open and Import numbering from a project each had their own filter for .qet and .qetz, worded differently. Both use QETProject::openFileFilter() now. Review of #1472 (scorpio810, point 11). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user