1 // qsynthAboutForm.cpp
2 //
3 /****************************************************************************
4    Copyright (C) 2003-2020, rncbc aka Rui Nuno Capela. All rights reserved.
5 
6    This program is free software; you can redistribute it and/or
7    modify it under the terms of the GNU General Public License
8    as published by the Free Software Foundation; either version 2
9    of the License, or (at your option) any later version.
10 
11    This program 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 this program; if not, write to the Free Software Foundation, Inc.,
18    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 
20 *****************************************************************************/
21 
22 #include "qsynthAbout.h"
23 #include "qsynthAboutForm.h"
24 
25 #include <QMessageBox>
26 
27 #ifdef CONFIG_FLUID_VERSION_STR
28 #include <fluidsynth.h>
29 #endif
30 
31 //----------------------------------------------------------------------------
32 // qsynthAboutForm -- UI wrapper form.
33 
34 // Constructor.
35 qsynthAboutForm::qsynthAboutForm ( QWidget *pParent )
36 	: QDialog(pParent)
37 {
38 	// Setup UI struct...
39 	m_ui.setupUi(this);
40 
41 	QStringList list;
42 #ifdef CONFIG_DEBUG
43 	list << tr("Debugging option enabled.");
44 #endif
45 #ifndef CONFIG_SYSTEM_TRAY
46 	list << tr("System tray disabled.");
47 #endif
48 #ifndef CONFIG_FLUID_SERVER
49 	list << tr("Server option disabled.");
50 #endif
51 #ifndef CONFIG_FLUID_SYSTEM_RESET
52 	list << tr("System reset option disabled.");
53 #endif
54 #ifndef CONFIG_FLUID_BANK_OFFSET
55 	list << tr("Bank offset option disabled.");
56 #endif
57 
58 	// Stuff the about box...
59 	QString sText = "<p align=\"center\"><br />\n";
60 	sText += "<b>" QSYNTH_TITLE " - " + tr(QSYNTH_SUBTITLE) + "</b><br />\n";
61 	sText += "<br />\n";
62 	sText += tr("Version") + ": <b>" CONFIG_BUILD_VERSION "</b><br />\n";
63 //	sText += "<small>" + tr("Build") + ": " CONFIG_BUILD_DATE "<small><br />\n";
64 	if (!list.isEmpty()) {
65 		sText += "<small><font color=\"red\">";
66 		sText += list.join("<br />\n");
67 		sText += "</font></small>";
68 	}
69 	sText += "<br />\n";
70 	sText += tr("Using: Qt %1").arg(qVersion());
71 #if defined(QT_STATIC)
72 	sText += "-static";
73 #endif
74 #ifdef CONFIG_FLUID_VERSION_STR
75 	sText += ", ";
76 	sText += tr("FluidSynth %1").arg(::fluid_version_str());
77 #endif
78 	sText += "<br />\n";
79 	sText += "<br />\n";
80 	sText += tr("Website") + ": <a href=\"" QSYNTH_WEBSITE "\">" QSYNTH_WEBSITE "</a><br />\n";
81 	sText += "<br />\n";
82 	sText += "<small>";
83 	sText += QSYNTH_COPYRIGHT "<br />\n";
84 	sText += "<br />\n";
85 	sText += tr("This program is free software; you can redistribute it and/or modify it") + "<br />\n";
86 	sText += tr("under the terms of the GNU General Public License version 2 or later.");
87 	sText += "</small>";
88 	sText += "</p>\n";
89 	m_ui.AboutTextView->setText(sText);
90 
91 	// UI connections...
92 	QObject::connect(m_ui.AboutQtButton,
93 		SIGNAL(clicked()),
94 		SLOT(aboutQt()));
95 	QObject::connect(m_ui.ClosePushButton,
96 		SIGNAL(clicked()),
97 		SLOT(close()));
98 }
99 
100 
101 // Destructor.
102 qsynthAboutForm::~qsynthAboutForm (void)
103 {
104 }
105 
106 
107 // About Qt request.
108 void qsynthAboutForm::aboutQt()
109 {
110 	QMessageBox::aboutQt(this);
111 }
112 
113 
114 // end of qsynthAboutForm.cpp
115