Force different file name after conversion (#4272)
* Force different file name after conversion * More detailed instructions
This commit is contained in:
committed by
Bertrand Songis
parent
be0ef50195
commit
7c33043ac0
@@ -152,10 +152,10 @@ void MdiChild::showModelsListContextMenu(const QPoint & pos)
|
|||||||
contextMenu.exec(globalPos);
|
contextMenu.exec(globalPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MdiChild::setCurrentFileExtension(const QString & ext)
|
void MdiChild::forceNewFilename(const QString & suffix, const QString & ext)
|
||||||
{
|
{
|
||||||
QFileInfo info(curFile);
|
QFileInfo info(curFile);
|
||||||
curFile = info.path() + "/" + info.baseName() + ext;
|
curFile = info.path() + "/" + info.baseName() + suffix + ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MdiChild::onFirmwareChanged()
|
void MdiChild::onFirmwareChanged()
|
||||||
@@ -168,11 +168,12 @@ void MdiChild::onFirmwareChanged()
|
|||||||
|
|
||||||
void MdiChild::convertStorage(BoardEnum from, BoardEnum to)
|
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);
|
radioData.convert(from, to);
|
||||||
setCurrentFileExtension(".otx");
|
forceNewFilename("_converted", ".otx");
|
||||||
initModelsList();
|
initModelsList();
|
||||||
fileChanged = true;
|
fileChanged = true;
|
||||||
|
isUntitled = true;
|
||||||
documentWasModified();
|
documentWasModified();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class MdiChild : public QWidget
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void convertStorage(BoardEnum from, BoardEnum to);
|
void convertStorage(BoardEnum from, BoardEnum to);
|
||||||
void setCurrentFileExtension(const QString & ext);
|
void forceNewFilename(const QString & suffix, const QString & ext);
|
||||||
void closeEvent(QCloseEvent * event);
|
void closeEvent(QCloseEvent * event);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
|
|||||||
Reference in New Issue
Block a user