About dialog now uses Qt Designer ui file.

Updated translations again.
This commit is contained in:
Vesa Pikki 2009-07-02 19:36:45 +03:00
parent 7d2c26bd25
commit 8694f6e982
9 changed files with 251 additions and 137 deletions

146
gui/about.ui Normal file
View File

@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>About</class>
<widget class="QDialog" name="About">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>478</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>About Cppcheck</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="mIcon">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="gui.qrc">:/icon.png</pixmap>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="mVersion">
<property name="text">
<string>Version %1</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="mName">
<property name="text">
<string>Cppcheck - A tool for static C/C++ code analysis.</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="mCopyright">
<property name="text">
<string>Copyright (C) 2007-2009 Daniel Marjamäki and cppcheck team.</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="mLicense">
<property name="text">
<string>This program is licensed under the terms
of the GNU General Public License version 3</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="mHomepage">
<property name="text">
<string>Visit Cppcheck homepage at %1</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="mButtons">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="gui.qrc"/>
</resources>
<connections>
<connection>
<sender>mButtons</sender>
<signal>accepted()</signal>
<receiver>About</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>mButtons</sender>
<signal>rejected()</signal>
<receiver>About</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -24,52 +24,11 @@
AboutDialog::AboutDialog(const QString &version, QWidget *parent) AboutDialog::AboutDialog(const QString &version, QWidget *parent)
: QDialog(parent) : QDialog(parent)
, mVersion(version)
{ {
setWindowTitle(tr("About cppcheck")); mUI.setupUi(this);
// Left icon area and right text area
QHBoxLayout *iconLayout = new QHBoxLayout();
// Keep icon at the top of the dialog
QVBoxLayout *iconVLayout = new QVBoxLayout();
// Texts
QVBoxLayout *mainLayout = new QVBoxLayout();
// Keep close button in right
QHBoxLayout *btnLayout = new QHBoxLayout();
QIcon *icon = new QIcon(":icon.png"); mUI.mVersion->setText(mUI.mVersion->text().arg(version));
QLabel *iconLabel = new QLabel();
iconLabel->setPixmap(icon->pixmap(QSize(48, 48)));
QLabel *name = new QLabel(tr("Cppcheck - A tool for static C/C++ code analysis."));
QLabel *ver = new QLabel(QString(tr("Version %1")).arg(mVersion));
QLabel *copy = new QLabel(("Copyright (C) 2007-2009 Daniel Marjamäki and cppcheck team."));
copy->setWordWrap(true);
QLabel *gpl = new QLabel(tr("This program is licensed under the terms " \
"of the GNU General Public License version 3"));
gpl->setWordWrap(true);
QString url = "<a href=\"http://cppcheck.wiki.sourceforge.net/\">http://cppcheck.wiki.sourceforge.net/</a>"; QString url = "<a href=\"http://cppcheck.wiki.sourceforge.net/\">http://cppcheck.wiki.sourceforge.net/</a>";
QString homepageText = QString(tr("Visit Cppcheck homepage at %1")).arg(url); mUI.mHomepage->setText(mUI.mHomepage->text().arg(url));
QLabel *homepage = new QLabel(homepageText); connect(mUI.mButtons, SIGNAL(accepted()), this, SLOT(accept()));
homepage->setOpenExternalLinks(true);
homepage->setWordWrap(true);
QPushButton *quit = new QPushButton(tr("Close"));
mainLayout->addWidget(name);
mainLayout->addWidget(ver);
mainLayout->addWidget(copy);
mainLayout->addWidget(gpl);
mainLayout->addWidget(homepage);
mainLayout->addStretch();
mainLayout->addLayout(btnLayout);
iconVLayout->addWidget(iconLabel);
iconVLayout->addStretch();
iconLayout->addLayout(iconVLayout);
iconLayout->addLayout(mainLayout);
btnLayout->addStretch();
btnLayout->addWidget(quit);
setLayout(iconLayout);
connect(quit, SIGNAL(clicked()), this, SLOT(close()));
} }

View File

