COPASI API  4.16.103
AboutDialog.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2013 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 // Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
7 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
8 // and The University of Manchester.
9 // All rights reserved.
10 
11 // Copyright (C) 2004 - 2007 by Pedro Mendes, Virginia Tech Intellectual
12 // Properties, Inc. and EML Research, gGmbH.
13 // All rights reserved.
14 
15 /*!
16  \file AboutDialog.cpp
17  \brief Implementation file of class AboutDialog
18  */
19 
20 #include "AboutDialog.h"
21 
22 #include <QtGui/QPushButton>
23 #include <QtGui/QPixmap>
24 #include <QtGui/QTextEdit>
25 #include <QtGui/QLayout>
26 #include <QtGui/QSizePolicy>
27 #include <QtGui/QVBoxLayout>
28 #include <QtGui/QBrush>
29 #include <QtGui/QDialogButtonBox>
30 
31 #include "icons/copasi_beta_background.xpm"
32 
33 #include "copasi.h"
34 
35 const char* AboutDialog::text =
36  "<h2>COPASI %1</h2>"
37  "<p>"
38  "COPASI is a simulator for biochemical networks. It is a joint project "
39  "by the Mendes group (VBI and University of Manchester) and the Kummer group "
40  "(University of Heidelberg)"
41  "</p><p>"
42  "Please check for new release at http://www.copasi.org, where new releases "
43  "will be made available for download."
44  "</p><p>"
45  "Should you have any questions regarding the use of COPASI please visit our "
46  "user support at http://www.copasi.org/UserSupportForum."
47  "</p><p>If you find any errors or problem you may email us at bugs@copasi.org or "
48  "use our issue tracker at http://www.copasi.org/tracker."
49  "</p><p>"
50  "COPASI is provided \"AS IS\" without warranty of any kind, either "
51  "expressed or implied, including but not limited to the implied "
52  "warranties of merchantability and fitness for a particular purpose. In "
53  "no event shall the Authors be liable for any damages whatsoever "
54  "including direct, indirect, incidental, consequential, loss of "
55  "business profits or special damages, even if the Authors have been "
56  "advised of the possibility of such damages."
57  "</p><p>"
58  "The following software and algorithms are being used by COPASI: "
59  "<ul>"
60  "<li>Qt 4 GUI framework</li>"
61  "<li>Qwt 5.2.0</li>"
62  "<li>QwtPlot3D 0.2.7</li>"
63  "<li>Expat 2.0.1 XML parser</li>"
64  "<li>libSBML %2</li>"
65  "<li>raptor 1.4.21</li>"
66  "<li>Systems Biology Workbench 2.7.10</li>"
67  "<li>CLAPACK 3.0, LAPACK 3.1.0, or Intel Math Kernel Library</li>"
68  "<li>LSODA and LSODAR from ODEPACK</li>"
69  "<li>Mersenne Twister random number generator, "
70  " Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura</li>"
71  "</ul>"
72  "</p>"
73  ;
74 
75 AboutDialog::AboutDialog(QWidget* parent,
76  const QString & text,
77  const int & width,
78  const int & heigth):
79  QDialog(parent),
80  textEdit(NULL),
81  mainLayout(NULL)
82 {
83  this->setModal(true);
84  this->mainLayout = new QVBoxLayout(this);
85  this->mainLayout->setSizeConstraint(QLayout::SetFixedSize);
86  this->textEdit = new QTextEdit(this);
87 
88  QPalette Palette;
89  Palette.setBrush(QPalette::Base, QBrush(QPixmap((const char**)copasi_beta_background_xpm)));
90 
91  textEdit->setPalette(Palette);
92 
93  QFontMetrics FontMetrics = this->fontMetrics();
94  int w = width * (FontMetrics.width('W') + FontMetrics.width('I')) / 2;
95  int h = heigth * FontMetrics.lineSpacing();
96  this->textEdit->setFixedSize(w, h);
97  this->textEdit->setReadOnly(true);
98  this->textEdit->setText(text);
99  // this->textEdit->setText(QString(text).arg();
100  this->mainLayout->addWidget(this->textEdit);
101  QDialogButtonBox* box = new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, this);
102  this->mainLayout->addWidget(box);
103 
104  connect(box, SIGNAL(rejected()), this, SLOT(closeButton_clicked()));
105 }
106 
108 {
109  pdelete(this->textEdit);
110  pdelete(this->mainLayout);
111 }
112 
114 {
115  close();
116 }
#define pdelete(p)
Definition: copasi.h:215
AboutDialog(QWidget *parent, const QString &text, const int &width, const int &heigth)
Definition: AboutDialog.cpp:75
void closeButton_clicked()
virtual ~AboutDialog()
Header file of class AboutDialog.
QTextEdit * textEdit
Definition: AboutDialog.h:47
QVBoxLayout * mainLayout
Definition: AboutDialog.h:48
static const char * text
Definition: AboutDialog.h:41