]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/wx-console/main.cpp
Mark translatable strings in all source files.
[bacula/bacula] / bacula / src / wx-console / main.cpp
index 2dce15d7789a56ecf6ad7462b2c0acbff1303ecb..0e6e5eca942d825a27abca8417978a2036d701b3 100644 (file)
@@ -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.
  */
 
 // ============================================================================
@@ -39,6 +36,8 @@
 
 #include "csprint.h"
 
+void InitWinAPIWrapper();
+
 /* Dummy functions */
 int generate_daemon_event(JCR *jcr, const char *event) { return 1; }
 int generate_job_event(JCR *jcr, const char *event) { return 1; }
@@ -67,12 +66,17 @@ IMPLEMENT_APP(MyApp)
 // 'Main program' equivalent: the program execution "starts" here
 bool MyApp::OnInit()
 {
+   setlocale(LC_ALL, "");
+   bindtextdomain("bacula", LOCALEDIR);
+   textdomain("bacula");
+
    long posx, posy, sizex, sizey;
    int displayx, displayy;
-   wxConfig::Get()->Read("/Position/X", &posx, 50);
-   wxConfig::Get()->Read("/Position/Y", &posy, 50);
-   wxConfig::Get()->Read("/Size/Width", &sizex, 780);
-   wxConfig::Get()->Read("/Size/Height", &sizey, 500);
+   InitWinAPIWrapper();
+   wxConfig::Get()->Read(wxT("/Position/X"), &posx, 50);
+   wxConfig::Get()->Read(wxT("/Position/Y"), &posy, 50);
+   wxConfig::Get()->Read(wxT("/Size/Width"), &sizex, 780);
+   wxConfig::Get()->Read(wxT("/Size/Height"), &sizey, 500);
    
    wxDisplaySize(&displayx, &displayy);
    
@@ -89,14 +93,18 @@ bool MyApp::OnInit()
       }
    }
 
-   wxbMainFrame *frame = wxbMainFrame::CreateInstance(_T("Bacula wx-console"),
+   wxbMainFrame *frame = wxbMainFrame::CreateInstance(wxT(_("Bacula wx-console")),
                          wxPoint(posx, posy), wxSize(sizex, sizey));
 
    frame->Show(TRUE);
 
-   frame->Print(wxString("Welcome to bacula wx-console ") << VERSION << " (" << BDATE << ")!\n", CS_DEBUG);
+   frame->Print(wxString::Format(wxT(_("Welcome to bacula wx-console %s (%s)!\n")), wxT(VERSION), wxT(BDATE)), CS_DEBUG);
 
-   frame->StartConsoleThread("");
+   frame->StartConsoleThread(wxT(""));
    
    return TRUE;
 }
+
+#ifndef HAVE_WIN32
+void InitWinAPIWrapper() { };
+#endif