@ -22,7 +22,8 @@
#include <QDialog> #include <QDialog>
#include <QString> #include <QString>
class QWidget; #include "ui_about.h"
/** /**
* @brief About dialog * @brief About dialog
@ -35,7 +36,7 @@ public:
AboutDialog(const QString &version, QWidget *parent = 0); AboutDialog(const QString &version, QWidget *parent = 0);
private: private:
QString mVersion; Ui::About mUI;
}; };
#endif // ABOUT_DIALOG_H #endif // ABOUT_DIALOG_H

View File

@ -2,37 +2,38 @@
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.0"> <TS version="2.0">
<context> <context>
<name>AboutDialog</name> <name>About</name>
<message> <message>
<location filename="aboutdialog.cpp" line="29"/> <location filename="about.ui" line="14"/>
<source>About cppcheck</source> <source>About Cppcheck</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="aboutdialog.cpp" line="42"/> <location filename="about.ui" line="51"/>
<source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="43"/>
<source>Version %1</source> <source>Version %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="aboutdialog.cpp" line="46"/> <location filename="about.ui" line="58"/>
<source>This program is licensed under the terms of the GNU General Public License version 3</source> <source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="aboutdialog.cpp" line="50"/> <location filename="about.ui" line="65"/>
<source>Copyright (C) 2007-2009 Daniel Marjamäki and cppcheck team.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="about.ui" line="72"/>
<source>This program is licensed under the terms
of the GNU General Public License version 3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="about.ui" line="83"/>
<source>Visit Cppcheck homepage at %1</source> <source>Visit Cppcheck homepage at %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="aboutdialog.cpp" line="54"/>
<source>Close</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ApplicationDialog</name> <name>ApplicationDialog</name>

View File

@ -2,36 +2,38 @@
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.0" language="en_US"> <TS version="2.0" language="en_US">
<context> <context>
<name>AboutDialog</name> <name>About</name>
<message> <message>
<location filename="aboutdialog.cpp" line="29"/> <location filename="about.ui" line="14"/>
<source>About cppcheck</source> <source>About Cppcheck</source>
<translation>About Cppcheck</translation> <translation>About Cppcheck</translation>
</message> </message>
<message> <message>
<location filename="aboutdialog.cpp" line="42"/> <location filename="about.ui" line="51"/>
<source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation>Cppcheck - A tool for static C/C++ code analysis.</translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="43"/>
<source>Version %1</source> <source>Version %1</source>
<translation>Version %1</translation> <translation>Version %1</translation>
</message> </message>
<message> <message>
<location filename="aboutdialog.cpp" line="46"/> <location filename="about.ui" line="58"/>
<source>This program is licensed under the terms of the GNU General Public License version 3</source> <source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation>This program is licensed under the terms of the GNU General Public License version 3</translation> <translation>Cppcheck - A tool for static C/C++ code analysis.</translation>
</message> </message>
<message> <message>
<location filename="aboutdialog.cpp" line="50"/> <location filename="about.ui" line="65"/>
<source>Copyright (C) 2007-2009 Daniel Marjamäki and cppcheck team.</source>
<translation>Copyright (C) 2007-2009 Daniel Marjamäki and cppcheck team.</translation>
</message>
<message>
<location filename="about.ui" line="72"/>
<source>This program is licensed under the terms
of the GNU General Public License version 3</source>
<translation>This program is licensed under the terms
of the GNU General Public License version 3</translation>
</message>
<message>
<location filename="about.ui" line="83"/>
<source>Visit Cppcheck homepage at %1</source> <source>Visit Cppcheck homepage at %1</source>
<translation type="unfinished"></translation> <translation>Visit Cppcheck homepage at %1</translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="54"/>
<source>Close</source>
<translation>Close</translation>
</message> </message>
</context> </context>
<context> <context>

View File

@ -2,36 +2,38 @@
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.0" language="fi_FI"> <TS version="2.0" language="fi_FI">
<context> <context>
<name>AboutDialog</name> <name>About</name>
<message> <message>
<location filename="aboutdialog.cpp" line="29"/> <location filename="about.ui" line="14"/>
<source>About cppcheck</source> <source>About Cppcheck</source>
<translation>Tietoa ohjelmasta Cppcheck</translation> <translation>Tietoa ohjelmasta Cppcheck</translation>
</message> </message>
<message> <message>
<location filename="aboutdialog.cpp" line="42"/> <location filename="about.ui" line="51"/>
<source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation>Cppcheck - Työkalu C/C++ koodin staattiseen analysointiin.</translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="43"/>
<source>Version %1</source> <source>Version %1</source>
<translation>Versio %1</translation> <translation>Versio %1</translation>
</message> </message>
<message> <message>
<location filename="aboutdialog.cpp" line="46"/> <location filename="about.ui" line="58"/>
<source>This program is licensed under the terms of the GNU General Public License version 3</source> <source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation>Tämä ohjelma on lisensoitu GNU General Public Lisenssin version 3 alaiseksi</translation> <translation>Cppcheck - Työkalu C/C++ koodin staattiseen analysointiin.</translation>
</message> </message>
<message> <message>
<location filename="aboutdialog.cpp" line="50"/> <location filename="about.ui" line="65"/>
<source>Copyright (C) 2007-2009 Daniel Marjamäki and cppcheck team.</source>
<translation>Copyright (C) 2007-2009 Daniel Marjamäki ja cppcheck tiimi.</translation>
</message>
<message>
<location filename="about.ui" line="72"/>
<source>This program is licensed under the terms
of the GNU General Public License version 3</source>
<translation>Tämä ohjelma on lisensoitu GNU General
Public lisenssin version 3 alaisuuteen</translation>
</message>
<message>
<location filename="about.ui" line="83"/>
<source>Visit Cppcheck homepage at %1</source> <source>Visit Cppcheck homepage at %1</source>
<translation type="unfinished"></translation> <translation>Cppcheckin kotisivu löytyy osoitteesta %1</translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="54"/>
<source>Close</source>
<translation>Sulje</translation>
</message> </message>
</context> </context>
<context> <context>

View File

@ -2,37 +2,38 @@
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.0"> <TS version="2.0">
<context> <context>
<name>AboutDialog</name> <name>About</name>
<message> <message>
<location filename="aboutdialog.cpp" line="29"/> <location filename="about.ui" line="14"/>
<source>About cppcheck</source> <source>About Cppcheck</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="aboutdialog.cpp" line="42"/> <location filename="about.ui" line="51"/>
<source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="43"/>
<source>Version %1</source> <source>Version %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="aboutdialog.cpp" line="46"/> <location filename="about.ui" line="58"/>
<source>This program is licensed under the terms of the GNU General Public License version 3</source> <source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="aboutdialog.cpp" line="50"/> <location filename="about.ui" line="65"/>
<source>Copyright (C) 2007-2009 Daniel Marjamäki and cppcheck team.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="about.ui" line="72"/>
<source>This program is licensed under the terms
of the GNU General Public License version 3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="about.ui" line="83"/>
<source>Visit Cppcheck homepage at %1</source> <source>Visit Cppcheck homepage at %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="aboutdialog.cpp" line="54"/>
<source>Close</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ApplicationDialog</name> <name>ApplicationDialog</name>

View File

@ -2,37 +2,38 @@
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.0"> <TS version="2.0">
<context> <context>
<name>AboutDialog</name> <name>About</name>
<message> <message>
<location filename="aboutdialog.cpp" line="29"/> <location filename="about.ui" line="14"/>
<source>About cppcheck</source> <source>About Cppcheck</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="aboutdialog.cpp" line="42"/> <location filename="about.ui" line="51"/>
<source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="43"/>
<source>Version %1</source> <source>Version %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="aboutdialog.cpp" line="46"/> <location filename="about.ui" line="58"/>
<source>This program is licensed under the terms of the GNU General Public License version 3</source> <source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="aboutdialog.cpp" line="50"/> <location filename="about.ui" line="65"/>
<source>Copyright (C) 2007-2009 Daniel Marjamäki and cppcheck team.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="about.ui" line="72"/>
<source>This program is licensed under the terms
of the GNU General Public License version 3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="about.ui" line="83"/>
<source>Visit Cppcheck homepage at %1</source> <source>Visit Cppcheck homepage at %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="aboutdialog.cpp" line="54"/>
<source>Close</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ApplicationDialog</name> <name>ApplicationDialog</name>

View File

@ -14,7 +14,8 @@ RESOURCES = gui.qrc
FORMS = main.ui \ FORMS = main.ui \
resultsview.ui \ resultsview.ui \
application.ui \ application.ui \
settings.ui settings.ui \
about.ui
TRANSLATIONS = cppcheck_fi.ts \ TRANSLATIONS = cppcheck_fi.ts \
cppcheck_en.ts \ cppcheck_en.ts \