mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-20 01:12:15 -07:00
support multi open deck
This commit is contained in:
parent
b9c8365009
commit
5aaf1232cb
1 changed files with 10 additions and 8 deletions
|
|
@ -150,16 +150,18 @@ QString TabDeckStorage::getTargetPath() const
|
||||||
|
|
||||||
void TabDeckStorage::actOpenLocalDeck()
|
void TabDeckStorage::actOpenLocalDeck()
|
||||||
{
|
{
|
||||||
QModelIndex curLeft = localDirView->selectionModel()->currentIndex();
|
QModelIndexList curLefts = localDirView->selectionModel()->selectedRows();
|
||||||
if (localDirModel->isDir(curLeft))
|
for (const auto &curLeft : curLefts) {
|
||||||
return;
|
if (localDirModel->isDir(curLeft))
|
||||||
QString filePath = localDirModel->filePath(curLeft);
|
return;
|
||||||
|
QString filePath = localDirModel->filePath(curLeft);
|
||||||
|
|
||||||
DeckLoader deckLoader;
|
DeckLoader deckLoader;
|
||||||
if (!deckLoader.loadFromFile(filePath, DeckLoader::CockatriceFormat))
|
if (!deckLoader.loadFromFile(filePath, DeckLoader::CockatriceFormat))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
emit openDeckEditor(&deckLoader);
|
emit openDeckEditor(&deckLoader);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabDeckStorage::actUpload()
|
void TabDeckStorage::actUpload()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue