- Reimplemented the about dialog
- Added licenses for external libraries - Translators and license text now live in separate resource files FossilOrigin-Name: 8b95a9008769c1082936f3083d65428c262385db
This commit is contained in:
34
src/AboutDialog.cpp
Normal file
34
src/AboutDialog.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#include "AboutDialog.h"
|
||||
#include "ui_AboutDialog.h"
|
||||
#include <QFile>
|
||||
|
||||
AboutDialog::AboutDialog(QWidget *parent, const QString &fossilVersion) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::AboutDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->lblApp->setText(QCoreApplication::applicationName() + " "+ QCoreApplication::applicationVersion());
|
||||
ui->lblQtVersion->setText(tr("QT version %0").arg(QT_VERSION_STR));
|
||||
|
||||
if(!fossilVersion.isEmpty())
|
||||
ui->lblFossilVersion->setText(tr("Fossil version %0").arg(fossilVersion));
|
||||
|
||||
QFile ftrans(":/docs/docs/Translators.txt");
|
||||
if(ftrans.open(QFile::ReadOnly))
|
||||
{
|
||||
ui->txtTranslators->setText(ftrans.readAll());
|
||||
ftrans.close();
|
||||
}
|
||||
|
||||
QFile flicenses(":/docs/docs/Licenses.txt");
|
||||
if(flicenses.open(QFile::ReadOnly))
|
||||
{
|
||||
ui->txtLicenses->setText(flicenses.readAll());
|
||||
flicenses.close();
|
||||
}
|
||||
}
|
||||
|
||||
AboutDialog::~AboutDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
22
src/AboutDialog.h
Normal file
22
src/AboutDialog.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef ABOUTDIALOG_H
|
||||
#define ABOUTDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class AboutDialog;
|
||||
}
|
||||
|
||||
class AboutDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AboutDialog(QWidget *parent, const QString &fossilVersion);
|
||||
~AboutDialog();
|
||||
|
||||
private:
|
||||
Ui::AboutDialog *ui;
|
||||
};
|
||||
|
||||
#endif // ABOUTDIALOG_H
|
@@ -20,6 +20,7 @@
|
||||
#include "CloneDialog.h"
|
||||
#include "RevisionDialog.h"
|
||||
#include "RemoteDialog.h"
|
||||
#include "AboutDialog.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#define REVISION_LATEST "Latest revision"
|
||||
@@ -1698,33 +1699,10 @@ void MainWindow::on_actionUndo_triggered()
|
||||
void MainWindow::on_actionAbout_triggered()
|
||||
{
|
||||
QString fossil_ver;
|
||||
fossil().getFossilVersion(fossil_ver);
|
||||
|
||||
if(fossil().getFossilVersion(fossil_ver))
|
||||
fossil_ver = tr("Fossil version %0").arg(fossil_ver) + "\n";
|
||||
|
||||
QString qt_ver = tr("QT version %0").arg(QT_VERSION_STR) + "\n\n";
|
||||
|
||||
QMessageBox::about(this, tr("About Fuel..."),
|
||||
QCoreApplication::applicationName() + " "+ QCoreApplication::applicationVersion() + " " +
|
||||
tr("a GUI frontend to the Fossil SCM\n"
|
||||
"by Kostas Karanikolas\n"
|
||||
"Released under the GNU GPL")+"\n\n" +
|
||||
fossil_ver +
|
||||
qt_ver +
|
||||
tr("Icons by Deleket - Jojo Mendoza\n"
|
||||
"Available under the CC Attribution Noncommercial No Derivative 3.0 License") + "\n\n" +
|
||||
tr("Translations with the help of:") + "\n"
|
||||
"stayawake: de_DE\n"
|
||||
"djnavas: es_ES\n"
|
||||
"Fringale: fr_FR\n"
|
||||
"mouse166: ru_RU\n"
|
||||
"emansije: pt_PT\n"
|
||||
"maxxlupi: it_IT\n"
|
||||
"Zangune: it_IT\n"
|
||||
"Fly Man: nl_NL\n"
|
||||
"Rick Van Lieshout: nl_NL\n"
|
||||
"ardiefox: ko_KR\n"
|
||||
);
|
||||
AboutDialog dlg(this, fossil_ver);
|
||||
dlg.exec();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user