Commit d2c03496 authored by Max-Wilhelm Bruker's avatar Max-Wilhelm Bruker
Browse files
parents 7d235699 5408563a
#!/usr/bin/env xdg-open
[Desktop Entry] [Desktop Entry]
Version=1.0 Version=1.0
Type=Application Type=Application
......
...@@ -134,12 +134,14 @@ void TabDeckStorage::actUpload() ...@@ -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())
......
...@@ -344,6 +344,7 @@ bool WndDeckEditor::actSaveDeckAs() ...@@ -344,6 +344,7 @@ bool WndDeckEditor::actSaveDeckAs()
dialog.setConfirmOverwrite(true); dialog.setConfirmOverwrite(true);
dialog.setDefaultSuffix("cod"); dialog.setDefaultSuffix("cod");
dialog.setNameFilters(DeckList::fileNameFilters); dialog.setNameFilters(DeckList::fileNameFilters);
dialog.selectFile(deckModel->getDeckList()->getName());
if (!dialog.exec()) if (!dialog.exec())
return false; return false;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment