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
86ba08c8
Commit
86ba08c8
authored
Sep 15, 2007
by
coppro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some fixes
More work on update window.
parent
2f3fcf44
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
90 additions
and
32 deletions
+90
-32
src/data/format/apprentice.cpp
src/data/format/apprentice.cpp
+2
-1
src/data/installer.hpp
src/data/installer.hpp
+14
-0
src/data/settings.cpp
src/data/settings.cpp
+9
-0
src/data/settings.hpp
src/data/settings.hpp
+12
-0
src/gui/auto_replace_window.cpp
src/gui/auto_replace_window.cpp
+1
-1
src/gui/update_checker.cpp
src/gui/update_checker.cpp
+26
-13
src/gui/update_checker.hpp
src/gui/update_checker.hpp
+3
-2
src/gui/value/text.cpp
src/gui/value/text.cpp
+1
-1
src/main.cpp
src/main.cpp
+6
-5
src/resource/common/expected_locale_keys
src/resource/common/expected_locale_keys
+5
-0
src/script/image.cpp
src/script/image.cpp
+1
-1
src/util/string.hpp
src/util/string.hpp
+7
-7
src/util/window_id.hpp
src/util/window_id.hpp
+3
-1
No files found.
src/data/format/apprentice.cpp
View file @
86ba08c8
...
...
@@ -32,6 +32,7 @@ String card_rarity_code(const String& rarity);
class
WithProgress
{
public:
virtual
void
onProgress
(
float
progress
,
const
String
&
message
)
=
0
;
virtual
~
WithProgress
()
{}
};
/// Exception thrown to indicate exporting should be aborted
...
...
@@ -64,7 +65,7 @@ void ExportProgressDialog::onProgress(float progress, const String& message) {
class
ApprDatabase
{
public:
ApprDatabase
(
WithProgress
*
progress_target
,
const
String
&
name
);
~
ApprDatabase
();
virtual
~
ApprDatabase
();
/// Read the database
void
read
();
...
...
src/data/installer.hpp
View file @
86ba08c8
...
...
@@ -9,9 +9,23 @@
// ----------------------------------------------------------------------------- : Includes
#include <data/settings.hpp>
#include <util/prec.hpp>
#include <util/io/package.hpp>
// ----------------------------------------------------------------------------- : InstallType
// Platform default install directory.
#ifdef __WXMSW__
#define DEFAULT_INSTALL_LOCAL false
#else
#define DEFAULT_INSTALL_LOCAL true
#endif
inline
bool
isInstallLocal
(
const
InstallType
&
type
)
{
return
type
==
INSTALL_DEFAULT
?
DEFAULT_INSTALL_LOCAL
:
type
==
INSTALL_LOCAL
;
}
// ----------------------------------------------------------------------------- : Installer
/// A package that contains other packages that can be installed
...
...
src/data/settings.cpp
View file @
86ba08c8
...
...
@@ -7,6 +7,7 @@
// ----------------------------------------------------------------------------- : Includes
#include <data/settings.hpp>
#include <data/installer.hpp>
#include <data/game.hpp>
#include <data/stylesheet.hpp>
#include <data/field.hpp>
...
...
@@ -31,6 +32,12 @@ IMPLEMENT_REFLECTION_ENUM(CheckUpdates) {
VALUE_N
(
"never"
,
CHECK_NEVER
);
}
IMPLEMENT_REFLECTION_ENUM
(
InstallType
)
{
VALUE_N
(
"default"
,
INSTALL_DEFAULT
);
//default
VALUE_N
(
"local"
,
INSTALL_LOCAL
);
VALUE_N
(
"global"
,
INSTALL_GLOBAL
);
}
IMPLEMENT_REFLECTION_ENUM
(
FilenameConflicts
)
{
VALUE_N
(
"keep old"
,
CONFLICT_KEEP_OLD
);
VALUE_N
(
"overwrite"
,
CONFLICT_OVERWRITE
);
...
...
@@ -135,6 +142,7 @@ Settings::Settings()
,
symbol_grid_snap
(
false
)
,
updates_url
(
_
(
"http://magicseteditor.sourceforge.net/updates"
))
,
check_updates
(
CHECK_IF_CONNECTED
)
,
install_type
(
INSTALL_DEFAULT
)
,
website_url
(
_
(
"http://magicseteditor.sourceforge.net/"
))
{}
...
...
@@ -212,6 +220,7 @@ IMPLEMENT_REFLECTION_NO_SCRIPT(Settings) {
REFLECT
(
apprentice_location
);
REFLECT
(
updates_url
);
REFLECT
(
check_updates
);
REFLECT
(
install_type
);
REFLECT
(
website_url
);
REFLECT
(
game_settings
);
REFLECT
(
stylesheet_settings
);
...
...
src/data/settings.hpp
View file @
86ba08c8
...
...
@@ -33,6 +33,15 @@ enum CheckUpdates
,
CHECK_NEVER
};
/// Where to install to?
enum
InstallType
{
INSTALL_DEFAULT
// the platform default.
,
INSTALL_LOCAL
// install to the user's files
,
INSTALL_GLOBAL
// install to the global files
};
bool
parse_enum
(
const
String
&
,
InstallType
&
);
/// How to handle filename conflicts
enum
FilenameConflicts
{
CONFLICT_KEEP_OLD
// always keep old file
...
...
@@ -161,6 +170,9 @@ class Settings {
CheckUpdates
check_updates
;
String
website_url
;
// --------------------------------------------------- : Installation settings
InstallType
install_type
;
// --------------------------------------------------- : The io
/// Read the settings file from the standard location
...
...
src/gui/auto_replace_window.cpp
View file @
86ba08c8
...
...
@@ -103,7 +103,7 @@ void AutoReplaceList::removeSelected() {
items
.
erase
(
items
.
begin
()
+
i
);
// select next
refreshList
();
selectItem
(
items
.
empty
()
?
VoidP
()
:
items
[
min
(
i
,
items
.
size
())]
,
true
,
true
);
selectItem
(
items
.
empty
()
?
VoidP
()
:
VoidP
(
items
[
min
(
i
,
items
.
size
())])
,
true
,
true
);
return
;
}
}
...
...
src/gui/update_checker.cpp
View file @
86ba08c8
...
...
@@ -302,12 +302,13 @@ END_EVENT_TABLE()
// ----------------------------------------------------------------------------- : UpdateWindow
UpdatesWindow
::
UpdatesWindow
()
:
Frame
(
nullptr
,
wxID_ANY
,
_TITLE_
(
"package list"
),
wxDefaultPosition
,
wxSize
(
480
,
4
0
0
),
wxDEFAULT_DIALOG_STYLE
|
wxCLIP_CHILDREN
)
:
Frame
(
nullptr
,
wxID_ANY
,
_TITLE_
(
"package list"
),
wxDefaultPosition
,
wxSize
(
480
,
4
4
0
),
wxDEFAULT_DIALOG_STYLE
|
wxCLIP_CHILDREN
)
{
SetIcon
(
wxIcon
());
wxBoxSizer
*
v
=
new
wxBoxSizer
(
wxVERTICAL
);
wxBoxSizer
*
h1
=
new
wxBoxSizer
(
wxHORIZONTAL
);
wxBoxSizer
*
h2
=
new
wxBoxSizer
(
wxHORIZONTAL
);
wxBoxSizer
*
h3
=
new
wxBoxSizer
(
wxHORIZONTAL
);
package_list
=
new
PackageUpdateList
(
this
);
description_window
=
new
HtmlWindowToBrowser
(
this
,
wxID_ANY
,
wxDefaultPosition
,
wxSize
(
480
,
100
),
wxHW_SCROLLBAR_AUTO
|
wxSUNKEN_BORDER
);
...
...
@@ -322,10 +323,10 @@ UpdatesWindow::UpdatesWindow()
h1
->
Add
(
status_title
);
h1
->
Add
(
new_title
,
2
);
(
install_button
=
new
wxButton
(
this
,
ID_INSTALL
,
_
(
"Install
"
)))
->
Disable
();
(
upgrade_button
=
new
wxButton
(
this
,
ID_UPGRADE
,
_
(
"Updat
e"
)))
->
Disable
();
(
remove_button
=
new
wxButton
(
this
,
ID_REMOVE
,
_
(
"Remov
e"
)))
->
Disable
();
(
cancel_button
=
new
wxButton
(
this
,
ID_CANCEL
,
_
(
"Cancel
"
)))
->
Disable
();
(
install_button
=
new
wxButton
(
this
,
ID_INSTALL
,
_
MENU_
(
"install package
"
)))
->
Disable
();
(
upgrade_button
=
new
wxButton
(
this
,
ID_UPGRADE
,
_
MENU_
(
"upgrade packag
e"
)))
->
Disable
();
(
remove_button
=
new
wxButton
(
this
,
ID_REMOVE
,
_
MENU_
(
"remove packag
e"
)))
->
Disable
();
(
cancel_button
=
new
wxButton
(
this
,
ID_CANCEL
,
_
MENU_
(
"cancel changes
"
)))
->
Disable
();
h2
->
AddStretchSpacer
(
1
);
h2
->
Add
(
install_button
);
...
...
@@ -336,14 +337,22 @@ UpdatesWindow::UpdatesWindow()
h2
->
AddStretchSpacer
(
2
);
h2
->
Add
(
cancel_button
);
h2
->
AddStretchSpacer
(
1
);
apply_button
=
new
wxButton
(
this
,
ID_APPLY
,
_MENU_
(
"apply changes"
));
h3
->
AddStretchSpacer
(
1
);
h3
->
Add
(
apply_button
);
h3
->
AddStretchSpacer
(
1
);
v
->
Add
(
h1
);
v
->
Add
(
package_list
);
v
->
AddStretchSpacer
(
1
);
v
->
AddStretchSpacer
(
2
);
v
->
Add
(
description_window
);
v
->
AddStretchSpacer
(
1
);
v
->
AddStretchSpacer
(
2
);
v
->
Add
(
h2
);
v
->
AddStretchSpacer
(
1
);
v
->
Add
(
h3
);
v
->
AddStretchSpacer
(
2
);
SetSizer
(
v
);
}
...
...
@@ -356,7 +365,7 @@ void UpdatesWindow::onPackageSelect(wxCommandEvent& ev) {
updateButtons
(
ev
.
GetInt
());
}
void
UpdatesWindow
::
on
Button
(
wxCommandEvent
&
ev
)
{
void
UpdatesWindow
::
on
ActionChange
(
wxCommandEvent
&
ev
)
{
PackageVersionDataP
pack
=
update_version_data
->
packages
[
package_list
->
GetSelection
()];
PackageAction
&
action
=
package_data
[
pack
].
second
;
switch
(
ev
.
GetId
())
{
...
...
@@ -369,6 +378,9 @@ void UpdatesWindow::onButton(wxCommandEvent& ev) {
package_list
->
Refresh
();
}
void
UpdatesWindow
::
onApplyChanges
(
wxCommandEvent
&
ev
)
{
}
void
UpdatesWindow
::
updateButtons
(
int
id
)
{
PackageVersionDataP
pack
=
update_version_data
->
packages
[
id
];
...
...
@@ -405,7 +417,7 @@ void UpdatesWindow::setDefaultPackageStatus() {
FOR_EACH
(
p
,
update_version_data
->
packages
)
{
PackagedP
pack
;
try
{
pack
=
packages
.
openAny
(
p
->
name
,
true
);
}
catch
(
const
Error
&
)
{
}
// We couldn't open a package... wonder why?
catch
(
const
Package
Error
&
)
{
}
// We couldn't open a package... wonder why?
if
(
!
pack
)
{
// not installed
...
...
@@ -430,8 +442,9 @@ void UpdatesWindow::setDefaultPackageStatus() {
BEGIN_EVENT_TABLE
(
UpdatesWindow
,
Frame
)
EVT_COMMAND
(
wxID_ANY
,
UPDATE_CHECK_FINISHED_EVT
,
UpdatesWindow
::
onUpdateCheckFinished
)
EVT_LISTBOX
(
ID_PACKAGE_LIST
,
UpdatesWindow
::
onPackageSelect
)
EVT_BUTTON
(
ID_INSTALL
,
UpdatesWindow
::
onButton
)
EVT_BUTTON
(
ID_REMOVE
,
UpdatesWindow
::
onButton
)
EVT_BUTTON
(
ID_UPGRADE
,
UpdatesWindow
::
onButton
)
EVT_BUTTON
(
ID_CANCEL
,
UpdatesWindow
::
onButton
)
EVT_BUTTON
(
ID_INSTALL
,
UpdatesWindow
::
onActionChange
)
EVT_BUTTON
(
ID_REMOVE
,
UpdatesWindow
::
onActionChange
)
EVT_BUTTON
(
ID_UPGRADE
,
UpdatesWindow
::
onActionChange
)
EVT_BUTTON
(
ID_CANCEL
,
UpdatesWindow
::
onActionChange
)
EVT_BUTTON
(
ID_APPLY
,
UpdatesWindow
::
onApplyChanges
)
END_EVENT_TABLE
()
src/gui/update_checker.hpp
View file @
86ba08c8
...
...
@@ -65,11 +65,12 @@ class UpdatesWindow : public Frame {
wxHtmlWindow
*
description_window
;
wxStaticText
*
package_title
,
*
status_title
,
*
new_title
;
wxButton
*
install_button
,
*
upgrade_button
,
*
remove_button
,
*
cancel_button
;
wxButton
*
install_button
,
*
upgrade_button
,
*
remove_button
,
*
cancel_button
,
*
apply_button
;
void
onUpdateCheckFinished
(
wxCommandEvent
&
);
void
onPackageSelect
(
wxCommandEvent
&
);
void
onButton
(
wxCommandEvent
&
);
void
onActionChange
(
wxCommandEvent
&
);
void
onApplyChanges
(
wxCommandEvent
&
);
/// Update the buttons to indicate that this is selected.
void
updateButtons
(
int
index
);
...
...
src/gui/value/text.cpp
View file @
86ba08c8
...
...
@@ -241,7 +241,7 @@ DropDownList* DropDownWordList::submenu(size_t item) const {
if
(
i
.
flags
&
FLAG_SUBMENU
)
{
// create submenu?
if
(
!
i
.
submenu
)
{
i
.
submenu
.
reset
(
new
DropDownWordList
(
const_cast
<
DropDownWordList
*>
(
this
),
true
,
tve
,
pos
,
i
.
word
));
i
.
submenu
.
reset
(
new
DropDownWordList
(
const_cast
<
DropDownWordList
*>
(
this
),
true
,
tve
,
pos
,
WordListWordP
(
i
.
word
)
));
}
return
i
.
submenu
.
get
();
}
else
{
...
...
src/main.cpp
View file @
86ba08c8
...
...
@@ -99,12 +99,13 @@ int MSE::OnRun() {
return
wxApp
::
OnRun
();
}
else
if
(
f
.
GetExt
()
==
_
(
"mse-installer"
))
{
// Installer; install it
bool
local
=
fals
e
;
InstallType
type
=
settings
.
install_typ
e
;
if
(
argc
>
2
)
{
String
arg2
=
argv
[
2
];
local
=
arg2
==
_
(
"--local"
);
}
Installer
::
installFrom
(
argv
[
1
],
true
,
local
);
String
arg
=
argv
[
2
];
if
(
arg
.
Mid
(
0
,
2
)
==
_
(
"--"
))
parse_enum
(
arg
.
Mid
(
2
),
type
);
}
Installer
::
installFrom
(
argv
[
1
],
true
,
isInstallLocal
(
type
));
return
EXIT_SUCCESS
;
}
else
if
(
arg
==
_
(
"--symbol-editor"
))
{
Window
*
wnd
=
new
SymbolWindow
(
nullptr
);
...
...
src/resource/common/expected_locale_keys
View file @
86ba08c8
...
...
@@ -270,9 +270,11 @@ menu:
add
card
:
0
add
cards
:
0
add
keyword
:
0
apply
changes
:
0
auto
replace
:
0
basic
shapes
:
0
bold
:
0
cancel
changes
:
0
card
list
columns
:
0
cards
:
0
cards
tab
:
0
...
...
@@ -298,6 +300,7 @@ menu:
help
:
0
index
:
0
insert
symbol
:
0
install
package
:
0
italic
:
0
keywords
:
0
keywords
tab
:
0
...
...
@@ -322,6 +325,7 @@ menu:
reminder
text
:
0
remove
card
:
0
remove
keyword
:
0
remove
package
:
0
replace
:
0
rotate
:
0
rotate
0
:
0
...
...
@@ -342,6 +346,7 @@ menu:
tool
:
0
undo
:
1
ungroup
:
0
upgrade
package
:
0
website
:
0
window
:
0
title
:
...
...
src/script/image.cpp
View file @
86ba08c8
...
...
@@ -166,7 +166,7 @@ void CachedScriptableImage::generateCached(const GeneratedImage::Options& option
set_alpha
(
cached_i
,
*
mask
);
}
else
{
Image
mask_scaled
(
cached_i
.
GetWidth
(),
cached_i
.
GetHeight
(),
false
);
resample
(
mask
,
mask_scaled
);
resample
(
*
mask
,
mask_scaled
);
set_alpha
(
cached_i
,
mask_scaled
);
}
}
...
...
src/util/string.hpp
View file @
86ba08c8
...
...
@@ -62,13 +62,13 @@ void writeUTF8(wxTextOutputStream& stream, const String& str);
/// Some constants we like to use
#ifdef UNICODE
#define LEFT_ANGLE_BRACKET _("\
x
2039")
#define RIGHT_ANGLE_BRACKET _("\
x
203A")
#define LEFT_SINGLE_QUOTE _('\
x
2018')
#define RIGHT_SINGLE_QUOTE _('\
x
2019')
#define LEFT_DOUBLE_QUOTE _('\
x
201C')
#define RIGHT_DOUBLE_QUOTE _('\
x
201D')
#define CONNECTION_SPACE _('\
x
EB00') // in private use are, untags to ' '
#define LEFT_ANGLE_BRACKET _("\
u
2039")
#define RIGHT_ANGLE_BRACKET _("\
u
203A")
#define LEFT_SINGLE_QUOTE _('\
u
2018')
#define RIGHT_SINGLE_QUOTE _('\
u
2019')
#define LEFT_DOUBLE_QUOTE _('\
u
201C')
#define RIGHT_DOUBLE_QUOTE _('\
u
201D')
#define CONNECTION_SPACE _('\
u
EB00') // in private use are, untags to ' '
#else
#define LEFT_ANGLE_BRACKET _("<")
#define RIGHT_ANGLE_BRACKET _(">")
...
...
src/util/window_id.hpp
View file @
86ba08c8
...
...
@@ -243,7 +243,9 @@ enum ControlID {
,
ID_INSTALL
,
ID_UPGRADE
,
ID_REMOVE
,
ID_CANCEL
=
wxID_CANCEL
// Don't use wxID_CANCEL because it makes the button look out of place
,
ID_CANCEL
,
ID_APPLY
// Auto replace window
,
ID_USE_AUTO_REPLACE
,
ID_ITEM_VALUE
...
...
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