2 Bacula® - The Network Backup Solution
4 Copyright (C) 2004-2008 Free Software Foundation Europe e.V.
6 The main author of Bacula is Kern Sibbald, with contributions from
7 many others, a complete list can be found in the file AUTHORS.
8 This program is Free Software; you can redistribute it and/or
9 modify it under the terms of version three of the GNU Affero General Public
10 License as published by the Free Software Foundation and included
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU Affero General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 Bacula® is a registered trademark of Kern Sibbald.
24 The licensor of Bacula is the Free Software Foundation Europe
25 (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
26 Switzerland, email:ftf@fsfeurope.org.
30 * Bacula bwx-console application
32 * Nicolas Boichat, April 2004
38 // ============================================================================
40 // ============================================================================
42 // ----------------------------------------------------------------------------
44 // ----------------------------------------------------------------------------
46 /* Windows debug builds set _DEBUG which is used by wxWidgets to select their
47 * debug memory allocator. Unfortunately it conflicts with Bacula's SmartAlloc.
48 * So we turn _DEBUG off since we aren't interested in things it enables.
55 #include <wx/wxprec.h>
56 #include <wx/config.h>
58 #include "wxbmainframe.h"
63 int generate_daemon_event(JCR *jcr, const char *event) { return 1; }
64 int generate_job_event(JCR *jcr, const char *event) { return 1; }
67 // ----------------------------------------------------------------------------
69 // ----------------------------------------------------------------------------
71 class MyApp : public wxApp
74 virtual bool OnInit();
77 // ============================================================================
79 // ============================================================================
83 // ----------------------------------------------------------------------------
84 // the application class
85 // ----------------------------------------------------------------------------
87 // 'Main program' equivalent: the program execution "starts" here
90 /* wxWidgets internationalisation */
93 m_locale.AddCatalog(wxT("bacula"));
94 wxLocale::AddCatalogLookupPathPrefix(wxT(LOCALEDIR));
96 long posx, posy, sizex, sizey;
97 int displayx, displayy;
99 wxConfig::Get()->Read(wxT("/Position/X"), &posx, 50);
100 wxConfig::Get()->Read(wxT("/Position/Y"), &posy, 50);
101 wxConfig::Get()->Read(wxT("/Size/Width"), &sizex, 780);
102 wxConfig::Get()->Read(wxT("/Size/Height"), &sizey, 500);
104 wxDisplaySize(&displayx, &displayy);
106 /* Check if we are on the screen... */
107 if ((posx+sizex > displayx) || (posy+sizey > displayy)) {
108 /* Try to move the top-left corner first */
111 if ((posx+sizex > displayx) || (posy+sizey > displayy)) {
114 sizex = displayx - 50;
115 sizey = displayy - 50;
119 wxbMainFrame *frame = wxbMainFrame::CreateInstance(_("Bacula bwx-console"),
120 wxPoint(posx, posy), wxSize(sizex, sizey));
124 frame->Print(wxString::Format(_("Welcome to bacula bwx-console %s (%s)!\n"), wxT(VERSION), wxT(BDATE)), CS_DEBUG);
126 frame->StartConsoleThread(wxT(""));