1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-22 22:13:35 +02:00
vcmi/launcher/aboutProject/aboutproject_moc.cpp

86 lines
2.3 KiB
C++
Raw Normal View History

2023-06-30 14:24:43 +02:00
/*
* aboutproject_moc.cpp, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#include "StdInc.h"
#include "aboutproject_moc.h"
#include "ui_aboutproject_moc.h"
#include "../updatedialog_moc.h"
#include "../../lib/GameConstants.h"
#include "../../lib/VCMIDirs.h"
AboutProjectView::AboutProjectView(QWidget * parent)
: QWidget(parent)
, ui(new Ui::AboutProjectView)
{
ui->setupUi(this);
ui->lineEditUserDataDir->setText(pathToQString(VCMIDirs::get().userDataPath()));
ui->lineEditGameDir->setText(pathToQString(VCMIDirs::get().binaryPath()));
ui->lineEditTempDir->setText(pathToQString(VCMIDirs::get().userLogsPath()));
ui->lineEditBuildVersion->setText(QString::fromStdString(GameConstants::VCMI_VERSION));
ui->lineEditOperatingSystem->setText(QSysInfo::prettyProductName());
2023-06-30 14:24:43 +02:00
}
void AboutProjectView::changeEvent(QEvent *event)
{
if(event->type() == QEvent::LanguageChange)
ui->retranslateUi(this);
QWidget::changeEvent(event);
}
2023-06-30 14:24:43 +02:00
void AboutProjectView::on_updatesButton_clicked()
{
UpdateDialog::showUpdateDialog(true);
}
void AboutProjectView::on_openGameDataDir_clicked()
{
QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(ui->lineEditGameDir->text()).absoluteFilePath()));
}
void AboutProjectView::on_openUserDataDir_clicked()
{
QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(ui->lineEditUserDataDir->text()).absoluteFilePath()));
}
void AboutProjectView::on_openTempDir_clicked()
{
QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(ui->lineEditTempDir->text()).absoluteFilePath()));
}
void AboutProjectView::on_pushButtonDiscord_clicked()
{
QDesktopServices::openUrl(QUrl("https://discord.gg/chBT42V"));
}
void AboutProjectView::on_pushButtonSlack_clicked()
{
QDesktopServices::openUrl(QUrl("https://slack.vcmi.eu/"));
}
void AboutProjectView::on_pushButtonGithub_clicked()
{
QDesktopServices::openUrl(QUrl("https://github.com/vcmi/vcmi"));
}
2023-07-03 13:30:13 +02:00
void AboutProjectView::on_pushButtonHomepage_clicked()
{
QDesktopServices::openUrl(QUrl("https://vcmi.eu/"));
}
void AboutProjectView::on_pushButtonBugreport_clicked()
{
QDesktopServices::openUrl(QUrl("https://github.com/vcmi/vcmi/issues"));
}