* Version $Id$
*/
/*
- Copyright (C) 2004 Kern Sibbald and John Walker
+ Copyright (C) 2004-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
+ version 2 as amended with additional clauses defined in the
+ file LICENSE in the main source directory.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ the file LICENSE for additional details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "wxbconfigfileeditor.h"
END_EVENT_TABLE()
wxbConfigFileEditor::wxbConfigFileEditor(wxWindow* parent, wxString filename):
- wxDialog(parent, -1, wxT("Config file editor"), wxDefaultPosition, wxSize(500, 300),
+ wxDialog(parent, -1, _("Config file editor"), wxDefaultPosition, wxSize(500, 300),
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {
this->filename = filename;
mainSizer->AddGrowableRow(0);
wxBoxSizer *bottomsizer = new wxBoxSizer(wxHORIZONTAL);
- bottomsizer->Add(new wxButton(this, Save, wxT("Save and close")), 0, wxALL, 10);
- bottomsizer->Add(new wxButton(this, Quit, wxT("Close without saving")), 0, wxALL, 10);
+ bottomsizer->Add(new wxButton(this, Save, _("Save and close")), 0, wxALL, 10);
+ bottomsizer->Add(new wxButton(this, Quit, _("Close without saving")), 0, wxALL, 10);
mainSizer->Add(textCtrl, 1, wxEXPAND);
mainSizer->Add(bottomsizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL);
if (!filen.FileExists()) {
(*textCtrl) << wxT("#\n");
- (*textCtrl) << wxT("# Bacula wx-console Configuration File\n");
+ (*textCtrl) << _("# Bacula wx-console Configuration File\n");
(*textCtrl) << wxT("#\n");
(*textCtrl) << wxT("\n");
(*textCtrl) << wxT("Director {\n");
}
else {
wxFile file(filename);
- wxChar buffer[2049];
+ char buffer[2049];
off_t len;
while ((len = file.Read(buffer, 2048)) > -1) {
- buffer[len] = (wxChar)0;
- (*textCtrl) << buffer;
+ buffer[len] = 0;
+ (*textCtrl) << wxString(buffer,wxConvLocal);
if (file.Eof())
break;
}
void wxbConfigFileEditor::OnSave(wxCommandEvent& event) {
wxFile file(filename, wxFile::write);
if (!file.IsOpened()) {
- wxMessageBox(wxString(wxT("Unable to write to ")) << filename << wxT("\n"), wxT("Error while saving"),
+ wxMessageBox(wxString::Format(_("Unable to write to %s\n"), filename.c_str()),
+ _("Error while saving"),
wxOK | wxICON_ERROR, this);
EndModal(wxCANCEL);
return;
}
- file.Write(textCtrl->GetValue());
+ file.Write(textCtrl->GetValue(),wxConvLocal);
file.Flush();
file.Close();