mmg: handle all command line arguments (e.g. add all files)

Fixes #867.
This commit is contained in:
Moritz Bunkus 2013-04-16 20:02:28 +02:00
parent b4f6ab84f7
commit 6b84c3ee86
2 changed files with 18 additions and 13 deletions

View File

@ -1,5 +1,10 @@
2013-04-16 Moritz Bunkus <moritz@bunkus.org>
* mmg: bug fix: mmg will now handle all file names given on the
command line instead of only the first one. This allows things
like opening several selected files with mmg in Windows, and mmg
will add all of them. Fixes #867.
* mkvmerge: bug fix: The amount of memory required to store the
cues during muxing has been reduced drastically. This is more
noticeable the more video and subtitle tracks are muxed. Fixes

View File

@ -243,23 +243,23 @@ mmg_app::handle_command_line_arguments() {
return;
}
wxString file = wargs[0];
if (!wxFileExists(file) || wxDirExists(file))
wxMessageBox(wxString::Format(Z("The file '%s' does not exist."), file.c_str()), Z("Error loading settings"), wxOK | wxCENTER | wxICON_ERROR);
else {
for (auto &file : wargs)
if (!wxFileExists(file) || wxDirExists(file))
wxMessageBox(wxString::Format(Z("The file '%s' does not exist."), file.c_str()), Z("Error loading settings"), wxOK | wxCENTER | wxICON_ERROR);
else {
#ifdef SYS_WINDOWS
if ((file.Length() > 3) && (file.c_str()[1] != wxT(':')) && (file.c_str()[0] != wxT('\\')))
file = wxGetCwd() + wxT("\\") + file;
if ((file.Length() > 3) && (file.c_str()[1] != wxT(':')) && (file.c_str()[0] != wxT('\\')))
file = wxGetCwd() + wxT("\\") + file;
#else
if ((file.Length() > 0) && (file.c_str()[0] != wxT('/')))
file = wxGetCwd() + wxT("/") + file;
if ((file.Length() > 0) && (file.c_str()[0] != wxT('/')))
file = wxGetCwd() + wxT("/") + file;
#endif
if (wxFileName(file).GetExt() == wxU("mmg"))
mdlg->load(file);
else
mdlg->input_page->add_file(file, false);
}
if (wxFileName(file).GetExt() == wxU("mmg"))
mdlg->load(file);
else
mdlg->input_page->add_file(file, false);
}
}
int