mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
load deck from clipboard; closing feature request 0000019
This commit is contained in:
parent
e6e20cb048
commit
ca12aeb5a7
10 changed files with 498 additions and 280 deletions
|
|
@ -7,6 +7,7 @@
|
|||
#include "cardinfowidget.h"
|
||||
#include "deck_picturecacher.h"
|
||||
#include "dlg_cardsearch.h"
|
||||
#include "dlg_load_deck_from_clipboard.h"
|
||||
#include "main.h"
|
||||
|
||||
void SearchLineEdit::keyPressEvent(QKeyEvent *event)
|
||||
|
|
@ -122,6 +123,8 @@ WndDeckEditor::WndDeckEditor(QWidget *parent)
|
|||
aLoadDeck = new QAction(tr("&Load deck..."), this);
|
||||
aLoadDeck->setShortcuts(QKeySequence::Open);
|
||||
connect(aLoadDeck, SIGNAL(triggered()), this, SLOT(actLoadDeck()));
|
||||
aLoadDeckFromClipboard = new QAction(tr("Load deck from cl&ipboard..."), this);
|
||||
connect(aLoadDeckFromClipboard, SIGNAL(triggered()), this, SLOT(actLoadDeckFromClipboard()));
|
||||
aSaveDeck = new QAction(tr("&Save deck"), this);
|
||||
aSaveDeck->setShortcuts(QKeySequence::Save);
|
||||
connect(aSaveDeck, SIGNAL(triggered()), this, SLOT(actSaveDeck()));
|
||||
|
|
@ -141,6 +144,7 @@ WndDeckEditor::WndDeckEditor(QWidget *parent)
|
|||
deckMenu = menuBar()->addMenu(tr("&Deck"));
|
||||
deckMenu->addAction(aNewDeck);
|
||||
deckMenu->addAction(aLoadDeck);
|
||||
deckMenu->addAction(aLoadDeckFromClipboard);
|
||||
deckMenu->addAction(aSaveDeck);
|
||||
deckMenu->addAction(aSaveDeckAs);
|
||||
deckMenu->addSeparator();
|
||||
|
|
@ -275,6 +279,19 @@ void WndDeckEditor::actLoadDeck()
|
|||
delete l;
|
||||
}
|
||||
|
||||
void WndDeckEditor::actLoadDeckFromClipboard()
|
||||
{
|
||||
if (!confirmClose())
|
||||
return;
|
||||
|
||||
DlgLoadDeckFromClipboard dlg;
|
||||
if (!dlg.exec())
|
||||
return;
|
||||
|
||||
setDeck(dlg.getDeckList());
|
||||
setWindowModified(true);
|
||||
}
|
||||
|
||||
bool WndDeckEditor::actSaveDeck()
|
||||
{
|
||||
if (lastFileName.isEmpty())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue