-#include "common.h"
#include "aboutDialog.h"
+#include "ui_about.h"
+#include "gui.h"
-AboutDialog::AboutDialog (QWidget* parent, Qt::WindowFlags f) : QDialog (parent, f) {
- // Application icon - in full 64 x 64 glory.
- QLabel* icon = new QLabel;
- icon->setPixmap (getIcon ("ldforge"));
-
- // Heading - application label and copyright information
- QLabel* title = new QLabel( fmt( tr( "" APPNAME " %1
"
- "Copyright (C) 2013 Santeri Piippo" ), fullVersionString ()));
+AboutDialog::AboutDialog( QWidget* parent, Qt::WindowFlags f ) : QDialog( parent, f )
+{
+ Ui::AboutUI ui;
+ ui.setupUi( this );
- // Body text
- QLabel* info = new QLabel (tr (
- "This software is intended for usage as a parts
"
- "authoring tool for the LDraw parts library.
"
-
- "" APPNAME " is free software, and you are welcome
"
- "to redistribute it under the terms of GPL v3. See the
"
- "LICENSE text file for details. If the license text is not
"
- "available for some reason, see
"
- "http://www.gnu.org/licenses/ for the license terms.
"
-
- "The graphical assets of " APPNAME " are licensed under the
"
- "CC Attribution-ShareAlike 3.0 Unported license. The
"
- "GNU GPL applies to the source code of the program.
"
- "The application icon is derived from this image. The
"
- "linked image (retrieved 22 May 2013) was released
"
- "into the public domain.
"
- ));
+ ui.versionInfo->setText( fmt( tr( "LDForge %1" ), fullVersionString() ));
- // Rest in peace, James.
- QLabel* memorial = new QLabel( tr( "In living memory of James Jessiman." ));
-
- QDialogButtonBox* buttons = new QDialogButtonBox (QDialogButtonBox::Close);
- QPushButton* helpButton = new QPushButton;
-
- helpButton->setText ("Mail Author");
- helpButton->setIcon (getIcon ("mail"));
- buttons->addButton (static_cast (helpButton), QDialogButtonBox::HelpRole);
- connect (buttons, SIGNAL (helpRequested ()), this, SLOT (slot_mail ()));
- connect (buttons, SIGNAL (rejected ()), this, SLOT (reject ()));
+ QPushButton* mailButton = new QPushButton;
+ mailButton->setText( "Contact" );
+ mailButton->setIcon( getIcon( "mail" ));
+ ui.buttonBox->addButton( static_cast( mailButton ), QDialogButtonBox::HelpRole );
+ connect( ui.buttonBox, SIGNAL( helpRequested() ), this, SLOT( slot_mail() ));
- QVBoxLayout* layout = new QVBoxLayout (this);
-
- // Align everything to the center.
- for (QLabel* label : vector ({icon, title, info, memorial})) {
- label->setAlignment (Qt::AlignCenter);
- layout->addWidget (label);
- }
-
- layout->addWidget (buttons);
-
- setWindowTitle ("About " APPNAME);
+ setWindowTitle( "About " APPNAME );
}
-void AboutDialog::slot_mail () {
- QDesktopServices::openUrl (QUrl ("mailto:Santeri Piippo ?subject=LDForge"));
+void AboutDialog::slot_mail()
+{
+ QDesktopServices::openUrl( QUrl( "mailto:Santeri Piippo ?subject=LDForge" ));
}
\ No newline at end of file