scidavis  2.3.0
About: SciDAVis is a free application for Scientific Data Analysis and Visualization (a fork off of QtiPlot).
  Fossies Dox: scidavis-2.3.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

globals.cpp
Go to the documentation of this file.
1 
11 
30 #ifdef SCRIPTING_PYTHON
31 #include <Python.h>
32 #endif
33 #include "globals.h"
34 #include "qwt_global.h"
35 #include <QMessageBox>
36 #include <QIcon>
37 #include <QObject>
38 #include <QMetaObject>
39 #include <QMetaEnum>
40 #include <QtDebug>
41 #include "ui_SciDAVisAbout.h"
42 
43 const char * SciDAVis::copyright_string = "\
44 === Credits ===\n\
45 \n\
46 --- Developers ---\n\
47 \n\
48 The following people have written parts of the SciDAVis source code, ranging from a few lines to large chunks.\n\
49 In alphabetical order.\n\
50 \n\
51 Tilman Benkert[1], Knut Franke, Miquel Garriga, Arun Narayanankutty, Dmitriy Pozitron, Russell Standish\n\
52 \n\
53 --- Documentation ---\n\
54 \n\
55 The following people have written parts of the manual and/or other documentation.\n\
56 In alphabetical order.\n\
57 \n\
58 Knut Franke, Roger Gadiou\n\
59 \n\
60 --- Translations ---\n\
61 \n\
62 The following people have contributed translations or parts thereof.\n\
63 In alphabetical order.\n\
64 \n\
65 Tilman Benkert[1], Markus Bongard, Tobias Burnus, Rémy Claverie, f0ma, José Antonio Lorenzo Fernández, \
66 Pavel Fric, Jan Helebrant, Daniel Klaer, Peter Landgren, Fellype do Nascimento, Tomomasa Ohkubo, \
67 Mikhail Shevyakov, Russell Standish, Mauricio Troviano\n\
68 \n\
69 --- Packagers ---\n\
70 \n\
71 The following people have made installing SciDAVis easier by providing specialized binary packages.\n\
72 In alphabetical order.\n\
73 \n\
74 Burkhard Bunk (Debian), Quentin Denis (SUSE), Yu-Hung Lien (old Mac OS X), Fellype do Nascimento (Slackware), Russell Standish (new MacOSX)\
75 Eric Tanguy (Fedora), Mauricio Troviano (Windows installer)\n\
76 \n\
77 --- QtiPlot ---\n\
78 \n\
79 SciDAVis uses code from QtiPlot, which consisted (at the time of the fork, i.e. QtiPlot 0.9-rc2) of code by the following people:\n\
80 \n\
81 Tilman Benkert[1], Shen Chen, Borries Demeler, José Antonio Lorenzo Fernández, Knut Franke, Vasileios Gkanis, Gudjon Gudjonsson, \
82 Alex Kargovsky, Michael Mac-Vicar, Tomomasa Ohkubo, Aaron Van Tassle, Branimir Vasilic, Ion Vasilief, Vincent Wagelaar\n\
83 \n\
84 The SciDAVis manual is based on the QtiPlot manual, written by (in alphabetical order):\n\
85 \n\
86 Knut Franke, Roger Gadiou, Ion Vasilief\n\
87 \n\
88 footnotes:\n\
89 [1] birth name: Tilman Höner zu Siederdissen\n\
90 \n\
91 === Special Thanks ===\n\
92 \n\
93 We also want to acknowledge the people having helped us indirectly by contributing to the following\n\
94 fine pieces of software. In no particular order.\n\
95 \n\
96 Qt (http://doc.trolltech.com/4.3/credits.html),\n\
97 Qwt (http://qwt.sourceforge.net/#credits),\n\
98 Qwtplot3D (http://qwtplot3d.sourceforge.net/),\n\
99 muParser (http://muparser.sourceforge.net/),\n\
100 Python (http://www.python.org/),\n\
101 liborigin (http://sourceforge.net/projects/liborigin/),\n\
102 Vim (http://www.vim.org/thanks.php/),\n\
103 webgen (http://webgen.rubyforge.org/),\n\
104 Doxygen (http://www.doxygen.org/),\n\
105 Subversion (http://subversion.tigris.org/),\n\
106 GSL (http://www.gnu.org/software/gsl/)\n\
107 \n\
108 ... and many more we just forgot to mention.\n";
109 
111 {
112  return scidavis_versionNo;
113 }
114 
116 {
117  return "SciDAVis " +
118  QString::number((version() & 0xFF0000) >> 16)+"."+
119  QString::number((version() & 0x00FF00) >> 8)+"."+
120  QString::number(version() & 0x0000FF);
121 }
122 
124 {
125  return QString("SciDAVis ") + scidavis_version;
126 }
127 
129 {
130  return QString(extra_version);
131 }
132 
134 {
135  QString text = QString(SciDAVis::copyright_string);
136  text.replace(QRegExp("\\[1\\]"), "<sup>1</sup>");
137  text.replace("é,"&eacute;"); text.replace("á","&aacute;"); text.replace("ö", "&ouml;"); text.replace("\n", "<br>"); text.replace("=== ", "<h1>"); text.replace(" ===","</h1>"); text.replace("--- ", "<h2>"); text.replace(" ---","</h2>"); text.replace(" ---","</h2>"); text.replace("</h1><br><br>", "</h1>"); text.replace("</h2><br><br>", "</h2>"); text.replace("<br><h1>", "<h1>"); text.replace("<br><h2>", "<h2>"); Qt::WindowFlags flags = Qt::WindowTitleHint | Qt::WindowSystemMenuHint; #if QT_VERSION >= 0x040500 flags |= Qt::WindowCloseButtonHint; #endif QDialog *dialog = new QDialog(0, flags); Ui::SciDAVisAbout ui; ui.setupUi(dialog); dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->setWindowTitle(QObject::tr("About SciDAVis")); ui.version_label->setText(versionString() + extraVersion()); ui.release_date_label->setText( QString("Qt: ")+QT_VERSION_STR+". Qwt: "+QWT_VERSION_STR #ifdef SCRIPTING_PYTHON ". Python: "+PY_VERSION #else +". No python" #endif +QObject::tr("\nReleased") + ": " + QString(SciDAVis::release_date)); ui.credits_box->setHtml(text); dialog->exec(); } QString SciDAVis::copyrightString() { return copyright_string; } QString SciDAVis::releaseDateString() { return release_date; } QString SciDAVis::enumValueToString(int key, const QString& enum_name) { int index = staticMetaObject.indexOfEnumerator(enum_name.toUtf8()); if(index == -1) return QString("invalid"); QMetaEnum meta_enum = staticMetaObject.enumerator(index); return QString(meta_enum.valueToKey(key)); } int SciDAVis::enumStringToValue(const QString& string, const QString& enum_name) { int index = staticMetaObject.indexOfEnumerator(enum_name.toUtf8()); if(index == -1) return -1; QMetaEnum meta_enum = staticMetaObject.enumerator(index); return meta_enum.keyToValue(string.toUtf8()); } ","&eacute;");
138  text.replace("á,"&aacute;"); text.replace("ö", "&ouml;"); text.replace("\n", "<br>"); text.replace("=== ", "<h1>"); text.replace(" ===","</h1>"); text.replace("--- ", "<h2>"); text.replace(" ---","</h2>"); text.replace(" ---","</h2>"); text.replace("</h1><br><br>", "</h1>"); text.replace("</h2><br><br>", "</h2>"); text.replace("<br><h1>", "<h1>"); text.replace("<br><h2>", "<h2>"); Qt::WindowFlags flags = Qt::WindowTitleHint | Qt::WindowSystemMenuHint; #if QT_VERSION >= 0x040500 flags |= Qt::WindowCloseButtonHint; #endif QDialog *dialog = new QDialog(0, flags); Ui::SciDAVisAbout ui; ui.setupUi(dialog); dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->setWindowTitle(QObject::tr("About SciDAVis")); ui.version_label->setText(versionString() + extraVersion()); ui.release_date_label->setText( QString("Qt: ")+QT_VERSION_STR+". Qwt: "+QWT_VERSION_STR #ifdef SCRIPTING_PYTHON ". Python: "+PY_VERSION #else +". No python" #endif +QObject::tr("\nReleased") + ": " + QString(SciDAVis::release_date)); ui.credits_box->setHtml(text); dialog->exec(); } QString SciDAVis::copyrightString() { return copyright_string; } QString SciDAVis::releaseDateString() { return release_date; } QString SciDAVis::enumValueToString(int key, const QString& enum_name) { int index = staticMetaObject.indexOfEnumerator(enum_name.toUtf8()); if(index == -1) return QString("invalid"); QMetaEnum meta_enum = staticMetaObject.enumerator(index); return QString(meta_enum.valueToKey(key)); } int SciDAVis::enumStringToValue(const QString& string, const QString& enum_name) { int index = staticMetaObject.indexOfEnumerator(enum_name.toUtf8()); if(index == -1) return -1; QMetaEnum meta_enum = staticMetaObject.enumerator(index); return meta_enum.keyToValue(string.toUtf8()); } ","&aacute;");
139  text.replace("ö, "&ouml;"); text.replace("\n", "<br>"); text.replace("=== ", "<h1>"); text.replace(" ===","</h1>"); text.replace("--- ", "<h2>"); text.replace(" ---","</h2>"); text.replace(" ---","</h2>"); text.replace("</h1><br><br>", "</h1>"); text.replace("</h2><br><br>", "</h2>"); text.replace("<br><h1>", "<h1>"); text.replace("<br><h2>", "<h2>"); Qt::WindowFlags flags = Qt::WindowTitleHint | Qt::WindowSystemMenuHint; #if QT_VERSION >= 0x040500 flags |= Qt::WindowCloseButtonHint; #endif QDialog *dialog = new QDialog(0, flags); Ui::SciDAVisAbout ui; ui.setupUi(dialog); dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->setWindowTitle(QObject::tr("About SciDAVis")); ui.version_label->setText(versionString() + extraVersion()); ui.release_date_label->setText( QString("Qt: ")+QT_VERSION_STR+". Qwt: "+QWT_VERSION_STR #ifdef SCRIPTING_PYTHON ". Python: "+PY_VERSION #else +". No python" #endif +QObject::tr("\nReleased") + ": " + QString(SciDAVis::release_date)); ui.credits_box->setHtml(text); dialog->exec(); } QString SciDAVis::copyrightString() { return copyright_string; } QString SciDAVis::releaseDateString() { return release_date; } QString SciDAVis::enumValueToString(int key, const QString& enum_name) { int index = staticMetaObject.indexOfEnumerator(enum_name.toUtf8()); if(index == -1) return QString("invalid"); QMetaEnum meta_enum = staticMetaObject.enumerator(index); return QString(meta_enum.valueToKey(key)); } int SciDAVis::enumStringToValue(const QString& string, const QString& enum_name) { int index = staticMetaObject.indexOfEnumerator(enum_name.toUtf8()); if(index == -1) return -1; QMetaEnum meta_enum = staticMetaObject.enumerator(index); return meta_enum.keyToValue(string.toUtf8()); } ", "&ouml;");
140  text.replace("\n", "<br>");
141  text.replace("=== ", "<h1>");
142  text.replace(" ===","</h1>");
143  text.replace("--- ", "<h2>");
144  text.replace(" ---","</h2>");
145  text.replace(" ---","</h2>");
146  text.replace("</h1><br><br>", "</h1>");
147  text.replace("</h2><br><br>", "</h2>");
148  text.replace("<br><h1>", "<h1>");
149  text.replace("<br><h2>", "<h2>");
150 
151  Qt::WindowFlags flags = Qt::WindowTitleHint | Qt::WindowSystemMenuHint;
152 #if QT_VERSION >= 0x040500
153  flags |= Qt::WindowCloseButtonHint;
154 #endif
155  QDialog *dialog = new QDialog(0, flags);
156  Ui::SciDAVisAbout ui;
157  ui.setupUi(dialog);
158  dialog->setAttribute(Qt::WA_DeleteOnClose);
159  dialog->setWindowTitle(QObject::tr("About SciDAVis"));
160  ui.version_label->setText(versionString() + extraVersion());
161  ui.release_date_label->setText(
162  QString("Qt: ")+QT_VERSION_STR+". Qwt: "+QWT_VERSION_STR
163 #ifdef SCRIPTING_PYTHON
164  ". Python: "+PY_VERSION
165 #else
166  +". No python"
167 #endif
168  +QObject::tr("\nReleased") + ": " + QString(SciDAVis::release_date));
169  ui.credits_box->setHtml(text);
170 
171  dialog->exec();
172 }
173 
175 {
176  return copyright_string;
177 }
178 
180 {
181  return release_date;
182 }
183 
184 QString SciDAVis::enumValueToString(int key, const QString& enum_name)
185 {
186  int index = staticMetaObject.indexOfEnumerator(enum_name.toUtf8());
187  if(index == -1) return QString("invalid");
188  QMetaEnum meta_enum = staticMetaObject.enumerator(index);
189  return QString(meta_enum.valueToKey(key));
190 }
191 
192 int SciDAVis::enumStringToValue(const QString& string, const QString& enum_name)
193 {
194  int index = staticMetaObject.indexOfEnumerator(enum_name.toUtf8());
195  if(index == -1) return -1;
196  QMetaEnum meta_enum = staticMetaObject.enumerator(index);
197  return meta_enum.keyToValue(string.toUtf8());
198 }
199 
SciDAVis::schemaVersion
static QString schemaVersion()
Return the SciDAVis version string ("SciDAVis x.y.z" without extra version) used in the project file.
Definition: globals.cpp:115
SciDAVis::versionString
static QString versionString()
the user visible release version string (x.Dy usually)
Definition: globals.cpp:123
SciDAVis::version
static int version()
Return the SciDAVis version number.
Definition: globals.cpp:110
SciDAVis::copyright_string
static const char * copyright_string
Copyright string containing the author names etc.
Definition: globals.h:120
SciDAVis::extraVersion
static QString extraVersion()
Return the extra version as a string.
Definition: globals.cpp:128
SciDAVis::copyrightString
static QString copyrightString()
Return the copyright string.
Definition: globals.cpp:174
SciDAVis::extra_version
static const char * extra_version
Extra version information string (like "-alpha", "-beta", "-rc1", etc...)
Definition: globals.h:118
SciDAVis::release_date
static const char * release_date
Release date as a string.
Definition: globals.h:122
SciDAVis::releaseDateString
static QString releaseDateString()
Return the release date as a string.
Definition: globals.cpp:179
globals.h
SciDAVis::enumStringToValue
static int enumStringToValue(const QString &string, const QString &enum_name)
Definition: globals.cpp:192
SciDAVis::scidavis_versionNo
static const int scidavis_versionNo
SciDAVis version number.
Definition: globals.h:115
python-sipcmd.flags
list flags
Definition: python-sipcmd.py:61
SciDAVis::scidavis_version
static const char * scidavis_version
Definition: globals.h:116
SciDAVis::about
static void about()
Show about dialog.
Definition: globals.cpp:133
SciDAVis::enumValueToString
static QString enumValueToString(int key, const QString &enum_name)
Definition: globals.cpp:184