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  // set the position and the size (x,y,width,height). -1 = keep existing
80  SetSize(this->FromDIP(wxSize(560, 560)));
81  CenterOnParent();
82 }
83 
85 {
86  wxTextCtrl* infoText=XRCCTRL(*this,"system_txt",wxTextCtrl);
87 #ifndef _WIN32
88  infoText->SetFont(*font);
89 #endif
90  wxString text;
91  text=wxString::Format(_("Operating System: %s"),wxGetOsDescription().c_str());
92  wxString is64;
93  if(wxIsPlatform64Bit())
94  is64=_("64 bit");
95  else
96  is64=_("32 bit");
97  text = text + "\n" + wxString::Format(_("Architecture: %s"), is64.c_str());
98  // wxGetFreeMemory returns a wxMemorySize, which is undocumented.
99  // However, we know -1 is returned on failure, so it must be signed.
100  text = text + "\n" + wxString::Format(_("Free memory: %lld kiB"), wxGetFreeMemory().GetValue() / 1024ll);
101 #ifdef _WIN32
102  UINT cp=GetACP();
103  text = text + "\n" + wxString::Format(_("Active Codepage: %u"), cp);
104  switch(cp)
105  {
106  case 1250:
107  text = text + " (Central European Windows)";
108  break;
109  case 1251:
110  text = text + " (Cyrillic Windows)";
111  break;
112  case 1252:
113  text = text + " (Western European Windows)";
114  break;
115  case 1253:
116  text = text + " (Greek Windows)";
117  break;
118  case 1254:
119  text = text + " (Turkish Windows)";
120  break;
121  case 1255:
122  text = text + " (Hebrew Windows)";
123  break;
124  case 1256:
125  text = text + " (Arabic Windows)";
126  break;
127  case 1257:
128  text = text + " (Baltic Windows)";
129  break;
130  case 1258:
131  text = text + " (Vietnamese Windows)";
132  break;
133  };
134 #endif
135  text = text + "\n\nHugin\n" + wxString::Format(_("Version: %s"), wxString(hugin_utils::GetHuginVersion().c_str(), wxConvLocal).c_str());
136  text = text + "\n" + wxString::Format(_("Path to resources: %s"), huginApp::Get()->GetXRCPath().c_str());
137  text = text + "\n" + wxString::Format(_("Path to data: %s"), huginApp::Get()->GetDataPath().c_str());
139  text = text + "\n" + wxString::Format(_("Hugins camera and lens database: %s"), wxString(lensDB.GetDBFilename().c_str(), wxConvLocal).c_str());
140  text = text + "\n" + _("Multi-threading using C++11 std::thread and OpenMP");
141  if (huginApp::Get()->HasMonitorProfile())
142  {
143  text = text + "\n" + wxString::Format(_("Monitor profile: %s"), huginApp::Get()->GetMonitorProfileName().c_str());
144  }
145  text = text + "\n\n" + _("Libraries");
146  wxVersionInfo info = wxGetLibraryVersionInfo();
147  text = text + "\nwxWidgets: " + info.GetVersionString();
148  if(info.HasDescription())
149  {
150  text = text + "\n" + info.GetDescription();
151  };
152  {
153  char panoVersion[255];
154  if (queryFeatureString(PTVERSION_NAME_FILEVERSION, panoVersion, sizeof(panoVersion) / sizeof(panoVersion[0])))
155  {
156  text = text + "\nlibpano13: " + wxString(panoVersion, wxConvLocal);
157  };
158  }
159  text = text + "\nExiv2: " + wxString(Exiv2::versionString().c_str(), wxConvLocal);
160  text = text + "\nSQLite3: " + wxString(sqlite3_libversion(), wxConvLocal);
161  text = text + "\n" + wxString::Format("Vigra: %s", wxString(VIGRA_VERSION, wxConvLocal).c_str());
162  text = text + "\n" + wxString::Format("LittleCMS2: %i.%i", LCMS_VERSION / 1000, LCMS_VERSION / 10 % 100);
163  infoText->SetValue(text);
164 }
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:645
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:112
void GetSystemInformation(wxFont *font)
retrieves the system information
Definition: AboutDialog.cpp:84