Force different file name after conversion (#4272)

* Force different file name after conversion

* More detailed instructions
This commit is contained in:
Andre Bernet
2017-01-22 17:44:55 +01:00
committed by Bertrand Songis
parent be0ef50195
commit 7c33043ac0
2 changed files with 6 additions and 5 deletions
+5 -4
View File
@@ -152,10 +152,10 @@ void MdiChild::showModelsListContextMenu(const QPoint & pos)
contextMenu.exec(globalPos);
}
void MdiChild::setCurrentFileExtension(const QString & ext)
void MdiChild::forceNewFilename(const QString & suffix, const QString & ext)
{
QFileInfo info(curFile);
curFile = info.path() + "/" + info.baseName() + ext;
curFile = info.path() + "/" + info.baseName() + suffix + ext;
}
void MdiChild::onFirmwareChanged()
@@ -168,11 +168,12 @@ void MdiChild::onFirmwareChanged()
void MdiChild::convertStorage(BoardEnum from, BoardEnum to)
{
QMessageBox::warning(this, "Companion", tr("Models and settings will be automatically converted"), QMessageBox::Ok);
QMessageBox::warning(this, "Companion", tr("Models and settings will be automatically converted.\nIf that is not what you intended, please close the file\nand choose the correct radio type/profile before reopening it."), QMessageBox::Ok);
radioData.convert(from, to);
setCurrentFileExtension(".otx");
forceNewFilename("_converted", ".otx");
initModelsList();
fileChanged = true;
isUntitled = true;
documentWasModified();
}
+1 -1
View File
@@ -60,7 +60,7 @@ class MdiChild : public QWidget
protected:
void convertStorage(BoardEnum from, BoardEnum to);
void setCurrentFileExtension(const QString & ext);
void forceNewFilename(const QString & suffix, const QString & ext);
void closeEvent(QCloseEvent * event);
protected slots: