mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Reduce coupling between ValueEditors/Viewers and Set and StyleSheet.
- Adding of actions is done with an addAction function
- Files are read from
- getStylePackage for styling stuff (this is stylesheet)
- getLocalPackage for symbol and image values (this was the set)
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@970 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -26,7 +26,7 @@ ActionStack::~ActionStack() {
|
||||
FOR_EACH(a, redo_actions) delete a;
|
||||
}
|
||||
|
||||
void ActionStack::add(Action* action, bool allow_merge) {
|
||||
void ActionStack::addAction(Action* action, bool allow_merge) {
|
||||
if (!action) return; // no action
|
||||
action->perform(false); // TODO: delete action if perform throws
|
||||
tellListeners(*action, false);
|
||||
|
||||
@@ -67,9 +67,11 @@ class ActionStack {
|
||||
~ActionStack();
|
||||
|
||||
/// Add an action to the stack, and perform that action.
|
||||
/// Tells all listeners about the action.
|
||||
/// The ActionStack takes ownership of the action
|
||||
void add(Action* action, bool allowMerge = true);
|
||||
/** Tells all listeners about the action.
|
||||
* The ActionStack takes ownership of the action.
|
||||
* If allow_merge == true then we attempt to merge this action with previous ones
|
||||
*/
|
||||
void addAction(Action* action, bool allow_merge = true);
|
||||
|
||||
/// Undoes the last action that was (re)done
|
||||
/** @pre canUndo() */
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <util/prec.hpp>
|
||||
#include <util/string.hpp>
|
||||
|
||||
class Package;
|
||||
class Game;
|
||||
class StyleSheet;
|
||||
class SymbolFont;
|
||||
@@ -46,6 +47,8 @@ String warn_and_identity(const String&);
|
||||
/// Translate 'key' in the category 'cat' using the current locale
|
||||
String tr(LocaleCategory cat, const String& key, DefaultLocaleFun def = warn_and_identity);
|
||||
|
||||
/// Translate 'key' in the for a Package using the current locale
|
||||
String tr(const Package&, const String& key, DefaultLocaleFun def);
|
||||
/// Translate 'key' in the for a Game using the current locale
|
||||
String tr(const Game&, const String& key, DefaultLocaleFun def);
|
||||
/// Translate 'key' in the for a StyleSheet using the current locale
|
||||
|
||||
Reference in New Issue
Block a user