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
7a60536f
Commit
7a60536f
authored
Dec 24, 2006
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command line argument support
parent
d79c79bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
13 deletions
+34
-13
src/gui/symbol/window.cpp
src/gui/symbol/window.cpp
+5
-2
src/gui/symbol/window.hpp
src/gui/symbol/window.hpp
+1
-1
src/main.cpp
src/main.cpp
+28
-10
No files found.
src/gui/symbol/window.cpp
View file @
7a60536f
...
@@ -26,8 +26,11 @@ SymbolWindow::SymbolWindow(Window* parent) {
...
@@ -26,8 +26,11 @@ SymbolWindow::SymbolWindow(Window* parent) {
}
}
SymbolWindow
::
SymbolWindow
(
Window
*
parent
,
const
String
&
filename
)
{
SymbolWindow
::
SymbolWindow
(
Window
*
parent
,
const
String
&
filename
)
{
// TODO : open file
// open file
init
(
parent
,
default_symbol
());
Reader
reader
(
filename
);
SymbolP
symbol
;
reader
.
handle
(
symbol
);
init
(
parent
,
symbol
);
}
}
SymbolWindow
::
SymbolWindow
(
Window
*
parent
,
const
SymbolValueP
&
value
,
const
SetP
&
set
)
SymbolWindow
::
SymbolWindow
(
Window
*
parent
,
const
SymbolValueP
&
value
,
const
SetP
&
set
)
...
...
src/gui/symbol/window.hpp
View file @
7a60536f
...
@@ -27,7 +27,7 @@ class SymbolWindow : public Frame {
...
@@ -27,7 +27,7 @@ class SymbolWindow : public Frame {
SymbolWindow
(
Window
*
parent
);
SymbolWindow
(
Window
*
parent
);
/// Construct a SymbolWindow showing a symbol from a file
/// Construct a SymbolWindow showing a symbol from a file
SymbolWindow
(
Window
*
parent
,
const
String
&
filename
);
SymbolWindow
(
Window
*
parent
,
const
String
&
filename
);
//
/// Construct a SymbolWindow showing a symbol value in a set
/// Construct a SymbolWindow showing a symbol value in a set
SymbolWindow
(
Window
*
parent
,
const
SymbolValueP
&
value
,
const
SetP
&
set
);
SymbolWindow
(
Window
*
parent
,
const
SymbolValueP
&
value
,
const
SetP
&
set
);
private:
private:
...
...
src/main.cpp
View file @
7a60536f
...
@@ -48,17 +48,35 @@ bool MSE::OnInit() {
...
@@ -48,17 +48,35 @@ bool MSE::OnInit() {
packages
.
init
();
packages
.
init
();
settings
.
read
();
settings
.
read
();
the_locale
=
Locale
::
byName
(
settings
.
locale
);
the_locale
=
Locale
::
byName
(
settings
.
locale
);
// check for updates
check_updates
();
check_updates
();
//Window* wnd = new SymbolWindow(nullptr);
//GameP g = Game::byName(_("magic"))
// interpret command line
SetP
s
=
new_shared
<
Set
>
();
if
(
argc
>
1
)
{
s
->
open
(
_
(
"test.mse-set"
));
try
{
Window
*
wnd
=
new
SetWindow
(
nullptr
,
s
);
// Command line argument, find its extension
//Window* wnd = new WelcomeWindow();
wxFileName
f
(
argv
[
1
]);
wnd
->
Show
();
if
(
f
.
GetExt
()
==
_
(
"mse-symbol"
))
{
// Show the symbol editor
Window
*
wnd
=
new
SymbolWindow
(
nullptr
,
argv
[
1
]);
wnd
->
Show
();
return
true
;
}
else
if
(
f
.
GetExt
()
==
_
(
"mse-set"
)
||
f
.
GetExt
()
==
_
(
"mse"
)
||
f
.
GetExt
()
==
_
(
"set"
))
{
// Show the set window
Window
*
wnd
=
new
SetWindow
(
nullptr
,
import_set
(
argv
[
1
]));
wnd
->
Show
();
return
true
;
}
else
{
handle_error
(
_
(
"Invalid command line argument:
\n
"
)
+
String
(
argv
[
1
]));
}
}
catch
(
const
Error
&
e
)
{
handle_error
(
e
);
}
}
// no command line arguments, or error, show welcome window
(
new
WelcomeWindow
())
->
Show
();
return
true
;
return
true
;
}
catch
(
Error
e
)
{
}
catch
(
Error
e
)
{
handle_error
(
e
,
false
);
handle_error
(
e
,
false
);
}
catch
(
std
::
exception
e
)
{
}
catch
(
std
::
exception
e
)
{
...
@@ -67,7 +85,7 @@ bool MSE::OnInit() {
...
@@ -67,7 +85,7 @@ bool MSE::OnInit() {
}
catch
(...)
{
}
catch
(...)
{
handle_error
(
InternalError
(
_
(
"An unexpected exception occurred!"
)),
false
);
handle_error
(
InternalError
(
_
(
"An unexpected exception occurred!"
)),
false
);
}
}
packages
.
destroy
();
OnExit
();
return
false
;
return
false
;
}
}
...
...
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