mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
Allow multiple cards to be selected in a card list,
Allow card actions to add/remove multiple cards. not yet: actually use these multicard actions. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@853 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -57,10 +57,10 @@ void KeywordList::onChangeSet() {
|
||||
}
|
||||
|
||||
void KeywordList::onAction(const Action& action, bool undone) {
|
||||
TYPE_CASE(action, AddKeywordAction) {
|
||||
/*TYPE_CASE(action, AddKeywordAction) {
|
||||
if (action.adding != undone) {
|
||||
// select the new keyword
|
||||
selectItem(action.keyword, false /*list will be refreshed anyway*/, true);
|
||||
selectItem(action.keyword, false /*list will be refreshed anyway* /, true);
|
||||
refreshList();
|
||||
} else {
|
||||
long pos = selected_item_pos;
|
||||
@@ -74,7 +74,7 @@ void KeywordList::onAction(const Action& action, bool undone) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/ // TODO!!!
|
||||
TYPE_CASE(action, ValueAction) {
|
||||
if (!action.card) {
|
||||
KeywordTextValue* value = dynamic_cast<KeywordTextValue*>(action.valueP.get());
|
||||
@@ -117,7 +117,7 @@ bool KeywordList::doCut() {
|
||||
// cut = copy + delete
|
||||
if (!canCut()) return false;
|
||||
if (!doCopy()) return false;
|
||||
set->actions.add(new AddKeywordAction(REMOVE, *set, getKeyword()));
|
||||
doDelete();
|
||||
return true;
|
||||
}
|
||||
bool KeywordList::doPaste() {
|
||||
@@ -137,6 +137,10 @@ bool KeywordList::doPaste() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
bool KeywordList::doDelete() {
|
||||
set->actions.add(new AddKeywordAction(REMOVE, *set, getKeyword()));
|
||||
return true;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : KeywordListBase : for ItemList
|
||||
|
||||
|
||||
Reference in New Issue
Block a user