Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
6b6b35cb2807254d3e937ebcf6686f383641f2cf
[xestiacalendar/.git] / source / main.cpp
1 // main.cpp - Main subroutine (application start).
2 //
3 // (c) 2012-2015 Xestia Software Development.
4 //
5 // This file is part of Xestia Calendar.
6 //
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
10 //
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/> 
19 #include <stdlib.h>
21 #include <wx/wx.h>
22 #include <wx/icon.h>
23 #include <wx/mstream.h>
24 #include <wx/cmdline.h>
25 #include <wx/wxprec.h>
26 #include <wx/filename.h>
27 #include <curl/curl.h>
29 #include "version.h"
30 #include "forms/main/frmMain.h"
32 class XestiaCALApp: public wxApp
33 {
34     virtual bool OnInit();
35 };
37 IMPLEMENT_APP(XestiaCALApp);
39 bool XestiaCALApp::OnInit()
40 {
42         static const wxCmdLineEntryDesc g_cmdLineDesc [] =
43         {
44                 { wxCMD_LINE_SWITCH, "h", "help", "Displays help on command line parameters",
45                         wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
46                 { wxCMD_LINE_SWITCH, "v", "version", "Displays version number",
47                         wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL },
48                 { wxCMD_LINE_NONE }
49         };
50         
51         // Setup the locale.
53         wxLocale locale;
54         locale.Init(wxLANGUAGE_DEFAULT, wxLOCALE_LOAD_DEFAULT);
55         
56         wxCmdLineParser XCALArgs (g_cmdLineDesc, argc, argv);
57         XCALArgs.Parse();
58         
59         if (XCALArgs.Found(wxT("v"))){
60     
61                 // Print out the version number.    
63                 wxPuts(XSDCAL_VERSION);
64                 return false;
65     
66         }
67         
68         frmMain *frame = new frmMain( NULL );
69         frame->Show(true);
70         //frmActivityMgr *frameActMgr = new frmActivityMgr ( frame );
71         //frame->SetupPointers(frameActMgr);
72         //frame->SetupForm();
73         //frame->SetIcon(appicon);
74         
75         SetTopWindow(frame);
76         
77         return true;
78         
79 }
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy