diff --git a/src/aboutform.cpp b/src/aboutform.cpp index 69a37367..9485fde5 100644 --- a/src/aboutform.cpp +++ b/src/aboutform.cpp @@ -1,10 +1,8 @@ #include "aboutform.h" -#include -#include -#include +#include +#include -#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("

Version 2.0

\n" +"

\n" +"

SQLite Database Browser is an open source, public domain, freeware visual tool used to\n" +"

create, design and edit SQLite database files.

\n" +"

\n" +"

For more information on this program please visit our site at: http://sqlitebrowser.sf.net

\n" +"

\n" +"

\n" +"

This software uses the LGPL Qt Toolkit from http://www.qtsoftware.com

\n" +"

See LICENSING.txt and Qt_LICENSE_LGPL.txt for licensing terms and information.

")); + 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()); } diff --git a/src/aboutform.h b/src/aboutform.h index 5417bc0d..8b370f91 100644 --- a/src/aboutform.h +++ b/src/aboutform.h @@ -1,35 +1,18 @@ #ifndef ABOUTFORM_H #define ABOUTFORM_H -#include - -/* 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 -#include -#include -#include #include -#include #include -#include #include #include #include #include -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", "

Version 2.0

\n" -"

\n" -"

SQLite Database Browser is an open source, public domain, freeware visual tool used to\n" -"

create, design and edit SQLite database files.

\n" -"

\n" -"

For more information on this program please visit our site at: http://sqlitebrowser.sf.net

\n" -"

\n" -"

\n" -"

This software uses the LGPL Qt Toolkit from http://www.qtsoftware.com

\n" -"

See LICENSING.txt and Qt_LICENSE_LGPL.txt for licensing terms and information.

" -, 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(); }; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 3cd4ffa3..86192b75 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1589,7 +1589,7 @@ void MainWindow::helpWhatsThis() void MainWindow::helpAbout() { - aboutForm * aForm = new aboutForm( this ); + AboutDialog * aForm = new AboutDialog( this ); aForm ->exec() ; }