Commit 43d47e10 authored by twanvl's avatar twanvl

implemented apprentice export

parent d302d206
...@@ -47,7 +47,7 @@ menu: ...@@ -47,7 +47,7 @@ menu:
add keyword: &Add Keyword Ctrl++ add keyword: &Add Keyword Ctrl++
remove keyword: &Remove Select Keyword Del remove keyword: &Remove Select Keyword Del
format: &Format format: F&ormat
bold: &Bold Ctrl+B bold: &Bold Ctrl+B
italic: &Italic Ctrl+I italic: &Italic Ctrl+I
symbols: &Symbols Ctrl+M symbols: &Symbols Ctrl+M
...@@ -161,6 +161,9 @@ help: ...@@ -161,6 +161,9 @@ help:
(When off, the cards are exported (When off, the cards are exported
and copied at 100% size and normal rotation) and copied at 100% size and normal rotation)
# apprentice export
set code: A set code is a two character code that is used by Apprentice to refer to a set.
# Symbol editor # Symbol editor
new symbol: Create a new symbol new symbol: Create a new symbol
open symbol: Open a symbol open symbol: Open a symbol
...@@ -366,6 +369,10 @@ label: ...@@ -366,6 +369,10 @@ label:
cards to export: Cards to export cards to export: Cards to export
filename is ignored: (filename is ignored) filename is ignored: (filename is ignored)
# apprentice export
set code: Set &Code:
apprentice export cancled: Export to Apprentice is cancled
# Image slicer # Image slicer
original: Original: original: Original:
result: Result: result: Result:
...@@ -443,6 +450,7 @@ title: ...@@ -443,6 +450,7 @@ title:
print preview: Print Preview print preview: Print Preview
# export # export
export images: Export Images export images: Export Images
export cancled: Export Cancled
############################################################## Action (undo/redo) names ############################################################## Action (undo/redo) names
action: action:
......
...@@ -55,6 +55,16 @@ class Card { ...@@ -55,6 +55,16 @@ class Card {
} }
throw InternalError(_("Expected a card field with name '")+name+_("'")); throw InternalError(_("Expected a card field with name '")+name+_("'"));
} }
template <typename T> const T& value(const String& name) const {
for(IndexMap<FieldP, ValueP>::const_iterator it = data.begin() ; it != data.end() ; ++it) {
if ((*it)->fieldP->name == name) {
const T* ret = dynamic_cast<const T*>(it->get());
if (!ret) throw InternalError(_("Card field with name '")+name+_("' doesn't have the right type"));
return *ret;
}
}
throw InternalError(_("Expected a card field with name '")+name+_("'"));
}
DECLARE_REFLECTION(); DECLARE_REFLECTION();
}; };
......
This diff is collapsed.
...@@ -94,5 +94,8 @@ Bitmap export_bitmap(const SetP& set, const CardP& card); ...@@ -94,5 +94,8 @@ Bitmap export_bitmap(const SetP& set, const CardP& card);
/// Export a set to Magic Workstation format /// Export a set to Magic Workstation format
void export_mws(Window* parent, const SetP& set); void export_mws(Window* parent, const SetP& set);
/// Export a set to Apprentice
void export_apprentice(Window* parent, const SetP& set);
// ----------------------------------------------------------------------------- : EOF // ----------------------------------------------------------------------------- : EOF
#endif #endif
...@@ -458,8 +458,7 @@ void SetWindow::onFileExportHTML(wxCommandEvent&) { ...@@ -458,8 +458,7 @@ void SetWindow::onFileExportHTML(wxCommandEvent&) {
} }
void SetWindow::onFileExportApprentice(wxCommandEvent&) { void SetWindow::onFileExportApprentice(wxCommandEvent&) {
// ApprenticeExportWindow wnd(&this, set); export_apprentice(this, set);
// wnd.ShowModal();
} }
void SetWindow::onFileExportMWS(wxCommandEvent&) { void SetWindow::onFileExportMWS(wxCommandEvent&) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment