mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-22 17:50:52 +01:00
Improve files names extension for Gnome DE and Flatpak
This commit is contained in:
@@ -44,10 +44,10 @@ ConductorNumExport::ConductorNumExport(QETProject *project, QWidget *parent) :
|
|||||||
*/
|
*/
|
||||||
bool ConductorNumExport::toCsv()
|
bool ConductorNumExport::toCsv()
|
||||||
{
|
{
|
||||||
QString name = QObject::tr("numero_de_fileries_") + m_project->title();
|
QString name = QObject::tr("numero_de_fileries_") + m_project->title() + ".csv";
|
||||||
if(!name.endsWith(".csv")) {
|
// if(!name.endsWith(".csv")) {
|
||||||
name += ".csv";
|
// name += ".csv";
|
||||||
}
|
// }
|
||||||
|
|
||||||
QString filename = QFileDialog::getSaveFileName(m_parent_widget, QObject::tr("Enregister sous... "), name, QObject::tr("Fichiers csv (*.csv)"));
|
QString filename = QFileDialog::getSaveFileName(m_parent_widget, QObject::tr("Enregister sous... "), name, QObject::tr("Fichiers csv (*.csv)"));
|
||||||
QFile file(filename);
|
QFile file(filename);
|
||||||
|
|||||||
@@ -1237,9 +1237,9 @@ bool QETElementEditor::slot_saveAsFile()
|
|||||||
if (fn.isEmpty())
|
if (fn.isEmpty())
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
// //If the name doesn't end by .elmt, we add it
|
//If the name doesn't end by .elmt, we add it
|
||||||
// if (!fn.endsWith(".elmt", Qt::CaseInsensitive))
|
if (!fn.endsWith(".elmt", Qt::CaseInsensitive))
|
||||||
// fn += ".elmt";
|
fn += ".elmt";
|
||||||
|
|
||||||
bool result_save = toFile(fn);
|
bool result_save = toFile(fn);
|
||||||
//If the save success, the filename is keep
|
//If the save success, the filename is keep
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ nomenclature::~nomenclature() {
|
|||||||
bool nomenclature::saveToCSVFile()
|
bool nomenclature::saveToCSVFile()
|
||||||
{
|
{
|
||||||
// SAVE IN FILE
|
// SAVE IN FILE
|
||||||
QString name = QObject::tr("nomenclature_") + QString(m_project -> title());
|
QString name = QObject::tr("nomenclature_") + QString(m_project -> title() + ".csv");
|
||||||
if (!name.endsWith(".csv")) {
|
if (!name.endsWith(".csv")) {
|
||||||
name += ".csv";
|
name += ".csv";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ QString ProjectView::askUserForFilePath(bool assign) {
|
|||||||
QString filepath = QFileDialog::getSaveFileName(
|
QString filepath = QFileDialog::getSaveFileName(
|
||||||
this,
|
this,
|
||||||
tr("Enregistrer sous", "dialog title"),
|
tr("Enregistrer sous", "dialog title"),
|
||||||
m_project -> currentDir(),
|
m_project -> currentDir() + "/" + tr("sansnom") + ".qet",
|
||||||
tr("Projet QElectroTech (*.qet)", "filetypes allowed when saving a project file")
|
tr("Projet QElectroTech (*.qet)", "filetypes allowed when saving a project file")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -125,10 +125,10 @@ int BOMExportDialog::exec()
|
|||||||
if (r == QDialog::Accepted)
|
if (r == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
//save in csv file
|
//save in csv file
|
||||||
QString file_name = tr("nomenclature_") + QString(m_project ->title());
|
QString file_name = tr("nomenclature_") + QString(m_project ->title() + ".csv");
|
||||||
if (!file_name.endsWith(".csv")) {
|
// if (!file_name.endsWith(".csv")) {
|
||||||
file_name += ".csv";
|
// file_name += ".csv";
|
||||||
}
|
// }
|
||||||
QString file_path = QFileDialog::getSaveFileName(this, tr("Enregister sous... "), file_name, tr("Fichiers csv (*.csv)"));
|
QString file_path = QFileDialog::getSaveFileName(this, tr("Enregister sous... "), file_name, tr("Fichiers csv (*.csv)"));
|
||||||
QFile file(file_path);
|
QFile file(file_path);
|
||||||
if (!file_path.isEmpty())
|
if (!file_path.isEmpty())
|
||||||
|
|||||||
Reference in New Issue
Block a user