void PoeditApp::OnNew(wxCommandEvent& event) { TRY_FORWARD_TO_ACTIVE_WINDOW( OnNew(event) ); PoeditFrame *f = PoeditFrame::CreateEmpty(); f->OnNew(event); }
void PoeditApp::OnOpen(wxCommandEvent&) { wxString path = wxConfig::Get()->Read("last_file_path", wxEmptyString); wxFileDialog dlg(nullptr, _("Open catalog"), path, wxEmptyString, _("GNU gettext catalogs (*.po)|*.po|All files (*.*)|*.*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE); if (dlg.ShowModal() == wxID_OK) { wxConfig::Get()->Write("last_file_path", dlg.GetDirectory()); wxArrayString paths; dlg.GetPaths(paths); if (paths.size() == 1) { TRY_FORWARD_TO_ACTIVE_WINDOW( OpenFile(paths[0]) ); } OpenFiles(paths); } }
void PoeditApp::OnOpenHist(wxCommandEvent& event) { TRY_FORWARD_TO_ACTIVE_WINDOW( OnOpenHist(event) ); wxString f(FileHistory().GetHistoryFile(event.GetId() - wxID_FILE1)); if ( !wxFileExists(f) ) { wxLogError(_("File '%s' doesn't exist."), f.c_str()); return; } OpenFiles(wxArrayString(1, &f)); }
void PoeditApp::OnOpen(wxCommandEvent& event) { TRY_FORWARD_TO_ACTIVE_WINDOW( OnOpen(event) ); wxString path = wxConfig::Get()->Read("last_file_path", wxEmptyString); wxString name = wxFileSelector(_("Open catalog"), path, wxEmptyString, wxEmptyString, _("GNU gettext catalogs (*.po)|*.po|All files (*.*)|*.*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST); if (!name.empty()) { wxConfig::Get()->Write("last_file_path", wxPathOnly(name)); OpenFile(name); } }