X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Fwx-console%2Fwxbconfigfileeditor.cpp;h=8d8481c18b21c85f1de8cbee6534e956af4b37ed;hb=c87eb430746cb5d98d0f2016ac0165b39aba61e8;hp=803fde57e13cf8817d4a635df981ba4ceddca331;hpb=5afded630aad7c0b40d795de41bc11be314df77d;p=bacula%2Fbacula diff --git a/bacula/src/wx-console/wxbconfigfileeditor.cpp b/bacula/src/wx-console/wxbconfigfileeditor.cpp index 803fde57e1..8d8481c18b 100644 --- a/bacula/src/wx-console/wxbconfigfileeditor.cpp +++ b/bacula/src/wx-console/wxbconfigfileeditor.cpp @@ -7,21 +7,18 @@ * 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" @@ -41,7 +38,7 @@ BEGIN_EVENT_TABLE(wxbConfigFileEditor, wxDialog) 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; @@ -57,8 +54,8 @@ wxbConfigFileEditor::wxbConfigFileEditor(wxWindow* parent, wxString 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); @@ -69,7 +66,7 @@ wxbConfigFileEditor::wxbConfigFileEditor(wxWindow* parent, wxString filename): 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"); @@ -81,11 +78,11 @@ wxbConfigFileEditor::wxbConfigFileEditor(wxWindow* parent, wxString filename): } 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; } @@ -100,13 +97,14 @@ wxbConfigFileEditor::~wxbConfigFileEditor() { 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();