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)
: QDialog(parent)
, mVersion(version)
{
setWindowTitle(tr("About cppcheck"));
// 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();
mUI.setupUi(this);
QIcon *icon = new QIcon(":icon.png");
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);
mUI.mVersion->setText(mUI.mVersion->text().arg(version));
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);
QLabel *homepage = new QLabel(homepageText);
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()));
mUI.mHomepage->setText(mUI.mHomepage->text().arg(url));
connect(mUI.mButtons, SIGNAL(accepted()), this, SLOT(accept()));
}

View File

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

View File

@ -2,37 +2,38 @@
<!DOCTYPE TS>
<TS version="2.0">
<context>
<name>AboutDialog</name>
<name>About</name>
<message>
<location filename="aboutdialog.cpp" line="29"/>
<source>About cppcheck</source>
<location filename="about.ui" line="14"/>
<source>About Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="42"/>
<source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="43"/>
<location filename="about.ui" line="51"/>
<source>Version %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="46"/>
<source>This program is licensed under the terms of the GNU General Public License version 3</source>
<location filename="about.ui" line="58"/>
<source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation type="unfinished"></translation>
</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>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="54"/>
<source>Close</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ApplicationDialog</name>

View File

@ -2,36 +2,38 @@
<!DOCTYPE TS>
<TS version="2.0" language="en_US">
<context>
<name>AboutDialog</name>
<name>About</name>
<message>
<location filename="aboutdialog.cpp" line="29"/>
<source>About cppcheck</source>
<location filename="about.ui" line="14"/>
<source>About Cppcheck</source>
<translation>About Cppcheck</translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="42"/>
<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"/>
<location filename="about.ui" line="51"/>
<source>Version %1</source>
<translation>Version %1</translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="46"/>
<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>
<location filename="about.ui" line="58"/>
<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="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>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="54"/>
<source>Close</source>
<translation>Close</translation>
<translation>Visit Cppcheck homepage at %1</translation>
</message>
</context>
<context>

View File

@ -2,36 +2,38 @@
<!DOCTYPE TS>
<TS version="2.0" language="fi_FI">
<context>
<name>AboutDialog</name>
<name>About</name>
<message>
<location filename="aboutdialog.cpp" line="29"/>
<source>About cppcheck</source>
<location filename="about.ui" line="14"/>
<source>About Cppcheck</source>
<translation>Tietoa ohjelmasta Cppcheck</translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="42"/>
<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"/>
<location filename="about.ui" line="51"/>
<source>Version %1</source>
<translation>Versio %1</translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="46"/>
<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 alaiseksi</translation>
<location filename="about.ui" line="58"/>
<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="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>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="54"/>
<source>Close</source>
<translation>Sulje</translation>
<translation>Cppcheckin kotisivu löytyy osoitteesta %1</translation>
</message>
</context>
<context>

View File

@ -2,37 +2,38 @@
<!DOCTYPE TS>
<TS version="2.0">
<context>
<name>AboutDialog</name>
<name>About</name>
<message>
<location filename="aboutdialog.cpp" line="29"/>
<source>About cppcheck</source>
<location filename="about.ui" line="14"/>
<source>About Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="42"/>
<source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="43"/>
<location filename="about.ui" line="51"/>
<source>Version %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="46"/>
<source>This program is licensed under the terms of the GNU General Public License version 3</source>
<location filename="about.ui" line="58"/>
<source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation type="unfinished"></translation>
</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>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="54"/>
<source>Close</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ApplicationDialog</name>

View File

@ -2,37 +2,38 @@
<!DOCTYPE TS>
<TS version="2.0">
<context>
<name>AboutDialog</name>
<name>About</name>
<message>
<location filename="aboutdialog.cpp" line="29"/>
<source>About cppcheck</source>
<location filename="about.ui" line="14"/>
<source>About Cppcheck</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="42"/>
<source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="43"/>
<location filename="about.ui" line="51"/>
<source>Version %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="46"/>
<source>This program is licensed under the terms of the GNU General Public License version 3</source>
<location filename="about.ui" line="58"/>
<source>Cppcheck - A tool for static C/C++ code analysis.</source>
<translation type="unfinished"></translation>
</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>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="aboutdialog.cpp" line="54"/>
<source>Close</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ApplicationDialog</name>

View File

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