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
bcc26f1a
Commit
bcc26f1a
authored
Jul 12, 2007
by
coppro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added robustness to command-line options.
Fixed minor bugs in installer
parent
df463eb0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
src/data/installer.cpp
src/data/installer.cpp
+2
-2
src/main.cpp
src/main.cpp
+7
-0
No files found.
src/data/installer.cpp
View file @
bcc26f1a
...
...
@@ -29,7 +29,7 @@ void Installer::installFrom(const String& filename, bool message_on_success) {
i
.
open
(
filename
);
i
.
install
();
if
(
message_on_success
)
{
wxMessageBox
(
String
::
Format
(
_
(
"'%s' successfully installed %d package%s."
),
i
.
name
(),
i
.
packages
.
size
(),
i
.
packages
.
size
()
==
1
?
_
(
""
)
:
_
(
"s"
)),
wxMessageBox
(
String
::
Format
(
_
(
"'%s' successfully installed %d package%s."
),
i
.
name
()
.
c_str
()
,
i
.
packages
.
size
(),
i
.
packages
.
size
()
==
1
?
_
(
""
)
:
_
(
"s"
)),
_
(
"Magic Set Editor"
),
wxOK
|
wxICON_INFORMATION
);
}
}
...
...
@@ -56,7 +56,7 @@ void Installer::install(const String& package) {
void
Installer
::
addPackage
(
const
String
&
package
)
{
wxFileName
fn
(
package
);
if
(
fn
.
GetExt
()
==
_
(
"
.
mse-installer"
))
{
if
(
fn
.
GetExt
()
==
_
(
"mse-installer"
))
{
prefered_filename
=
package
;
}
else
{
PackagedP
p
=
::
packages
.
openAny
(
package
);
...
...
src/main.cpp
View file @
bcc26f1a
...
...
@@ -86,19 +86,23 @@ bool MSE::OnInit() {
// Show the symbol editor
Window
*
wnd
=
new
SymbolWindow
(
nullptr
,
argv
[
1
]);
wnd
->
Show
();
packages
.
destroy
();
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
();
packages
.
destroy
();
return
true
;
}
else
if
(
f
.
GetExt
()
==
_
(
"mse-installer"
))
{
// Installer; install it
Installer
::
installFrom
(
argv
[
1
],
true
);
packages
.
destroy
();
return
false
;
}
else
if
(
arg
==
_
(
"--symbol-editor"
))
{
Window
*
wnd
=
new
SymbolWindow
(
nullptr
);
wnd
->
Show
();
packages
.
destroy
();
return
true
;
}
else
if
(
arg
==
_
(
"--create-installer"
))
{
// create an installer
...
...
@@ -111,6 +115,7 @@ bool MSE::OnInit() {
}
else
{
inst
.
saveAs
(
inst
.
prefered_filename
,
false
);
}
packages
.
destroy
();
return
false
;
}
else
if
(
arg
==
_
(
"--help"
)
||
arg
==
_
(
"-?"
))
{
// command line help
...
...
@@ -130,6 +135,7 @@ bool MSE::OnInit() {
}
else
if
(
arg
==
_
(
"--version"
)
||
arg
==
_
(
"-v"
))
{
// dump version
write_stdout
(
_
(
"Magic Set Editor
\n
Version "
)
+
app_version
.
toString
()
+
version_suffix
);
packages
.
destroy
();
return
false
;
}
else
{
handle_error
(
_
(
"Invalid command line argument:
\n
"
)
+
String
(
argv
[
1
]));
...
...
@@ -141,6 +147,7 @@ bool MSE::OnInit() {
// no command line arguments, or error, show welcome window
(
new
WelcomeWindow
())
->
Show
();
packages
.
destroy
();
return
true
;
}
catch
(
const
Error
&
e
)
{
...
...
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