/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see . *
***************************************************************************/
#include "about.h"
#include "ui_aboutwidget.h"
#include "../core.h"
#include
AboutDialog::AboutDialog(QWidget *parent):
QDialog(parent),
_ui(new Ui::aboutWidget)
{
setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint);
_ui->setupUi(this);
_ui->labAppName->setText(_ui->labAppName->text() + QString(" ") + qApp->applicationVersion() + QString(""));
QString versionInfo;
versionInfo = tr("built on ");
versionInfo.append(__DATE__);
versionInfo.append(" ");
versionInfo.append(__TIME__);
_ui->labQtVer->setText(tr("using Qt ") + qVersion());
_ui->labVersion->setText(versionInfo);
QTabBar *tabs = new QTabBar;
_ui->frame->layout()->addWidget(tabs);
_ui->frame->layout()->addWidget(_ui->txtArea);
tabs->setFixedHeight(24);
tabs->insertTab(0, tr("About"));
tabs->insertTab(1, tr("Thanks"));
tabs->insertTab(2, tr("Help us"));
connect(tabs, &QTabBar::currentChanged, this, &AboutDialog::changeTab);
_ui->txtArea->setHtml(tabAbout());
}
AboutDialog::~AboutDialog()
{
delete _ui;
}
void AboutDialog::changeTab(int tabIndex)
{
// trnder text info
switch(tabIndex)
{
case 0:
_ui->txtArea->setHtml(tabAbout());
break;
case 1:
_ui->txtArea->setHtml(tabThanks());
break;
case 2:
_ui->txtArea->setHtml(tabHelpUs());
break;
default:
_ui->txtArea->setHtml(tabAbout());
}
}
void AboutDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
_ui->retranslateUi(this);
break;
default:
break;
}
}
void AboutDialog::on_butAboutQt_clicked()
{
qApp->aboutQt();
}
void AboutDialog::on_butClose_clicked()
{
accept();
}
QString AboutDialog::tabAbout()
{
QString str;
str += "ScreenGrab ";
str += tr("is a crossplatform application for fast creating screenshots of your desktop.");
str += "
";
str += tr("It is a light and powerful application and has been written using the Qt framework, so that you are able to use in Windows and Linux.");
str += "
";
str += tr("E-Mail")+" - ";
str += "doomer3d@gmail.com";
str += "
";
str += tr("Web site")+" - ";
str += "http://screengrab.doomer.org/";
str += "
";
str += tr("Licensed under the ");
str += " GPL v2";
str += "
";
str += tr("Copyright © 2009-2013, Artem 'DOOMer' Galichkin");
return str;
}
QString AboutDialog::tabHelpUs()
{
QString str;
str += tr("You can join us and help us if you want. This is an invitation if you like this application.");
str += "
";
str += tr("What you can do?");
str += "";
str += "- " + tr("Translate ScreenGrab to other languages") + "
";
str += "- " + tr("Make suggestions for next releases") + "
";
str += "- " + tr("Report bugs and issues") + "
";
str += "
";
str += tr("E-Mail");
str += "
";
str += "mailto:doomer3d@gmail.com";
str += "
";
str += tr("Bug tracker");
str += "
";
str += "https://github.com/DOOMer/screengrab/issues/";
return str;
}
QString AboutDialog::tabThanks()
{
QString str;
str += "" + tr("Translate:") + "";
str += "
";
str += tr(" Brazilian Portuguese translation") + "
";
str += tr("Marcio Moraes") + " <marciopanto@gmail.com>
";
str += "
";
str += tr(" Ukrainian translation") + "
";
str += tr("Gennadi Motsyo") + " <drool@altlinux.ru>
";
str += "
";
str += tr(" Spanish translation") + "
";
str += tr("Burjans L GarcĂa D") + " <burjans@gmail.com>
";
str += "
";
str += tr(" Italian translation") + "
";
str += "speps <dreamspepser@yahoo.it>
";
str += "
";
str += "" + tr("Testing:") + "";
str += "
";
str += "Jerome Leclanche - " + tr("Dual monitor support and other in Linux") + "
";
str += "Alexander Sokolov - " + tr("Dual monitor support in Linux") + "
";
str += "Alexantia - " + tr("win32-build [Windows XP and 7]") + "
";
str += "iNight - " + tr("old win32-build [Windows Vista]") + "
";
str += "burjans - " + tr("win32-build [Windows 7]") + "
";
return str;
}
void AboutDialog::on_txtArea_anchorClicked(QUrl url)
{
QDesktopServices::openUrl(url);
}