mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-13 17:44:48 -07:00
Copy contents of selected cell from card database when ctrl-c is pressed, mimicking the behavior of ctrl-c in the deck editor.
This commit is contained in:
parent
6b86e4d463
commit
273ebb22e4
4 changed files with 14 additions and 0 deletions
|
|
@ -60,6 +60,11 @@ bool KeySignals::eventFilter(QObject * /*object*/, QEvent *event)
|
||||||
if (kevent->modifiers() & Qt::ShiftModifier)
|
if (kevent->modifiers() & Qt::ShiftModifier)
|
||||||
emit onShiftS();
|
emit onShiftS();
|
||||||
|
|
||||||
|
break;
|
||||||
|
case Qt::Key_C:
|
||||||
|
if (kevent->modifiers() & Qt::ControlModifier)
|
||||||
|
emit onCtrlC();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ signals:
|
||||||
void onCtrlAltLBracket();
|
void onCtrlAltLBracket();
|
||||||
void onCtrlAltRBracket();
|
void onCtrlAltRBracket();
|
||||||
void onShiftS();
|
void onShiftS();
|
||||||
|
void onCtrlC();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool eventFilter(QObject *, QEvent *event);
|
virtual bool eventFilter(QObject *, QEvent *event);
|
||||||
|
|
|
||||||
|
|
@ -394,6 +394,7 @@ void TabDeckEditor::createCentralFrame()
|
||||||
connect(&searchKeySignals, SIGNAL(onCtrlAltLBracket()), this, SLOT(actDecrementCardFromSideboard()));
|
connect(&searchKeySignals, SIGNAL(onCtrlAltLBracket()), this, SLOT(actDecrementCardFromSideboard()));
|
||||||
connect(&searchKeySignals, SIGNAL(onCtrlAltEnter()), this, SLOT(actAddCardToSideboard()));
|
connect(&searchKeySignals, SIGNAL(onCtrlAltEnter()), this, SLOT(actAddCardToSideboard()));
|
||||||
connect(&searchKeySignals, SIGNAL(onCtrlEnter()), this, SLOT(actAddCardToSideboard()));
|
connect(&searchKeySignals, SIGNAL(onCtrlEnter()), this, SLOT(actAddCardToSideboard()));
|
||||||
|
connect(&searchKeySignals, SIGNAL(onCtrlC()), this, SLOT(copyDatabaseCellContents()));
|
||||||
connect(help, &QAction::triggered, this, &TabDeckEditor::showSearchSyntaxHelp);
|
connect(help, &QAction::triggered, this, &TabDeckEditor::showSearchSyntaxHelp);
|
||||||
|
|
||||||
databaseModel = new CardDatabaseModel(db, true, this);
|
databaseModel = new CardDatabaseModel(db, true, this);
|
||||||
|
|
@ -1073,6 +1074,12 @@ void TabDeckEditor::actDecrementCardFromSideboard()
|
||||||
decrementCardHelper(DECK_ZONE_SIDE);
|
decrementCardHelper(DECK_ZONE_SIDE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TabDeckEditor::copyDatabaseCellContents()
|
||||||
|
{
|
||||||
|
QVariant data = databaseView->selectionModel()->currentIndex().data();
|
||||||
|
QApplication::clipboard()->setText(data.toString());
|
||||||
|
}
|
||||||
|
|
||||||
void TabDeckEditor::actIncrement()
|
void TabDeckEditor::actIncrement()
|
||||||
{
|
{
|
||||||
const QModelIndex ¤tIndex = deckView->selectionModel()->currentIndex();
|
const QModelIndex ¤tIndex = deckView->selectionModel()->currentIndex();
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,7 @@ private slots:
|
||||||
void actDecrement();
|
void actDecrement();
|
||||||
void actDecrementCard();
|
void actDecrementCard();
|
||||||
void actDecrementCardFromSideboard();
|
void actDecrementCardFromSideboard();
|
||||||
|
void copyDatabaseCellContents();
|
||||||
|
|
||||||
void saveDeckRemoteFinished(const Response &r);
|
void saveDeckRemoteFinished(const Response &r);
|
||||||
void filterViewCustomContextMenu(const QPoint &point);
|
void filterViewCustomContextMenu(const QPoint &point);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue