mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-29 18:13:55 -07:00
uploaded decks use filename by default
This commit is contained in:
parent
45c65c59dc
commit
f727b74739
1 changed files with 3 additions and 1 deletions
|
|
@ -134,12 +134,14 @@ void TabDeckStorage::actUpload()
|
||||||
if (localDirModel->isDir(curLeft))
|
if (localDirModel->isDir(curLeft))
|
||||||
return;
|
return;
|
||||||
QString filePath = localDirModel->filePath(curLeft);
|
QString filePath = localDirModel->filePath(curLeft);
|
||||||
|
QFile deckFile(filePath);
|
||||||
|
QFileInfo deckFileInfo(deckFile);
|
||||||
DeckList *deck = new DeckList;
|
DeckList *deck = new DeckList;
|
||||||
if (!deck->loadFromFile(filePath, DeckList::CockatriceFormat))
|
if (!deck->loadFromFile(filePath, DeckList::CockatriceFormat))
|
||||||
return;
|
return;
|
||||||
if (deck->getName().isEmpty()) {
|
if (deck->getName().isEmpty()) {
|
||||||
bool ok;
|
bool ok;
|
||||||
QString deckName = QInputDialog::getText(this, tr("Enter deck name"), tr("This decklist does not have a name.\nPlease enter a name:"), QLineEdit::Normal, tr("Unnamed deck"), &ok);
|
QString deckName = QInputDialog::getText(this, tr("Enter deck name"), tr("This decklist does not have a name.\nPlease enter a name:"), QLineEdit::Normal, deckFileInfo.completeBaseName(), &ok);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
return;
|
return;
|
||||||
if (deckName.isEmpty())
|
if (deckName.isEmpty())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue