allow reading images from the current directory in the CLI interface

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1475 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2010-08-03 18:25:35 +00:00
parent 0673eda5c9
commit 4defd52aa2
6 changed files with 40 additions and 28 deletions
+10 -2
View File
@@ -26,8 +26,8 @@ CLISetInterface::CLISetInterface(const SetP& set, bool quiet)
if (!cli.haveConsole()) {
throw Error(_("Can not run command line interface without a console;\nstart MSE with \"mse.com --cli\""));
}
ei.directory_relative = ei.directory_absolute = wxGetCwd();
ei.allow_writes_outside = true;
setExportInfoCwd();
setSet(set);
run();
}
@@ -61,6 +61,14 @@ void CLISetInterface::onChangeSet() {
ei.set = set;
}
void CLISetInterface::setExportInfoCwd() {
// write to the current directory
ei.directory_relative = ei.directory_absolute = wxGetCwd();
// read from the current directory
ei.export_template = intrusive(new Package());
ei.export_template->open(ei.directory_absolute, true);
}
// ----------------------------------------------------------------------------- : Running
@@ -151,7 +159,7 @@ void CLISetInterface::handleCommand(const String& command) {
if (!wxSetWorkingDirectory(arg)) {
cli.showError(_("Can't change working directory to ")+arg);
} else {
ei.directory_relative = ei.directory_absolute = wxGetCwd();
setExportInfoCwd();
}
}
} else if (before == _(":pwd") || before == _(":p")) {
+1
View File
@@ -44,6 +44,7 @@ class CLISetInterface : public SetView {
// export info, so we can write files
ExportInfo ei;
void setExportInfoCwd();
};
// ----------------------------------------------------------------------------- : EOF