src/aboutDialog.cpp

changeset 472
8986414c6ad5
parent 471
fc58b67d445c
child 473
2a84149fe642
equal deleted inserted replaced
471:fc58b67d445c 472:8986414c6ad5
1 /*
2 * LDForge: LDraw parts authoring CAD
3 * Copyright (C) 2013 Santeri Piippo
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #include <QDesktopServices>
20 #include <QPushButton>
21 #include <QUrl>
22 #include "build/moc_aboutDialog.cpp"
23 #include "aboutDialog.h"
24 #include "ui_about.h"
25 #include "gui.h"
26
27 // =============================================================================
28 // -----------------------------------------------------------------------------
29 AboutDialog::AboutDialog (QWidget* parent, Qt::WindowFlags f) :
30 QDialog (parent, f) {
31
32 Ui::AboutUI ui;
33 ui.setupUi (this);
34 ui.versionInfo->setText (fmt (tr ("LDForge %1"), fullVersionString()));
35
36 QPushButton* mailButton = new QPushButton;
37 mailButton->setText ("Contact");
38 mailButton->setIcon (getIcon ("mail"));
39 ui.buttonBox->addButton (static_cast<QAbstractButton*> (mailButton), QDialogButtonBox::HelpRole);
40 connect (ui.buttonBox, SIGNAL (helpRequested()), this, SLOT (slot_mail()));
41
42 setWindowTitle ("About " APPNAME);
43 }
44
45 // =============================================================================
46 // -----------------------------------------------------------------------------
47 void AboutDialog::slot_mail() {
48 QDesktopServices::openUrl (QUrl ("mailto:Santeri Piippo <arezey@gmail.com>?subject=LDForge"));
49 }

mercurial