cleanup AboutDialog

This commit is contained in:
Peinthor Rene
2012-02-13 06:56:34 +01:00
parent 536e6891ce
commit 62c970fe3b
3 changed files with 99 additions and 129 deletions

View File

@@ -1,10 +1,8 @@
#include "aboutform.h"
#include <qvariant.h>
#include <qimage.h>
#include <qpixmap.h>
#include <QApplication>
#include <QPixmap>
#include "sqlitedb.h"
/*
* Constructs a aboutForm as a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
@@ -12,18 +10,100 @@
* The dialog will by default be modeless, unless you set 'modal' to
* true to construct a modal dialog.
*/
aboutForm::aboutForm(QWidget* parent, Qt::WindowFlags fl)
AboutDialog::AboutDialog(QWidget* parent, Qt::WindowFlags fl)
: QDialog(parent, fl)
{
setupUi(this);
setupUi();
init();
}
void AboutDialog::setupUi()
{
if (this->objectName().isEmpty())
this->setObjectName(QString::fromUtf8("aboutForm"));
//this->resize(542, 257);
vboxLayout = new QVBoxLayout(this);
vboxLayout->setSpacing(6);
vboxLayout->setContentsMargins(11, 11, 11, 11);
vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
gridLayout = new QGridLayout();
gridLayout->setSpacing(6);
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
hboxLayout = new QHBoxLayout();
hboxLayout->setSpacing(6);
hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
spacer5 = new QSpacerItem(424, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout->addItem(spacer5);
okButton = new QPushButton();
okButton->setObjectName(QString::fromUtf8("okButton"));
okButton->setDefault(true);
hboxLayout->addWidget(okButton);
gridLayout->addLayout(hboxLayout, 1, 0, 1, 3);
spacer13 = new QSpacerItem(16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
gridLayout->addItem(spacer13, 0, 1, 1, 1);
vboxLayout1 = new QVBoxLayout();
vboxLayout1->setSpacing(6);
vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
pixmapLabel1 = new QLabel();
pixmapLabel1->setObjectName(QString::fromUtf8("pixmapLabel1"));
pixmapLabel1->setPixmap(QPixmap(":/oldimages/128"));
pixmapLabel1->setScaledContents(false);
pixmapLabel1->setWordWrap(false);
vboxLayout1->addWidget(pixmapLabel1);
spacer12 = new QSpacerItem(20, 31, QSizePolicy::Minimum, QSizePolicy::Expanding);
vboxLayout1->addItem(spacer12);
gridLayout->addLayout(vboxLayout1, 0, 0, 1, 1);
textLabel1 = new QLabel();
textLabel1->setObjectName(QString::fromUtf8("textLabel1"));
textLabel1->setWordWrap(false);
gridLayout->addWidget(textLabel1, 0, 2, 1, 1);
vboxLayout->addLayout(gridLayout);
retranslateUi();
QObject::connect(okButton, SIGNAL(clicked()), this, SLOT(close()));
QMetaObject::connectSlotsByName(this);
} // setupUi
void AboutDialog::retranslateUi()
{
this->setWindowTitle(QObject::tr("About"));
textLabel1->setText(QObject::tr("<p>Version 2.0</font></p>\n"
"<p></p>\n"
"<p><font size=\"+1\">SQLite Database Browser is an open source, public domain, freeware visual tool used to\n"
"<p><font size=\"+1\">create, design and edit SQLite database files.</font></p>\n"
"<p></p>\n"
"<p>For more information on this program please visit our site at: http://sqlitebrowser.sf.net</p>\n"
"<p></p>\n"
"<p></p>\n"
"<p><font size=\"-1\">This software uses the LGPL Qt Toolkit from http://www.qtsoftware.com</p>\n"
"<p><font size=\"-1\">See LICENSING.txt and Qt_LICENSE_LGPL.txt for licensing terms and information.</p>"));
okButton->setText(QObject::tr("Close"));
} // retranslateUi
/*
* Destroys the object and frees any allocated resources
*/
aboutForm::~aboutForm()
AboutDialog::~AboutDialog()
{
// no need to delete child widgets, Qt does it all for us
}
@@ -32,12 +112,12 @@ aboutForm::~aboutForm()
* Sets the strings of the subwidgets using the current
* language.
*/
void aboutForm::languageChange()
void AboutDialog::languageChange()
{
retranslateUi(this);
retranslateUi();
}
void aboutForm::init()
void AboutDialog::init()
{
this->setWindowTitle(QApplication::applicationName());
}

View File

@@ -1,35 +1,18 @@
#ifndef ABOUTFORM_H
#define ABOUTFORM_H
#include <qvariant.h>
/* QT_BEGIN_NAMESPACE and QT_END_NAMESPACE weren't introduced into QT right away... */
#ifndef QT_BEGIN_NAMESPACE
#define QT_BEGIN_NAMESPACE
#endif
#ifndef QT_END_NAMESPACE
#define QT_END_NAMESPACE
#endif
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QDialog>
#include <QtGui/QGridLayout>
#include <QtGui/QHBoxLayout>
#include <QtGui/QHeaderView>
#include <QtGui/QLabel>
#include <QtGui/QPushButton>
#include <QtGui/QSpacerItem>
#include <QtGui/QVBoxLayout>
QT_BEGIN_NAMESPACE
class Ui_aboutForm
class AboutDialog : public QDialog
{
public:
Q_OBJECT
private:
QVBoxLayout *vboxLayout;
QGridLayout *gridLayout;
QHBoxLayout *hboxLayout;
@@ -41,110 +24,17 @@ public:
QSpacerItem *spacer12;
QLabel *textLabel1;
void setupUi(QDialog *aboutForm)
{
if (aboutForm->objectName().isEmpty())
aboutForm->setObjectName(QString::fromUtf8("aboutForm"));
aboutForm->resize(542, 257);
vboxLayout = new QVBoxLayout(aboutForm);
vboxLayout->setSpacing(6);
vboxLayout->setContentsMargins(11, 11, 11, 11);
vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
gridLayout = new QGridLayout();
gridLayout->setSpacing(6);
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
hboxLayout = new QHBoxLayout();
hboxLayout->setSpacing(6);
hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
spacer5 = new QSpacerItem(424, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout->addItem(spacer5);
okButton = new QPushButton(aboutForm);
okButton->setObjectName(QString::fromUtf8("okButton"));
okButton->setDefault(true);
hboxLayout->addWidget(okButton);
gridLayout->addLayout(hboxLayout, 1, 0, 1, 3);
spacer13 = new QSpacerItem(16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
gridLayout->addItem(spacer13, 0, 1, 1, 1);
vboxLayout1 = new QVBoxLayout();
vboxLayout1->setSpacing(6);
vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
pixmapLabel1 = new QLabel(aboutForm);
pixmapLabel1->setObjectName(QString::fromUtf8("pixmapLabel1"));
pixmapLabel1->setPixmap(QPixmap(":/oldimages/128"));
pixmapLabel1->setScaledContents(false);
pixmapLabel1->setWordWrap(false);
vboxLayout1->addWidget(pixmapLabel1);
spacer12 = new QSpacerItem(20, 31, QSizePolicy::Minimum, QSizePolicy::Expanding);
vboxLayout1->addItem(spacer12);
gridLayout->addLayout(vboxLayout1, 0, 0, 1, 1);
textLabel1 = new QLabel(aboutForm);
textLabel1->setObjectName(QString::fromUtf8("textLabel1"));
textLabel1->setWordWrap(false);
gridLayout->addWidget(textLabel1, 0, 2, 1, 1);
vboxLayout->addLayout(gridLayout);
retranslateUi(aboutForm);
QObject::connect(okButton, SIGNAL(clicked()), aboutForm, SLOT(close()));
QMetaObject::connectSlotsByName(aboutForm);
} // setupUi
void retranslateUi(QDialog *aboutForm)
{
aboutForm->setWindowTitle(QApplication::translate("aboutForm", "About", 0, QApplication::UnicodeUTF8));
textLabel1->setText(QApplication::translate("aboutForm", "<p>Version 2.0</font></p>\n"
"<p></p>\n"
"<p><font size=\"+1\">SQLite Database Browser is an open source, public domain, freeware visual tool used to\n"
"<p><font size=\"+1\">create, design and edit SQLite database files.</font></p>\n"
"<p></p>\n"
"<p>For more information on this program please visit our site at: http://sqlitebrowser.sf.net</p>\n"
"<p></p>\n"
"<p></p>\n"
"<p><font size=\"-1\">This software uses the LGPL Qt Toolkit from http://www.qtsoftware.com</p>\n"
"<p><font size=\"-1\">See LICENSING.txt and Qt_LICENSE_LGPL.txt for licensing terms and information.</p>"
, 0, QApplication::UnicodeUTF8));
okButton->setText(QApplication::translate("aboutForm", "Close", 0, QApplication::UnicodeUTF8));
} // retranslateUi
};
namespace Ui {
class aboutForm: public Ui_aboutForm {};
} // namespace Ui
QT_END_NAMESPACE
class aboutForm : public QDialog, public Ui::aboutForm
{
Q_OBJECT
public:
aboutForm(QWidget* parent = 0, Qt::WindowFlags fl = Qt::Window);
~aboutForm();
AboutDialog(QWidget* parent = 0, Qt::WindowFlags fl = Qt::Window);
~AboutDialog();
protected slots:
virtual void languageChange();
private:
void init();
void setupUi();
void retranslateUi();
};

View File

@@ -1589,7 +1589,7 @@ void MainWindow::helpWhatsThis()
void MainWindow::helpAbout()
{
aboutForm * aForm = new aboutForm( this );
AboutDialog * aForm = new AboutDialog( this );
aForm ->exec() ;
}