mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-09-07 20:02:21 +08:00
单击版本号打开官网
This commit is contained in:
parent
8198dc48c5
commit
3eb2a0d63a
@ -1,31 +1,42 @@
|
||||
|
||||
#include "gitver.h"
|
||||
#include <QDesktopServices>
|
||||
#include "spkabout.h"
|
||||
#include "gitver.h"
|
||||
|
||||
SpkAbout::SpkAbout(QWidget *parent) : SpkDialog(parent)
|
||||
{
|
||||
setWindowModality(Qt::ApplicationModal);
|
||||
|
||||
mDialogWidget->setMaximumWidth(600);
|
||||
mDialogWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
|
||||
mIconLay = new QHBoxLayout;
|
||||
|
||||
mSpkVersion = new QLabel;
|
||||
mSpkVersion->setText(tr("<h1>Spark Store</h1>"
|
||||
"<h3>Version %1</h3>"
|
||||
"<h3>Version <a href=\"https://www.spark-app.store\">%1</a></h3>"
|
||||
"<t>Code committed on (%2)</t><br>"
|
||||
"<t>Built on %3 %4</t>")
|
||||
.arg(GitVer::DescribeTags())
|
||||
.arg(GitVer::CommitDate())
|
||||
.arg(__DATE__)
|
||||
.arg(__TIME__));
|
||||
.arg(GitVer::DescribeTags(),
|
||||
GitVer::CommitDate(),
|
||||
__DATE__, __TIME__));
|
||||
connect(mSpkVersion, &QLabel::linkActivated,
|
||||
[](const QString &link){ QDesktopServices::openUrl(link); });
|
||||
|
||||
mSpkIcon = new QLabel;
|
||||
mSpkIcon->setPixmap(QIcon(":/icons/spark-store.svg").pixmap(QSize(128, 128)));
|
||||
|
||||
QFile lipsum(":/info/lipsum.txt");
|
||||
lipsum.open(QFile::ReadOnly);
|
||||
auto description =
|
||||
"Spark Store was started when Chinese home-grown Linux operating systems "
|
||||
"had initially hit the market. Because the Linux desktop ecosystem is not "
|
||||
"good enough at the time being, volunteers built this small App Store in "
|
||||
"the hope that users can get useful applications faster.\n\n"
|
||||
"Right now we are not just a Chinese group. We are discovering our way into "
|
||||
"more Debian-based Linux OSes, and build a real community software repository "
|
||||
"for users around the world.";
|
||||
mDescriptionText = new QLabel;
|
||||
mDescriptionText->setText(lipsum.readAll());
|
||||
lipsum.close();
|
||||
mDescriptionText->setWordWrap(true);
|
||||
mDescriptionText->setText(description);
|
||||
|
||||
mIconLay->addWidget(mSpkIcon);
|
||||
mIconLay->addWidget(mSpkVersion);
|
||||
@ -33,7 +44,7 @@ SpkAbout::SpkAbout(QWidget *parent) : SpkDialog(parent)
|
||||
AddLayout(mIconLay);
|
||||
AddSpacing(18);
|
||||
AddWidget(mDescriptionText);
|
||||
SetMargin(18);
|
||||
SetMargin(18, 0, 18, 18);
|
||||
|
||||
GetTitleBar()->SetOperationButton(SpkTitleBar::OperationButton::Close);
|
||||
GetTitleBar()->SetTitle(tr("About Spark Store"));
|
||||
@ -41,17 +52,14 @@ SpkAbout::SpkAbout(QWidget *parent) : SpkDialog(parent)
|
||||
|
||||
SpkAbout::~SpkAbout()
|
||||
{
|
||||
// delete mIconLay;
|
||||
// delete mDescriptionText;
|
||||
// delete mIconLay;
|
||||
// delete mDescriptionText;
|
||||
}
|
||||
|
||||
void SpkAbout::Show()
|
||||
{
|
||||
SpkAbout *b = new SpkAbout;
|
||||
|
||||
|
||||
|
||||
|
||||
b->Exec();
|
||||
delete b;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user