///////////////////////////////////////////////////////////////////////////// // Name: dvdstyler.cpp // Purpose: DVD Authoring Application // Author: Alex Thuering // Created: 10.10.2003 // RCS-ID: $Id: dvdstyler.cpp,v 1.26 2006/12/06 14:53:37 ntalex Exp $ // Copyright: (c) Alex Thuering // Licence: GPL ///////////////////////////////////////////////////////////////////////////// #include "MainWin.h" #include "About.h" #include "Config.h" #include "Languages.h" #include "MPEG.h" #include #include #include #include #ifndef __WXWINCE__ #include #endif #ifndef __WXMSW__ #include "rc/dvdstyler.xpm" #endif #define LOCALE_DIR wxFindDataDirectory(_T("..") + wxString(wxFILE_SEP_PATH) + _T("locale")) class DVDStyler: public wxApp { public: bool OnInit(); protected: wxLocale m_locale; }; IMPLEMENT_APP(DVDStyler) bool DVDStyler::OnInit() { //wxLog::SetActiveTarget(new wxLogStderr); // fix config s_config.Init(); if (s_config.GetVersion() != APP_VERSION) { wxLogNull log; s_config.SetVersion(APP_VERSION); s_config.DeleteGroup(_T("Generate")); s_config.DeleteGroup(_T("Preview")); s_config.DeleteGroup(_T("Iso")); s_config.DeleteGroup(_T("Burn")); s_config.Flush(); } wxInitAllImageHandlers(); // load new jpeg handler (with scale option) if (!wxImage::RemoveHandler(_T("JPEG file"))) wxMessageBox(_T("Error: Can't remove old JPEG handler")); wxImage::InsertHandler(new wxJPGHandler); wxThumbnailFactory::InitGnome(APP_NAME.mb_str(), APP_VERSION.mb_str(), wxTheApp->argc, (char**)wxTheApp->argv); // locale int lang = s_config.GetLanguage(); s_config.SetLanguage(wxLANGUAGE_ENGLISH); // save choosed languages only if all ok if (lang == -1) lang = ChooseLanguage(); if (lang != wxLANGUAGE_ENGLISH) { m_locale.Init(lang); m_locale.AddCatalogLookupPathPrefix(LOCALE_DIR); m_locale.AddCatalog(wxT("dvdstyler")); } #ifndef __WXWINCE__ setlocale(LC_NUMERIC, "C"); #endif MainWin* mainWin = new MainWin(); mainWin->SetIcon(wxICON(dvdstyler)); if (argc > 1) { wxString filename = argv[1]; if (filename.Right(4).Lower() == _T(".xml")) mainWin->Open(filename); else { for (int i=1; iAddTitle(filename); } } } } mainWin->Show(); SetTopWindow(mainWin); s_config.SetLanguage(lang); // save choosed languages if all ok return true; }