diff --git a/data/en.mse-locale/locale b/data/en.mse-locale/locale index 97302823..62da7d3e 100644 --- a/data/en.mse-locale/locale +++ b/data/en.mse-locale/locale @@ -102,8 +102,11 @@ help: undo: Undoes the last action redo: Redoes the last action cut: Move the selected text to the clipboard + cut card: Move the selected card to the clipboard copy: Place the selected text on the clipboard + copy card: Place the selected card on the clipboard paste: Inserts the text from the clipboard + paste card: Inserts the card from the clipboard preferences: Change the configuration of Not Quite Magic Set Editor cards: @@ -197,6 +200,9 @@ help: drag to move curve: Drag to move curve drag to move line: Alt + drag to move curve; double click to add a point on this line drag to move point: Click and drag to move control point; double click to remove the point + + # Card select + filename format: (Use {card.name} for the name of the card ; The filetype is determined based on the extension) ############################################################## Toolbar tool: @@ -304,6 +310,9 @@ tooltip: label: card notes: Card notes: + # Open dialogs + all files All files + # Preferences language: Language app language: Language of the user interface: @@ -324,8 +333,13 @@ label: select columns: Select the columns you want to display columns: Columns: - # Card select - select cards print: Select the cards you want to print + # Card select / images export + select cards print: Select the cards you want to print + filename format: &Format: + filename conflicts: &Handle duplicating filenames: + export filenames: Filenames + cards to export: Cards to export + filename is ignored: (filename is ignored) # Image slicer original: Original: @@ -368,6 +382,10 @@ button: # Card select select all: Select &All select none: Select &None + overwrite: Overwrite old files + keep old: Keep old files + number: Add a number to the filename + number overwrite: Add a number to the filename, overwrite previous exports # Update checker close: &Close @@ -393,10 +411,13 @@ title: # select select columns: Select Columns select cards: Select Cards + select cards export:Select Cards to Export # slice slice image: Slice Image # print print preview: Print Preview + # export + export images: Export Images ############################################################## Action (undo/redo) names action: diff --git a/src/data/settings.cpp b/src/data/settings.cpp index d1bd44fb..332f24ab 100644 --- a/src/data/settings.cpp +++ b/src/data/settings.cpp @@ -26,6 +26,13 @@ IMPLEMENT_REFLECTION_ENUM(CheckUpdates) { VALUE_N("never", CHECK_NEVER); } +IMPLEMENT_REFLECTION_ENUM(FilenameConflicts) { + VALUE_N("keep old", CONFLICT_KEEP_OLD); + VALUE_N("overwrite", CONFLICT_OVERWRITE); + VALUE_N("number", CONFLICT_NUMBER); + VALUE_N("number overwrite", CONFLICT_NUMBER_OVERWRITE); +} + const int COLUMN_NOT_INITIALIZED = -100000; ColumnSettings::ColumnSettings() @@ -43,6 +50,8 @@ IMPLEMENT_REFLECTION(ColumnSettings) { GameSettings::GameSettings() : sort_cards_ascending(true) + , images_export_filename(_("{card.name}.jpg")) + , images_export_conflicts(CONFLICT_NUMBER_OVERWRITE) {} IMPLEMENT_REFLECTION(GameSettings) { @@ -51,6 +60,8 @@ IMPLEMENT_REFLECTION(GameSettings) { REFLECT_N("cardlist columns", columns); REFLECT(sort_cards_by); REFLECT(sort_cards_ascending); + REFLECT(images_export_filename); + REFLECT(images_export_conflicts); } diff --git a/src/data/settings.hpp b/src/data/settings.hpp index 04c7679c..79536895 100644 --- a/src/data/settings.hpp +++ b/src/data/settings.hpp @@ -29,6 +29,14 @@ enum CheckUpdates , CHECK_NEVER }; +/// How to handle filename conflicts +enum FilenameConflicts +{ CONFLICT_KEEP_OLD // always keep old file +, CONFLICT_OVERWRITE // always overwrite +, CONFLICT_NUMBER // always add numbers ("file.1.something") +, CONFLICT_NUMBER_OVERWRITE // only add numbers for conflicts inside a set, overwrite old stuff +}; + /// Settings of a single column in the card list class ColumnSettings { public: @@ -50,6 +58,8 @@ class GameSettings { map columns; String sort_cards_by; bool sort_cards_ascending; + String images_export_filename; + FilenameConflicts images_export_conflicts; DECLARE_REFLECTION(); }; diff --git a/src/data/statistics.cpp b/src/data/statistics.cpp index d217125c..bc8bc243 100644 --- a/src/data/statistics.cpp +++ b/src/data/statistics.cpp @@ -57,8 +57,9 @@ StatsCategory::StatsCategory(const StatsDimensionP& dim) {} IMPLEMENT_REFLECTION_ENUM(GraphType) { - VALUE_N("bar", GRAPH_TYPE_BAR); - VALUE_N("pie", GRAPH_TYPE_PIE); + VALUE_N("bar", GRAPH_TYPE_BAR); + VALUE_N("pie", GRAPH_TYPE_PIE); + VALUE_N("scatter", GRAPH_TYPE_SCATTER); } IMPLEMENT_REFLECTION(StatsCategory) { diff --git a/src/data/statistics.hpp b/src/data/statistics.hpp index c2902079..c0cfa563 100644 --- a/src/data/statistics.hpp +++ b/src/data/statistics.hpp @@ -42,6 +42,7 @@ class StatsDimension { enum GraphType { GRAPH_TYPE_BAR , GRAPH_TYPE_PIE +, GRAPH_TYPE_SCATTER }; /// A category for statistics diff --git a/src/gui/card_select_window.cpp b/src/gui/card_select_window.cpp index 717aadf6..4c65613e 100644 --- a/src/gui/card_select_window.cpp +++ b/src/gui/card_select_window.cpp @@ -12,27 +12,31 @@ // ----------------------------------------------------------------------------- : CardSelectWindow -CardSelectWindow::CardSelectWindow(Window* parent, const SetP& set, const String& label) +CardSelectWindow::CardSelectWindow(Window* parent, const SetP& set, const String& label, const String& title, bool sizer) : wxDialog(parent, wxID_ANY, _TITLE_("select cards"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) , set(set) { // init controls list = new SelectCardList(this, wxID_ANY); list->setSet(set); - wxButton* sel_all = new wxButton(this, ID_SELECT_ALL, _BUTTON_("select all")); - wxButton* sel_none = new wxButton(this, ID_SELECT_NONE, _BUTTON_("select none")); + sel_all = new wxButton(this, ID_SELECT_ALL, _BUTTON_("select all")); + sel_none = new wxButton(this, ID_SELECT_NONE, _BUTTON_("select none")); // init sizers - wxSizer* s = new wxBoxSizer(wxVERTICAL); - s->Add(new wxStaticText(this, wxID_ANY, label), 0, wxALL & ~wxBOTTOM, 8); - s->Add(list, 1, wxEXPAND | wxALL, 8); - wxSizer* s2 = new wxBoxSizer(wxHORIZONTAL); - s2->Add(sel_all, 0, wxEXPAND | wxRIGHT, 8); - s2->Add(sel_none, 0, wxEXPAND | wxRIGHT, 8); - s2->Add(CreateButtonSizer(wxOK | wxCANCEL), 1, wxEXPAND, 8); - s->Add(s2, 0, wxEXPAND | wxALL & ~wxTOP, 8); - s->SetSizeHints(this); - SetSizer(s); - SetSize(500,500); + if (sizer) { + wxSizer* s = new wxBoxSizer(wxVERTICAL); + if (!label.empty()) { + s->Add(new wxStaticText(this, wxID_ANY, label), 0, wxALL & ~wxBOTTOM, 8); + } + s->Add(list, 1, wxEXPAND | wxALL, 8); + wxSizer* s2 = new wxBoxSizer(wxHORIZONTAL); + s2->Add(sel_all, 0, wxEXPAND | wxRIGHT, 8); + s2->Add(sel_none, 0, wxEXPAND | wxRIGHT, 8); + s2->Add(CreateButtonSizer(wxOK | wxCANCEL), 1, wxEXPAND, 8); + s->Add(s2, 0, wxEXPAND | wxALL & ~wxTOP, 8); + s->SetSizeHints(this); + SetSizer(s); + SetSize(500,500); + } } bool CardSelectWindow::isSelected(const CardP& card) const { @@ -46,7 +50,7 @@ void CardSelectWindow::onSelectNone(wxCommandEvent&) { list->selectNone(); } -BEGIN_EVENT_TABLE(CardSelectWindow,wxDialog) +BEGIN_EVENT_TABLE(CardSelectWindow, wxDialog) EVT_BUTTON (ID_SELECT_ALL, CardSelectWindow::onSelectAll) EVT_BUTTON (ID_SELECT_NONE, CardSelectWindow::onSelectNone) END_EVENT_TABLE () diff --git a/src/gui/card_select_window.hpp b/src/gui/card_select_window.hpp index 9d766ae4..05eaeaeb 100644 --- a/src/gui/card_select_window.hpp +++ b/src/gui/card_select_window.hpp @@ -22,7 +22,7 @@ class SelectCardList; */ class CardSelectWindow : public wxDialog { public: - CardSelectWindow(Window* parent, const SetP& set, const String& label); + CardSelectWindow(Window* parent, const SetP& set, const String& label, const String& title, bool sizer=true); /// Is the given card selected? bool isSelected(const CardP& card) const; @@ -32,6 +32,7 @@ class CardSelectWindow : public wxDialog { SelectCardList* list; SetP set; + wxButton* sel_all, *sel_none; void onSelectAll (wxCommandEvent&); void onSelectNone(wxCommandEvent&); diff --git a/src/gui/images_export_window.cpp b/src/gui/images_export_window.cpp new file mode 100644 index 00000000..cc6a2428 --- /dev/null +++ b/src/gui/images_export_window.cpp @@ -0,0 +1,120 @@ +//+----------------------------------------------------------------------------+ +//| Description: Magic Set Editor - Program to make Magic (tm) cards | +//| Copyright: (C) 2001 - 2006 Twan van Laarhoven | +//| License: GNU General Public License 2 or later (see file COPYING) | +//+----------------------------------------------------------------------------+ + +// ----------------------------------------------------------------------------- : Includes + +#include +#include +#include +#include +#include +#include