mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Gave error dlg a description of the error for the user.
This commit is contained in:
parent
d078cf52c9
commit
aa658f95f6
3 changed files with 17 additions and 8 deletions
|
|
@ -885,16 +885,23 @@ void TabDeckEditor::actAddCustomSet()
|
|||
if (!dialog.exec())
|
||||
return;
|
||||
|
||||
QString fileName = dialog.selectedFiles().at(0);
|
||||
|
||||
if (!QFile::exists(fileName)) {
|
||||
DlgAddSetResult dlg(this, false, QString("Selected file cannot be found."));
|
||||
dlg.exec();
|
||||
return;
|
||||
}
|
||||
|
||||
QDir dir(dataDir + "/customsets");
|
||||
int nextPrefix = getNextCustomSetPrefix(dir);
|
||||
|
||||
QString fileName = dialog.selectedFiles().at(0);
|
||||
bool res = QFile::copy(
|
||||
fileName, dir.absolutePath() + "/" + (nextPrefix > 9 ? "" : "0") +
|
||||
QString::number(nextPrefix) + "." + QFileInfo(fileName).fileName()
|
||||
);
|
||||
|
||||
DlgAddSetResult dlg(this, res);
|
||||
DlgAddSetResult dlg(this, res, QString());
|
||||
dlg.exec();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue