]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/wx-console/main.cpp
Cleanup Python build so that Python is not dragged
[bacula/bacula] / bacula / src / wx-console / main.cpp
1 /*
2  *
3  *    Bacula wx-console application
4  *
5  *    Nicolas Boichat, April 2004
6  *
7  *    Version $Id$
8  */
9 /*
10    Copyright (C) 2004 Kern Sibbald and John Walker
11
12    This program is free software; you can redistribute it and/or
13    modify it under the terms of the GNU General Public License
14    as published by the Free Software Foundation; either version 2
15    of the License, or (at your option) any later version.
16
17    This program is distributed in the hope that it will be useful,
18    but WITHOUT ANY WARRANTY; without even the implied warranty of
19    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20    GNU General Public License for more details.
21
22    You should have received a copy of the GNU General Public License
23    along with this program; if not, write to the Free Software
24    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25  */
26
27 // ============================================================================
28 // declarations
29 // ============================================================================
30
31 // ----------------------------------------------------------------------------
32 // headers
33 // ----------------------------------------------------------------------------
34
35 #include "wx/wxprec.h"
36
37 #ifdef __BORLANDC__
38    #pragma hdrstop
39 #endif
40
41 // for all others, include the necessary headers (this file is usually all you
42 // need because it includes almost all "standard" wxWindows headers)
43 #ifndef WX_PRECOMP
44    #include "wx/wx.h"
45 #endif
46
47 #include "wxbmainframe.h"
48
49 #include "csprint.h"
50
51 /* Dummy functions */
52 int generate_daemon_event(JCR *jcr, const char *event) { return 1; }
53 int generate_job_event(JCR *jcr, const char *event) { return 1; }
54
55
56 // ----------------------------------------------------------------------------
57 // resources
58 // ----------------------------------------------------------------------------
59
60 class MyApp : public wxApp
61 {
62 public:
63    virtual bool OnInit();
64 };
65
66 // ============================================================================
67 // implementation
68 // ============================================================================
69
70 IMPLEMENT_APP(MyApp)
71
72 // ----------------------------------------------------------------------------
73 // the application class
74 // ----------------------------------------------------------------------------
75
76 // 'Main program' equivalent: the program execution "starts" here
77 bool MyApp::OnInit()
78 {
79    wxbMainFrame *frame = wxbMainFrame::CreateInstance(_T("Bacula wx-console"),
80                          wxPoint(50, 50), wxSize(780, 500));
81
82    frame->Show(TRUE);
83
84    frame->Print(wxString("Welcome to bacula wx-console ") << VERSION << " (" << BDATE << ")!\n", CS_DEBUG);
85
86    frame->StartConsoleThread("");
87    
88    return TRUE;
89 }