Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AboutDialog.cpp
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
2 
12 /* This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public
14  * License as published by the Free Software Foundation; either
15  * version 2 of the License, or (at your option) any later version.
16  *
17  * This software 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 GNU
20  * General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public
23  * License along with this software. If not, see
24  * <http://www.gnu.org/licenses/>.
25  *
26  */
27 
28 #include "hugin/AboutDialog.h"
29 
30 #include "base_wx/wxPlatform.h"
31 #include "panoinc.h"
32 #include "hugin/huginApp.h"
33 #include <wx/utils.h>
34 extern "C"
35 {
36 #include "pano13/queryfeature.h"
37 }
38 #ifdef _WIN32
39 // workaround for a conflict between exiv2 and wxWidgets/CMake built
40 #define HAVE_PID_T 1
41 #endif
42 #include <exiv2/exiv2.hpp>
43 #include "lensdb/LensDB.h"
44 #include "sqlite3.h"
45 #include <lcms2.h>
46 #include "vigra/config.hxx"
47 #include "hugin_config.h"
48 
49 AboutDialog::AboutDialog(wxWindow *parent)
50 {
51  wxXmlResource::Get()->LoadDialog(this, parent, "about_dlg");
52 
53  // Version
54  XRCCTRL(*this,"about_version", wxTextCtrl)->ChangeValue(wxString(hugin_utils::GetHuginVersion().c_str(), wxConvLocal));
55 
56 #ifdef __WXMAC__
57  wxFont font(10, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
58 #else
59  wxFont font(8, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
60 #endif
61 
62  // License
63  wxTextCtrl* textCtrl = XRCCTRL(*this, "license_txt", wxTextCtrl);
64  wxString strFile = huginApp::Get()->GetXRCPath() + "data/COPYING.txt";
65 #ifndef _WIN32
66  textCtrl->SetFont(font);
67 #endif
68  textCtrl->LoadFile(strFile);
69 
70  // Upstream
71  textCtrl = XRCCTRL(*this, "upstream_txt", wxTextCtrl);
72  strFile = huginApp::Get()->GetXRCPath() + "data/upstream.txt";
73 #ifndef _WIN32
74  textCtrl->SetFont(font);
75 #endif
76  textCtrl->LoadFile(strFile);
77  GetSystemInformation(&font);
78 
79  // load the appropriate icon (.ico for Windows, .png for other systems)
80 #ifdef __WXMSW__
81  wxIconBundle myIcons(huginApp::Get()->GetXRCPath() + "data/hugin.ico",wxBITMAP_TYPE_ICO);
82  SetIcons(myIcons);
83 #else
84  wxIcon myIcon(huginApp::Get()->GetXRCPath() + "data/hugin.png",wxBITMAP_TYPE_PNG);
85  // set the icon in the title bar
86  SetIcon(myIcon);
87 #endif
88 
89  // set the position and the size (x,y,width,height). -1 = keep existing
90  SetSize(this->FromDIP(wxSize(560, 560)));
91  CenterOnParent();
92 }
93 
95 {
96  wxTextCtrl* infoText=XRCCTRL(*this,"system_txt",wxTextCtrl);
97 #ifndef _WIN32
98  infoText->SetFont(*font);
99 #endif
100  wxString text;
101  text=wxString::Format(_("Operating System: %s"),wxGetOsDescription().c_str());
102  wxString is64;
103  if(wxIsPlatform64Bit())
104  is64=_("64 bit");
105  else
106  is64=_("32 bit");
107  text = text + "\n" + wxString::Format(_("Architecture: %s"), is64.c_str());
108  // wxGetFreeMemory returns a wxMemorySize, which is undocumented.
109  // However, we know -1 is returned on failure, so it must be signed.
110  text = text + "\n" + wxString::Format(_("Free memory: %lld kiB"), wxGetFreeMemory().GetValue() / 1024ll);
111 #ifdef _WIN32
112  UINT cp=GetACP();
113  text = text + "\n" + wxString::Format(_("Active Codepage: %u"), cp);
114  switch(cp)
115  {
116  case 1250:
117  text = text + " (Central European Windows)";
118  break;
119  case 1251:
120  text = text + " (Cyrillic Windows)";
121  break;
122  case 1252:
123  text = text + " (Western European Windows)";
124  break;
125  case 1253:
126  text = text + " (Greek Windows)";
127  break;
128  case 1254:
129  text = text + " (Turkish Windows)";
130  break;
131  case 1255:
132  text = text + " (Hebrew Windows)";
133  break;
134  case 1256:
135  text = text + " (Arabic Windows)";
136  break;
137  case 1257:
138  text = text + " (Baltic Windows)";
139  break;
140  case 1258:
141  text = text + " (Vietnamese Windows)";
142  break;
143  };
144 #endif
145  text = text + "\n\nHugin\n" + wxString::Format(_("Version: %s"), wxString(hugin_utils::GetHuginVersion().c_str(), wxConvLocal).c_str());
146  text = text + "\n" + wxString::Format(_("Path to resources: %s"), huginApp::Get()->GetXRCPath().c_str());
147  text = text + "\n" + wxString::Format(_("Path to data: %s"), huginApp::Get()->GetDataPath().c_str());
149  text = text + "\n" + wxString::Format(_("Hugins camera and lens database: %s"), wxString(lensDB.GetDBFilename().c_str(), wxConvLocal).c_str());
150  text = text + "\n" + _("Multi-threading using C++11 std::thread and OpenMP");
151  if (huginApp::Get()->HasMonitorProfile())
152  {
153  text = text + "\n" + wxString::Format(_("Monitor profile: %s"), huginApp::Get()->GetMonitorProfileName().c_str());
154  }
155  text = text + "\n\n" + _("Libraries");
156  wxVersionInfo info = wxGetLibraryVersionInfo();
157  text = text + "\nwxWidgets: " + info.GetVersionString();
158  if(info.HasDescription())
159  {
160  text = text + "\n" + info.GetDescription();
161  };
162  {
163  char panoVersion[255];
164  if (queryFeatureString(PTVERSION_NAME_FILEVERSION, panoVersion, sizeof(panoVersion) / sizeof(panoVersion[0])))
165  {
166  text = text + "\nlibpano13: " + wxString(panoVersion, wxConvLocal);
167  };
168  }
169  text = text + "\nExiv2: " + wxString(Exiv2::versionString().c_str(), wxConvLocal);
170  text = text + "\nSQLite3: " + wxString(sqlite3_libversion(), wxConvLocal);
171  text = text + "\n" + wxString::Format("Vigra: %s", wxString(VIGRA_VERSION, wxConvLocal).c_str());
172  text = text + "\n" + wxString::Format("LittleCMS2: %i.%i", LCMS_VERSION / 1000, LCMS_VERSION / 10 % 100);
173  infoText->SetValue(text);
174 }
wxString GetDataPath()
return path to data directory, it depends on operating system
static LensDB & GetSingleton()
returns the static LensDB instance
Definition: LensDB.cpp:2001
include file for the hugin project
std::string GetDBFilename() const
returns the filename of the lens database
Definition: LensDB.cpp:2019
static huginApp * Get()
hack.. kind of a pseudo singleton...
Definition: huginApp.cpp:641
main database class
Definition: LensDB.h:44
class to access Hugins camera and lens database
Definition of dialog for numeric transforms.
AboutDialog(wxWindow *parent)
Constructor, read from xrc ressource.
Definition: AboutDialog.cpp:49
std::string GetHuginVersion()
return a string with version numbers
Definition: utils.cpp:907
platform/compiler specific stuff.
static void info(const char *fmt,...)
Definition: svm.cpp:95
const wxString & GetXRCPath()
return the current xrc path
Definition: huginApp.h:130
void GetSystemInformation(wxFont *font)
retrieves the system information
Definition: AboutDialog.cpp:94