Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
6992cc80
Commit
6992cc80
authored
Feb 06, 2009
by
coppro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New 'show spelling errors' option in the preferences window.
parent
97ff17e5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
27 deletions
+41
-27
data/en.mse-locale/locale
data/en.mse-locale/locale
+2
-1
src/data/settings.cpp
src/data/settings.cpp
+15
-12
src/data/settings.hpp
src/data/settings.hpp
+1
-0
src/gui/preferences_window.cpp
src/gui/preferences_window.cpp
+18
-14
src/resource/common/expected_locale_keys
src/resource/common/expected_locale_keys
+1
-0
src/script/functions/spelling.cpp
src/script/functions/spelling.cpp
+4
-0
No files found.
data/en.mse-locale/locale
View file @
6992cc80
mse
version
:
0.3.8
mse
version
:
0.3.8
installer
group
:
translations
/
English
full
name
:
English
version
:
2008
-
08
-
08
...
...
@@ -571,6 +571,7 @@ button:
show
lines
:
Show
&
lines
around
fields
show
editing
hints
:
Show
boxes
and
hints
for
&
editing
zoom
export
:
Use
zoom
and
rotation
settings
when
e
&
xporting
spellcheck
enabled
:
Show
&
spelling
errors
on
cards
check
now
:
Check
&
Now
always
:
Always
if
internet
connection
exists
:
If
internet
connection
exists
...
...
src/data/settings.cpp
View file @
6992cc80
...
...
@@ -123,21 +123,23 @@ IMPLEMENT_REFLECTION_NO_SCRIPT(GameSettings) {
StyleSheetSettings
::
StyleSheetSettings
()
:
card_zoom
(
1.0
,
true
)
,
card_angle
(
0
,
true
)
,
card_anti_alias
(
true
,
true
)
,
card_borders
(
true
,
true
)
,
card_draw_editing
(
true
,
true
)
,
card_normal_export
(
true
,
true
)
:
card_zoom
(
1.0
,
true
)
,
card_angle
(
0
,
true
)
,
card_anti_alias
(
true
,
true
)
,
card_borders
(
true
,
true
)
,
card_draw_editing
(
true
,
true
)
,
card_normal_export
(
true
,
true
)
,
card_spellcheck_enabled
(
true
,
true
)
{}
void
StyleSheetSettings
::
useDefault
(
const
StyleSheetSettings
&
ss
)
{
if
(
card_zoom
.
isDefault
())
card_zoom
.
assignDefault
(
ss
.
card_zoom
);
if
(
card_angle
.
isDefault
())
card_angle
.
assignDefault
(
ss
.
card_angle
);
if
(
card_anti_alias
.
isDefault
())
card_anti_alias
.
assignDefault
(
ss
.
card_anti_alias
);
if
(
card_borders
.
isDefault
())
card_borders
.
assignDefault
(
ss
.
card_borders
);
if
(
card_draw_editing
.
isDefault
())
card_draw_editing
.
assignDefault
(
ss
.
card_draw_editing
);
if
(
card_normal_export
.
isDefault
())
card_normal_export
.
assignDefault
(
ss
.
card_normal_export
);
if
(
card_zoom
.
isDefault
())
card_zoom
.
assignDefault
(
ss
.
card_zoom
);
if
(
card_angle
.
isDefault
())
card_angle
.
assignDefault
(
ss
.
card_angle
);
if
(
card_anti_alias
.
isDefault
())
card_anti_alias
.
assignDefault
(
ss
.
card_anti_alias
);
if
(
card_borders
.
isDefault
())
card_borders
.
assignDefault
(
ss
.
card_borders
);
if
(
card_draw_editing
.
isDefault
())
card_draw_editing
.
assignDefault
(
ss
.
card_draw_editing
);
if
(
card_normal_export
.
isDefault
())
card_normal_export
.
assignDefault
(
ss
.
card_normal_export
);
if
(
card_spellcheck_enabled
.
isDefault
())
card_spellcheck_enabled
.
assignDefault
(
ss
.
card_spellcheck_enabled
);
}
IMPLEMENT_REFLECTION_NO_SCRIPT
(
StyleSheetSettings
)
{
...
...
@@ -147,6 +149,7 @@ IMPLEMENT_REFLECTION_NO_SCRIPT(StyleSheetSettings) {
REFLECT
(
card_borders
);
REFLECT
(
card_draw_editing
);
REFLECT
(
card_normal_export
);
REFLECT
(
card_spellcheck_enabled
);
}
// ----------------------------------------------------------------------------- : Settings
...
...
src/data/settings.hpp
View file @
6992cc80
...
...
@@ -103,6 +103,7 @@ class StyleSheetSettings : public IntrusivePtrBase<StyleSheetSettings> {
Defaultable
<
bool
>
card_borders
;
Defaultable
<
bool
>
card_draw_editing
;
Defaultable
<
bool
>
card_normal_export
;
Defaultable
<
bool
>
card_spellcheck_enabled
;
/// Where the settings are the default, use the value from ss
void
useDefault
(
const
StyleSheetSettings
&
ss
);
...
...
src/gui/preferences_window.cpp
View file @
6992cc80
...
...
@@ -54,7 +54,7 @@ class DisplayPreferencesPage : public PreferencesPage {
private:
DECLARE_EVENT_TABLE
();
wxCheckBox
*
high_quality
,
*
borders
,
*
draw_editing
;
wxCheckBox
*
high_quality
,
*
borders
,
*
draw_editing
,
*
spellcheck_enabled
;
#if USE_ZOOM_COMBOBOX
wxComboBox
*
zoom
;
int
zoom_int
;
...
...
@@ -195,9 +195,10 @@ DisplayPreferencesPage::DisplayPreferencesPage(Window* parent)
:
PreferencesPage
(
parent
)
{
// init controls
high_quality
=
new
wxCheckBox
(
this
,
wxID_ANY
,
_BUTTON_
(
"high quality"
));
borders
=
new
wxCheckBox
(
this
,
wxID_ANY
,
_BUTTON_
(
"show lines"
));
draw_editing
=
new
wxCheckBox
(
this
,
wxID_ANY
,
_BUTTON_
(
"show editing hints"
));
high_quality
=
new
wxCheckBox
(
this
,
wxID_ANY
,
_BUTTON_
(
"high quality"
));
borders
=
new
wxCheckBox
(
this
,
wxID_ANY
,
_BUTTON_
(
"show lines"
));
draw_editing
=
new
wxCheckBox
(
this
,
wxID_ANY
,
_BUTTON_
(
"show editing hints"
));
spellcheck_enabled
=
new
wxCheckBox
(
this
,
wxID_ANY
,
_BUTTON_
(
"spellcheck enabled"
));
#if USE_ZOOM_COMBOBOX
zoom
=
new
wxComboBox
(
this
,
ID_ZOOM
);
#else
...
...
@@ -206,10 +207,11 @@ DisplayPreferencesPage::DisplayPreferencesPage(Window* parent)
non_normal_export
=
new
wxCheckBox
(
this
,
wxID_ANY
,
_BUTTON_
(
"zoom export"
));
//wxButton* columns = new wxButton(this, ID_SELECT_COLUMNS, _BUTTON_("select"));
// set values
high_quality
->
SetValue
(
settings
.
default_stylesheet_settings
.
card_anti_alias
());
borders
->
SetValue
(
settings
.
default_stylesheet_settings
.
card_borders
());
draw_editing
->
SetValue
(
settings
.
default_stylesheet_settings
.
card_draw_editing
());
non_normal_export
->
SetValue
(
!
settings
.
default_stylesheet_settings
.
card_normal_export
());
high_quality
->
SetValue
(
settings
.
default_stylesheet_settings
.
card_anti_alias
());
borders
->
SetValue
(
settings
.
default_stylesheet_settings
.
card_borders
());
draw_editing
->
SetValue
(
settings
.
default_stylesheet_settings
.
card_draw_editing
());
spellcheck_enabled
->
SetValue
(
settings
.
default_stylesheet_settings
.
card_spellcheck_enabled
());
non_normal_export
->
SetValue
(
!
settings
.
default_stylesheet_settings
.
card_normal_export
());
#if USE_ZOOM_COMBOBOX
zoom_int
=
static_cast
<
int
>
(
settings
.
default_stylesheet_settings
.
card_zoom
()
*
100
);
zoom
->
SetValue
(
String
::
Format
(
_
(
"%d%%"
),
zoom_int
));
...
...
@@ -224,9 +226,10 @@ DisplayPreferencesPage::DisplayPreferencesPage(Window* parent)
// init sizer
wxSizer
*
s
=
new
wxBoxSizer
(
wxVERTICAL
);
wxSizer
*
s2
=
new
wxStaticBoxSizer
(
wxVERTICAL
,
this
,
_LABEL_
(
"card display"
));
s2
->
Add
(
high_quality
,
0
,
wxEXPAND
|
wxALL
,
4
);
s2
->
Add
(
borders
,
0
,
wxEXPAND
|
wxALL
,
4
);
s2
->
Add
(
draw_editing
,
0
,
wxEXPAND
|
wxALL
,
4
);
s2
->
Add
(
high_quality
,
0
,
wxEXPAND
|
wxALL
,
4
);
s2
->
Add
(
borders
,
0
,
wxEXPAND
|
wxALL
,
4
);
s2
->
Add
(
draw_editing
,
0
,
wxEXPAND
|
wxALL
,
4
);
s2
->
Add
(
spellcheck_enabled
,
0
,
wxEXPAND
|
wxALL
,
4
);
wxSizer
*
s3
=
new
wxBoxSizer
(
wxHORIZONTAL
);
s3
->
Add
(
new
wxStaticText
(
this
,
wxID_ANY
,
_LABEL_
(
"zoom"
)),
0
,
wxALL
&
~
wxLEFT
,
4
);
s3
->
AddSpacer
(
2
);
...
...
@@ -249,9 +252,10 @@ DisplayPreferencesPage::DisplayPreferencesPage(Window* parent)
}
void
DisplayPreferencesPage
::
store
()
{
settings
.
default_stylesheet_settings
.
card_anti_alias
=
high_quality
->
GetValue
();
settings
.
default_stylesheet_settings
.
card_borders
=
borders
->
GetValue
();
settings
.
default_stylesheet_settings
.
card_draw_editing
=
draw_editing
->
GetValue
();
settings
.
default_stylesheet_settings
.
card_anti_alias
=
high_quality
->
GetValue
();
settings
.
default_stylesheet_settings
.
card_borders
=
borders
->
GetValue
();
settings
.
default_stylesheet_settings
.
card_draw_editing
=
draw_editing
->
GetValue
();
settings
.
default_stylesheet_settings
.
card_spellcheck_enabled
=
spellcheck_enabled
->
GetValue
();
#if USE_ZOOM_COMBOBOX
updateZoom
();
settings
.
default_stylesheet_settings
.
card_zoom
=
zoom_int
/
100.0
;
...
...
src/resource/common/expected_locale_keys
View file @
6992cc80
...
...
@@ -84,6 +84,7 @@ button:
select all: 0
select cards: 0
select none: 0
spellcheck enabled: 0
show: 0
show editing hints: 0
show lines: 0
...
...
src/script/functions/spelling.cpp
View file @
6992cc80
...
...
@@ -12,6 +12,7 @@
#include <script/functions/util.hpp>
#include <util/spell_checker.hpp>
#include <util/tagged_string.hpp>
#include <data/stylesheet.hpp>
// ----------------------------------------------------------------------------- : Functions
...
...
@@ -89,9 +90,12 @@ void check_word(const String& tag, const String& input, String& out, Char sep, s
}
SCRIPT_FUNCTION
(
check_spelling
)
{
SCRIPT_PARAM_C
(
StyleSheetP
,
stylesheet
);
SCRIPT_PARAM_C
(
String
,
language
);
SCRIPT_PARAM_C
(
String
,
input
);
assert_tagged
(
input
);
if
(
!
settings
.
stylesheetSettingsFor
(
*
stylesheet
).
card_spellcheck_enabled
)
SCRIPT_RETURN
(
input
);
SCRIPT_OPTIONAL_PARAM_N_
(
String
,
_
(
"extra dictionary"
),
extra_dictionary
);
SCRIPT_OPTIONAL_PARAM_N_
(
ScriptValueP
,
_
(
"extra match"
),
extra_match
);
// remove old spelling error tags
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment