static shared_ptr<Film> film;
static std::string log_level;
static std::string film_to_load;
+static std::string film_to_create;
static wxMenu* jobs_menu = 0;
static wxLocale* locale = 0;
set_menu_sensitivity ();
- /* XXX: calling these here is a bit of a hack */
- film_editor->setup_visibility ();
-
film_editor->FileChanged.connect (bind (&Frame::file_changed, this, _1));
if (film) {
file_changed (film->directory ());
#if wxMINOR_VERSION == 9
static const wxCmdLineEntryDesc command_line_description[] = {
{ wxCMD_LINE_OPTION, "l", "log", "set log level (silent, verbose or timing)", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
- { wxCMD_LINE_PARAM, 0, 0, "film to load", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_PARAM_OPTIONAL },
+ { wxCMD_LINE_SWITCH, "n", "new", "create new film", wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL },
+ { wxCMD_LINE_PARAM, 0, 0, "film to load or create", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_PARAM_OPTIONAL },
{ wxCMD_LINE_NONE, "", "", "", wxCmdLineParamType (0), 0 }
};
#else
static const wxCmdLineEntryDesc command_line_description[] = {
{ wxCMD_LINE_OPTION, wxT("l"), wxT("log"), wxT("set log level (silent, verbose or timing)"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
- { wxCMD_LINE_PARAM, 0, 0, wxT("film to load"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_PARAM_OPTIONAL },
+ { wxCMD_LINE_SWITCH, wxT("n"), wxT("new"), wxT("create new film"), wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL },
+ { wxCMD_LINE_PARAM, 0, 0, wxT("film to load or create"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_PARAM_OPTIONAL },
{ wxCMD_LINE_NONE, wxT(""), wxT(""), wxT(""), wxCmdLineParamType (0), 0 }
};
#endif
}
}
+ if (!film_to_create.empty ()) {
+ film.reset (new Film (film_to_create, false));
+ film->log()->set_level (log_level);
+ film->set_name (boost::filesystem::path (film_to_create).filename().generic_string ());
+ }
+
Frame* f = new Frame (_("DVD-o-matic"));
SetTopWindow (f);
f->Maximize ();
bool OnCmdLineParsed (wxCmdLineParser& parser)
{
if (parser.GetParamCount() > 0) {
- film_to_load = wx_to_std (parser.GetParam(0));
+ if (parser.FoundSwitch (wxT ("new"))) {
+ film_to_create = wx_to_std (parser.GetParam (0));
+ } else {
+ film_to_load = wx_to_std (parser.GetParam(0));
+ }
}
wxString log;
- if (parser.Found(wxT("log"), &log)) {
+ if (parser.Found (wxT ("log"), &log)) {
log_level = wx_to_std (log);
}