]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/wx-console/main.cpp
Update the Microsoft Visual Studio build to match the MinGW32 build.
[bacula/bacula] / bacula / src / wx-console / main.cpp
index 0e6e5eca942d825a27abca8417978a2036d701b3..90522cdddc587c628a3d870ab5962d640f3ed35e 100644 (file)
@@ -7,7 +7,7 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004-2005 Kern Sibbald
+   Copyright (C) 2004-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
 // headers
 // ----------------------------------------------------------------------------
 
+#undef _DEBUG
+
+#include "bacula.h"
+
+#undef setlocale
+#undef textdomain
+#undef bindtextdomain
+
 #include <wx/wxprec.h>
 #include <wx/config.h>
-
+#include <wx/intl.h>
 #include "wxbmainframe.h"
-
 #include "csprint.h"
 
-void InitWinAPIWrapper();
 
 /* Dummy functions */
 int generate_daemon_event(JCR *jcr, const char *event) { return 1; }
@@ -66,13 +72,15 @@ IMPLEMENT_APP(MyApp)
 // 'Main program' equivalent: the program execution "starts" here
 bool MyApp::OnInit()
 {
-   setlocale(LC_ALL, "");
-   bindtextdomain("bacula", LOCALEDIR);
-   textdomain("bacula");
+   /* wxWidgets internationalisation */
+   wxLocale m_locale;
+   m_locale.Init();
+   m_locale.AddCatalog(wxT("bacula"));
+   wxLocale::AddCatalogLookupPathPrefix(wxT(LOCALEDIR));
 
    long posx, posy, sizex, sizey;
    int displayx, displayy;
-   InitWinAPIWrapper();
+   OSDependentInit();
    wxConfig::Get()->Read(wxT("/Position/X"), &posx, 50);
    wxConfig::Get()->Read(wxT("/Position/Y"), &posy, 50);
    wxConfig::Get()->Read(wxT("/Size/Width"), &sizex, 780);
@@ -93,18 +101,14 @@ bool MyApp::OnInit()
       }
    }
 
-   wxbMainFrame *frame = wxbMainFrame::CreateInstance(wxT(_("Bacula wx-console")),
+   wxbMainFrame *frame = wxbMainFrame::CreateInstance(_("Bacula wx-console"),
                          wxPoint(posx, posy), wxSize(sizex, sizey));
 
    frame->Show(TRUE);
 
-   frame->Print(wxString::Format(wxT(_("Welcome to bacula wx-console %s (%s)!\n")), wxT(VERSION), wxT(BDATE)), CS_DEBUG);
+   frame->Print(wxString::Format(_("Welcome to bacula wx-console %s (%s)!\n"), wxT(VERSION), wxT(BDATE)), CS_DEBUG);
 
    frame->StartConsoleThread(wxT(""));
    
    return TRUE;
 }
-
-#ifndef HAVE_WIN32
-void InitWinAPIWrapper() { };
-#endif