mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-07-20 12:32:21 +08:00
feat: ISSUE #I69IJI 自动关闭到托盘以防止下载和安装中断
添加托盘图标,主窗口关闭后仍然在后台运行;左键单机托盘图标显示主窗口 Log: 添加托盘图标;重构 MainWindow 构造函数,拆分 UI 初始化代码至单独函数;修改启动时窗口渐变动画初始化位置至 showEvent 中
This commit is contained in:
parent
4b40e3caca
commit
cf549c540d
@ -19,6 +19,8 @@ Application::Application(int &argc, char **argv)
|
||||
}
|
||||
setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
|
||||
setQuitOnLastWindowClosed(false); // 启用托盘图标时,关闭窗口程序仍然运行
|
||||
|
||||
loadTranslator(); // 载入翻译
|
||||
|
||||
setOrganizationName("spark-union");
|
||||
|
@ -5,6 +5,10 @@
|
||||
#include <DApplicationSettings>
|
||||
#include <DWidgetUtil>
|
||||
|
||||
#include <QDate>
|
||||
#include <QProcessEnvironment>
|
||||
#include <QSettings>
|
||||
#include <QFile>
|
||||
#include <QStandardPaths>
|
||||
|
||||
DCORE_USE_NAMESPACE
|
||||
@ -124,7 +128,6 @@ int main(int argc, char *argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
DGuiApplicationHelper::instance()->setPaletteType(DGuiApplicationHelper::LightType); // 固定主题为浅色主题
|
||||
DApplicationSettings settings; // 定义 DApplicationSettings,自动保存主题设置
|
||||
|
||||
MainWindow w;
|
||||
|
@ -1,10 +1,16 @@
|
||||
#include "mainwindow-dtk.h"
|
||||
#include "ui_mainwindow-dtk.h"
|
||||
#include "utils/widgetanimation.h"
|
||||
#include "widgets/common/progressbutton.h"
|
||||
#include "widgets/downloadlistwidget.h"
|
||||
#include "dbus/dbussparkstoreservice.h"
|
||||
#include "application.h"
|
||||
|
||||
#include <DLabel>
|
||||
#include <DWidgetUtil>
|
||||
#include <DGuiApplicationHelper>
|
||||
#include <DApplicationSettings>
|
||||
#include <QSizePolicy>
|
||||
|
||||
#include <QAbstractButton>
|
||||
|
||||
#define AppPageApplist 0
|
||||
#define AppPageSearchlist 1
|
||||
@ -16,228 +22,28 @@
|
||||
#define UploadServerUrl "https://upload.deepinos.org/"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
: BaseWidgetOpacity(parent), ui(new Ui::MainWindow)
|
||||
: BaseWidgetOpacity(parent)
|
||||
, ui(new Ui::MainWindow)
|
||||
, downloadlistwidget(new DownloadListWidget)
|
||||
, trayIcon(new QSystemTrayIcon(QIcon::fromTheme("spark-store"), this))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowTitle(QObject::tr("Spark Store"));
|
||||
initConfig();
|
||||
|
||||
// FIXME: wayland 不支持直接设置窗口透明度,需要调用 wayland 相关库(考虑抄控制中心“窗口移动时启用透明特效”代码?)
|
||||
QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
|
||||
bool isWayland = config.value("build/isWayland").toBool();
|
||||
if (!isWayland)
|
||||
{
|
||||
WidgetAnimation::widgetOpacity(this, true);
|
||||
}
|
||||
initTmpDir();
|
||||
|
||||
initUI();
|
||||
initConnections();
|
||||
|
||||
searchEdit = new DSearchEdit(ui->titlebar);
|
||||
downloadlistwidget = new DownloadListWidget;
|
||||
downloadButton = new ProgressButton(ui->titlebar);
|
||||
backButtom = new QPushButton(ui->titlebar);
|
||||
ui->appintopage->setDownloadWidget(downloadlistwidget);
|
||||
ui->stackedWidget->setCurrentIndex(0);
|
||||
ui->titlebar->setBackgroundTransparent(true);
|
||||
// ui->titlebar->setSwitchThemeMenuVisible(false); // 去除 dtk 标题栏主题切换菜单
|
||||
setMaskAlpha(250);
|
||||
|
||||
updateUi(0);
|
||||
|
||||
QAction *actionSubmission = new QAction(tr("Submit App"), this);
|
||||
QAction *actionSubmissionWithClient = new QAction(tr("Submit App with client(Recommanded)"), this);
|
||||
QAction *setting = new QAction(tr("Settings"));
|
||||
QAction *upgrade = new QAction(tr("APP Upgrade and Install Settings"));
|
||||
QMenu *menu = new QMenu;
|
||||
menu->addAction(setting);
|
||||
menu->addAction(upgrade);
|
||||
menu->addAction(actionSubmission);
|
||||
menu->addAction(actionSubmissionWithClient);
|
||||
|
||||
ui->titlebar->setMenu(menu);
|
||||
connect(actionSubmission, &QAction::triggered, this, [=]
|
||||
{ QDesktopServices::openUrl(QUrl(UploadServerUrl)); });
|
||||
connect(setting, &QAction::triggered, this, [=]
|
||||
{
|
||||
switchPage(AppPageSettings);
|
||||
ui->settingspage->updateUI(); });
|
||||
connect(upgrade, &QAction::triggered, this, [=]
|
||||
{ QProcess::startDetached("/opt/durapps/spark-store/bin/update-upgrade/ss-update-controler.sh", QStringList()); });
|
||||
// 投稿器
|
||||
connect(actionSubmissionWithClient, &QAction::triggered, this, [=]
|
||||
{
|
||||
QString submitterSpk = "spk://store/tools/spark-store-submitter";
|
||||
QFile actionSubmissionClientStatus("/opt/spark-store-submitter/bin/spark-store-submitter");
|
||||
if (actionSubmissionClientStatus.exists())
|
||||
{
|
||||
qDebug() << "投稿器存在";
|
||||
QProcess::startDetached("/opt/spark-store-submitter/bin/spark-store-submitter", QStringList());
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "投稿器不存在,跳转页面";
|
||||
openUrl(submitterSpk);
|
||||
} });
|
||||
|
||||
// 主题切换
|
||||
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [=](DGuiApplicationHelper::ColorType themeType)
|
||||
{
|
||||
if (themeType == DGuiApplicationHelper::DarkType) {
|
||||
//深色模式
|
||||
setMaskColor(QColor("#2a2b2b"));
|
||||
backButtom->setIcon(QIcon(":/icon/dark/back.svg"));
|
||||
downloadButton->setIcon(":/icon/dark/download.svg");
|
||||
downloadButton->setBackgroundColor(QColor("#444444"));
|
||||
downloadButton->setColor(QColor("#66CCFF"));
|
||||
ui->pushButton_14->setIcon(QIcon(":/icon/dark/update.svg"));
|
||||
for (int i = 0; i < ui->buttonGroup->buttons().size(); i++) {
|
||||
ui->buttonGroup->buttons()[i]->setIcon(QIcon(":/icon/dark/leftbutton_" + QString::number(i) + ".svg"));
|
||||
if (QLocale::system().name() == "zh_CN") {
|
||||
ui->buttonGroup->buttons()[i]->setStyleSheet("QPushButton{background-color:transparent;}\
|
||||
QPushButton:hover{background-color:#7a7a7a;border:0px;border-radius:8px;}\
|
||||
QPushButton:checked{background-color:#6e6e6e;border:0px;border-radius:8px;}");
|
||||
} else {
|
||||
ui->buttonGroup->buttons()[i]->setStyleSheet("QPushButton{background-color:transparent;text-align: left; padding-left: 15px;}\
|
||||
QPushButton:hover{background-color:#7a7a7a;border:0px;border-radius:8px;text-align: left; padding-left: 15px;}\
|
||||
QPushButton:checked{background-color:#6e6e6e;border:0px;border-radius:8px;text-align: left; padding-left: 15px;}");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//亮色模式
|
||||
setMaskColor(QColor("#f3f7f8"));
|
||||
backButtom->setIcon(QIcon(":/icon/light/back.svg"));
|
||||
downloadButton->setBackgroundColor(QColor("#e3e4e4"));
|
||||
downloadButton->setColor(QColor("#66CCFF"));
|
||||
downloadButton->setIcon(":/icon/light/download.svg");
|
||||
ui->pushButton_14->setIcon(QIcon(":/icon/light/update.svg"));
|
||||
for (int i = 0; i < ui->buttonGroup->buttons().size(); i++) {
|
||||
ui->buttonGroup->buttons()[i]->setIcon(QIcon(":/icon/light/leftbutton_" + QString::number(i) + ".svg"));
|
||||
if (QLocale::system().name() == "zh_CN") {
|
||||
ui->buttonGroup->buttons()[i]->setStyleSheet("QPushButton{background-color:transparent;}\
|
||||
QPushButton:hover{background-color:#eAeAeA;border:0px;border-radius:8px;}\
|
||||
QPushButton:checked{background-color:#dddddd;border:0px;border-radius:8px;}");
|
||||
} else {
|
||||
ui->buttonGroup->buttons()[i]->setStyleSheet("QPushButton{background-color:transparent;text-align: left; padding-left: 15px;}\
|
||||
QPushButton:hover{background-color:#eAeAeA;border:0px;border-radius:8px;text-align: left; padding-left: 15px;}\
|
||||
QPushButton:checked{background-color:#dddddd;border:0px;border-radius:8px;text-align: left; padding-left: 15px;}");
|
||||
}
|
||||
}
|
||||
}
|
||||
ui->pushButton_14->setStyleSheet(ui->pushButton_4->styleSheet());
|
||||
ui->applistpage->setTheme(themeType == DGuiApplicationHelper::DarkType);
|
||||
ui->applistpage_1->setTheme(themeType == DGuiApplicationHelper::DarkType);
|
||||
ui->appintopage->setTheme(themeType == DGuiApplicationHelper::DarkType);
|
||||
ui->settingspage->setTheme(themeType == DGuiApplicationHelper::DarkType); });
|
||||
|
||||
// 初始化标题栏控件
|
||||
connect(downloadButton, &ProgressButton::clicked, [=]()
|
||||
{
|
||||
QPoint pos;
|
||||
pos.setX(downloadButton->mapToGlobal(QPoint(0, 0)).x() + downloadButton->width() / 2 - downloadlistwidget->width() / 2);
|
||||
pos.setY(downloadButton->mapToGlobal(QPoint(0, 0)).y() + downloadButton->height() + 5);
|
||||
downloadlistwidget->m_move(pos.x(), pos.y());
|
||||
downloadlistwidget->show(); });
|
||||
|
||||
// appintopage按下下载按钮时标题栏下载列表按钮抖动
|
||||
connect(ui->appintopage, &AppIntoPage::clickedDownloadBtn, [=]()
|
||||
{
|
||||
WidgetAnimation::widgetShake(downloadButton, 6); // 第一个参数是抖动的控件,第二个参数是抖动范围(像素)
|
||||
});
|
||||
|
||||
connect(backButtom, &QPushButton::clicked, [=]()
|
||||
{
|
||||
ui->stackedWidget->setCurrentIndex(pageHistory.at(pageHistory.count() - 2));
|
||||
pageHistory.removeLast();
|
||||
if (pageHistory.count() > 1) {
|
||||
backButtom->show();
|
||||
} else {
|
||||
backButtom->hide();
|
||||
} });
|
||||
downloadlistwidget->hide();
|
||||
backButtom->hide();
|
||||
ui->titlebar->setIcon(QIcon::fromTheme(":/icon/logo.svg"));
|
||||
|
||||
QWidget *w_titlebar = new QWidget(ui->titlebar);
|
||||
QHBoxLayout *ly_titlebar = new QHBoxLayout(w_titlebar);
|
||||
QLabel *title = new QLabel(ui->titlebar);
|
||||
title->setText(tr("Spark Store"));
|
||||
searchEdit->setPlaceholderText(tr("Search or enter spk://"));
|
||||
ly_titlebar->addWidget(title);
|
||||
ly_titlebar->addWidget(backButtom);
|
||||
|
||||
// Check wayland configs
|
||||
// QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
|
||||
if (!config.value("build/isDeepinOS").toBool() && config.value("build/useWayland").toBool())
|
||||
{
|
||||
// Wayland 搜索栏居中
|
||||
ly_titlebar->addStretch(WaylandSearchCenter);
|
||||
}
|
||||
else
|
||||
{
|
||||
// dwayland dxcb 搜索栏顶部右侧居中
|
||||
ly_titlebar->addStretch(OtherSearchCenter);
|
||||
}
|
||||
|
||||
ly_titlebar->addWidget(searchEdit);
|
||||
ly_titlebar->addWidget(downloadButton);
|
||||
ly_titlebar->addStretch(RightSearchSpace);
|
||||
ui->titlebar->setCustomWidget(w_titlebar);
|
||||
// 侧边栏按钮
|
||||
int i = 0;
|
||||
while (i < ui->buttonGroup->buttons().size())
|
||||
{
|
||||
ui->buttonGroup->buttons()[i]->setStyleSheet("QPushButton{qproperty-icon: url(data/images/userMangaer/teacher.png);}");
|
||||
connect(ui->buttonGroup->buttons()[i], &QPushButton::toggled, [=](bool checked)
|
||||
{
|
||||
if (checked == true) {
|
||||
searchEdit->clearEdit();
|
||||
updateUi(i);
|
||||
} });
|
||||
i++;
|
||||
}
|
||||
|
||||
// 搜索事件
|
||||
connect(searchEdit, &DSearchEdit::returnPressed, this, [=]()
|
||||
{
|
||||
QString searchtext = searchEdit->text();
|
||||
if (!searchtext.isEmpty()) {
|
||||
if (searchtext.startsWith("spk://")) {
|
||||
openUrl(searchtext);
|
||||
searchEdit->clearEdit();
|
||||
} else {
|
||||
if (searchtext == "%")
|
||||
{
|
||||
qWarning() << "keyword '%' matches too many results, which will cause QtWebEngine crash.";
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->applistpage_1->getSearchList(searchtext);
|
||||
switchPage(AppPageSearchlist);
|
||||
}
|
||||
}
|
||||
}
|
||||
this->setFocus(); });
|
||||
|
||||
connect(downloadlistwidget, &DownloadListWidget::downloadProgress, this, [=](int i)
|
||||
{ downloadButton->setProgress(i); });
|
||||
// 列表点击事件
|
||||
connect(ui->applistpage, &AppListPage::clicked, this, [=](QUrl spk)
|
||||
{ openUrl(spk.toString()); });
|
||||
connect(ui->applistpage_1, &AppListPage::clicked, this, [=](QUrl spk)
|
||||
{ openUrl(spk.toString()); });
|
||||
connect(ui->settingspage, &SettingsPage::openUrl, this, [=](QUrl spk)
|
||||
{ openUrl(spk.toString()); });
|
||||
emit DGuiApplicationHelper::instance()->themeTypeChanged(DGuiApplicationHelper::instance()->themeType());
|
||||
|
||||
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::newProcessInstance, this, &MainWindow::onNewProcessInstance);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
|
||||
if (downloadlistwidget)
|
||||
{
|
||||
downloadlistwidget->deleteLater();
|
||||
}
|
||||
downloadlistwidget->deleteLater();
|
||||
}
|
||||
|
||||
void MainWindow::initDbus()
|
||||
@ -292,7 +98,279 @@ void MainWindow::openUrl(const QString &url)
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::initConfig()
|
||||
void MainWindow::initUI()
|
||||
{
|
||||
setWindowTitle(QObject::tr("Spark Store"));
|
||||
setMaskAlpha(250);
|
||||
|
||||
initTitleBar();
|
||||
initLeftMenu();
|
||||
|
||||
ui->stackedWidget->setCurrentIndex(0);
|
||||
updateUi(0);
|
||||
|
||||
initTrayIcon();
|
||||
}
|
||||
|
||||
void MainWindow::initTitleBar()
|
||||
{
|
||||
ui->titlebar->setIcon(QIcon::fromTheme("spark-store"));
|
||||
ui->titlebar->setBackgroundTransparent(true);
|
||||
// ui->titlebar->setSwitchThemeMenuVisible(false); // 去除 dtk 标题栏主题切换菜单
|
||||
|
||||
// 初始化标题栏控件
|
||||
DLabel *title = new DLabel(ui->titlebar);
|
||||
title->setText(tr("Spark Store"));
|
||||
|
||||
backButton = new DPushButton(ui->titlebar);
|
||||
|
||||
searchEdit = new DSearchEdit(ui->titlebar);
|
||||
searchEdit->setPlaceholderText(tr("Search or enter spk://"));
|
||||
|
||||
downloadButton = new ProgressButton(ui->titlebar);
|
||||
|
||||
QWidget *w_titlebar = new QWidget(ui->titlebar);
|
||||
QHBoxLayout *ly_titlebar = new QHBoxLayout(w_titlebar);
|
||||
ly_titlebar->addWidget(title);
|
||||
ly_titlebar->addWidget(backButton);
|
||||
// Check wayland configs
|
||||
QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
|
||||
if (!config.value("build/isDeepinOS").toBool() && config.value("build/useWayland").toBool())
|
||||
{
|
||||
// Wayland 搜索栏居中
|
||||
ly_titlebar->addStretch(WaylandSearchCenter);
|
||||
}
|
||||
else
|
||||
{
|
||||
// dwayland dxcb 搜索栏顶部右侧居中
|
||||
ly_titlebar->addStretch(OtherSearchCenter);
|
||||
}
|
||||
ly_titlebar->addWidget(searchEdit);
|
||||
ly_titlebar->addWidget(downloadButton);
|
||||
ly_titlebar->addStretch(RightSearchSpace);
|
||||
ui->titlebar->setCustomWidget(w_titlebar);
|
||||
|
||||
initTitleBarMenu();
|
||||
|
||||
backButton->hide();
|
||||
downloadlistwidget->hide();
|
||||
}
|
||||
|
||||
void MainWindow::initTitleBarMenu()
|
||||
{
|
||||
QAction *actionSubmission = new QAction(tr("Submit App"), this);
|
||||
QAction *actionSubmissionWithClient = new QAction(tr("Submit App with client(Recommanded)"), this);
|
||||
QAction *setting = new QAction(tr("Settings"));
|
||||
QAction *upgrade = new QAction(tr("APP Upgrade and Install Settings"));
|
||||
QMenu *menu = new QMenu(ui->titlebar);
|
||||
menu->addAction(setting);
|
||||
menu->addAction(upgrade);
|
||||
menu->addAction(actionSubmission);
|
||||
menu->addAction(actionSubmissionWithClient);
|
||||
|
||||
ui->titlebar->setMenu(menu);
|
||||
|
||||
connect(actionSubmission, &QAction::triggered, this, [=]
|
||||
{ QDesktopServices::openUrl(QUrl(UploadServerUrl)); });
|
||||
connect(setting, &QAction::triggered, this, [=]
|
||||
{
|
||||
switchPage(AppPageSettings);
|
||||
ui->settingspage->updateUI(); });
|
||||
connect(upgrade, &QAction::triggered, this, [=]
|
||||
{ QProcess::startDetached("/opt/durapps/spark-store/bin/update-upgrade/ss-update-controler.sh", QStringList()); });
|
||||
// 投稿器
|
||||
connect(actionSubmissionWithClient, &QAction::triggered, this, [=]
|
||||
{
|
||||
QString submitterSpk = "spk://store/tools/spark-store-submitter";
|
||||
QFile actionSubmissionClientStatus("/opt/spark-store-submitter/bin/spark-store-submitter");
|
||||
if (actionSubmissionClientStatus.exists())
|
||||
{
|
||||
qDebug() << "投稿器存在";
|
||||
QProcess::startDetached("/opt/spark-store-submitter/bin/spark-store-submitter", QStringList());
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "投稿器不存在,跳转页面";
|
||||
openUrl(submitterSpk);
|
||||
} });
|
||||
}
|
||||
|
||||
void MainWindow::initLeftMenu()
|
||||
{
|
||||
// 侧边栏按钮
|
||||
foreach (QAbstractButton *button, ui->buttonGroup->buttons())
|
||||
{
|
||||
button->setStyleSheet("QPushButton{qproperty-icon: url(data/images/userMangaer/teacher.png);}");
|
||||
connect(button, &QPushButton::toggled, [=](bool checked)
|
||||
{
|
||||
if (checked == true) {
|
||||
searchEdit->clearEdit();
|
||||
updateUi(ui->buttonGroup->buttons().indexOf(button));
|
||||
} });
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::initTrayIcon()
|
||||
{
|
||||
QMenu *menu = new QMenu(this);
|
||||
|
||||
QAction *showAction = new QAction(QObject::tr("Show MainWindow"), menu);
|
||||
QAction *aboutAction = new QAction(qApp->translate("TitleBarMenu", "About"), menu);
|
||||
QAction *exitAction = new QAction(qApp->translate("TitleBarMenu", "Exit"), menu);
|
||||
menu->addAction(showAction);
|
||||
menu->addAction(aboutAction);
|
||||
menu->addAction(exitAction);
|
||||
trayIcon->setContextMenu(menu);
|
||||
|
||||
connect(showAction, &QAction::triggered, this, [=]()
|
||||
{
|
||||
showWindowAnimation = false;
|
||||
closeWindowAnimation = false;
|
||||
|
||||
setWindowState(Qt::WindowActive);
|
||||
activateWindow();
|
||||
show(); });
|
||||
connect(aboutAction, &QAction::triggered, this, [=]()
|
||||
{
|
||||
qobject_cast<Application *>(qApp)->handleAboutAction(); });
|
||||
connect(exitAction, &QAction::triggered, this, [=]()
|
||||
{
|
||||
qobject_cast<Application *>(qApp)->quit(); });
|
||||
|
||||
trayIcon->show();
|
||||
}
|
||||
|
||||
void MainWindow::initConnections()
|
||||
{
|
||||
// 主题切换
|
||||
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [=](DGuiApplicationHelper::ColorType themeType)
|
||||
{
|
||||
if (themeType == DGuiApplicationHelper::DarkType) {
|
||||
//深色模式
|
||||
setMaskColor(QColor("#2a2b2b"));
|
||||
backButton->setIcon(QIcon(":/icon/dark/back.svg"));
|
||||
downloadButton->setIcon(":/icon/dark/download.svg");
|
||||
downloadButton->setBackgroundColor(QColor("#444444"));
|
||||
downloadButton->setColor(QColor("#66CCFF"));
|
||||
ui->pushButton_14->setIcon(QIcon(":/icon/dark/update.svg"));
|
||||
for (int i = 0; i < ui->buttonGroup->buttons().size(); i++) {
|
||||
ui->buttonGroup->buttons()[i]->setIcon(QIcon(":/icon/dark/leftbutton_" + QString::number(i) + ".svg"));
|
||||
if (QLocale::system().name() == "zh_CN") {
|
||||
ui->buttonGroup->buttons()[i]->setStyleSheet("QPushButton{background-color:transparent;}\
|
||||
QPushButton:hover{background-color:#7a7a7a;border:0px;border-radius:8px;}\
|
||||
QPushButton:checked{background-color:#6e6e6e;border:0px;border-radius:8px;}");
|
||||
} else {
|
||||
ui->buttonGroup->buttons()[i]->setStyleSheet("QPushButton{background-color:transparent;text-align: left; padding-left: 15px;}\
|
||||
QPushButton:hover{background-color:#7a7a7a;border:0px;border-radius:8px;text-align: left; padding-left: 15px;}\
|
||||
QPushButton:checked{background-color:#6e6e6e;border:0px;border-radius:8px;text-align: left; padding-left: 15px;}");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//亮色模式
|
||||
setMaskColor(QColor("#f3f7f8"));
|
||||
backButton->setIcon(QIcon(":/icon/light/back.svg"));
|
||||
downloadButton->setBackgroundColor(QColor("#e3e4e4"));
|
||||
downloadButton->setColor(QColor("#66CCFF"));
|
||||
downloadButton->setIcon(":/icon/light/download.svg");
|
||||
ui->pushButton_14->setIcon(QIcon(":/icon/light/update.svg"));
|
||||
for (int i = 0; i < ui->buttonGroup->buttons().size(); i++) {
|
||||
ui->buttonGroup->buttons()[i]->setIcon(QIcon(":/icon/light/leftbutton_" + QString::number(i) + ".svg"));
|
||||
if (QLocale::system().name() == "zh_CN") {
|
||||
ui->buttonGroup->buttons()[i]->setStyleSheet("QPushButton{background-color:transparent;}\
|
||||
QPushButton:hover{background-color:#eAeAeA;border:0px;border-radius:8px;}\
|
||||
QPushButton:checked{background-color:#dddddd;border:0px;border-radius:8px;}");
|
||||
} else {
|
||||
ui->buttonGroup->buttons()[i]->setStyleSheet("QPushButton{background-color:transparent;text-align: left; padding-left: 15px;}\
|
||||
QPushButton:hover{background-color:#eAeAeA;border:0px;border-radius:8px;text-align: left; padding-left: 15px;}\
|
||||
QPushButton:checked{background-color:#dddddd;border:0px;border-radius:8px;text-align: left; padding-left: 15px;}");
|
||||
}
|
||||
}
|
||||
}
|
||||
ui->pushButton_14->setStyleSheet(ui->pushButton_4->styleSheet());
|
||||
ui->applistpage->setTheme(themeType == DGuiApplicationHelper::DarkType);
|
||||
ui->applistpage_1->setTheme(themeType == DGuiApplicationHelper::DarkType);
|
||||
ui->appintopage->setTheme(themeType == DGuiApplicationHelper::DarkType);
|
||||
ui->settingspage->setTheme(themeType == DGuiApplicationHelper::DarkType); });
|
||||
|
||||
connect(downloadButton, &ProgressButton::clicked, [=]()
|
||||
{
|
||||
QPoint pos;
|
||||
pos.setX(downloadButton->mapToGlobal(QPoint(0, 0)).x() + downloadButton->width() / 2 - downloadlistwidget->width() / 2);
|
||||
pos.setY(downloadButton->mapToGlobal(QPoint(0, 0)).y() + downloadButton->height() + 5);
|
||||
downloadlistwidget->m_move(pos.x(), pos.y());
|
||||
downloadlistwidget->show(); });
|
||||
|
||||
// appintopage按下下载按钮时标题栏下载列表按钮抖动
|
||||
connect(ui->appintopage, &AppIntoPage::clickedDownloadBtn, [=]()
|
||||
{
|
||||
WidgetAnimation::widgetShake(downloadButton, 6); // 第一个参数是抖动的控件,第二个参数是抖动范围(像素)
|
||||
});
|
||||
|
||||
connect(backButton, &QPushButton::clicked, [=]()
|
||||
{
|
||||
ui->stackedWidget->setCurrentIndex(pageHistory.at(pageHistory.count() - 2));
|
||||
pageHistory.removeLast();
|
||||
if (pageHistory.count() > 1) {
|
||||
backButton->show();
|
||||
} else {
|
||||
backButton->hide();
|
||||
} });
|
||||
|
||||
// 搜索事件
|
||||
connect(searchEdit, &DSearchEdit::returnPressed, this, [=]()
|
||||
{
|
||||
QString searchtext = searchEdit->text();
|
||||
if (!searchtext.isEmpty()) {
|
||||
if (searchtext.startsWith("spk://")) {
|
||||
openUrl(searchtext);
|
||||
searchEdit->clearEdit();
|
||||
} else {
|
||||
if (searchtext == "%")
|
||||
{
|
||||
qWarning() << "keyword '%' matches too many results, which will cause QtWebEngine crash.";
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->applistpage_1->getSearchList(searchtext);
|
||||
switchPage(AppPageSearchlist);
|
||||
}
|
||||
}
|
||||
}
|
||||
this->setFocus(); });
|
||||
|
||||
connect(downloadlistwidget, &DownloadListWidget::downloadProgress, this, [=](int i)
|
||||
{ downloadButton->setProgress(i); });
|
||||
// 列表点击事件
|
||||
connect(ui->applistpage, &AppListPage::clicked, this, [=](QUrl spk)
|
||||
{ openUrl(spk.toString()); });
|
||||
connect(ui->applistpage_1, &AppListPage::clicked, this, [=](QUrl spk)
|
||||
{ openUrl(spk.toString()); });
|
||||
connect(ui->settingspage, &SettingsPage::openUrl, this, [=](QUrl spk)
|
||||
{ openUrl(spk.toString()); });
|
||||
|
||||
// 托盘图标点击事件
|
||||
connect(trayIcon, &QSystemTrayIcon::activated, this, [=](QSystemTrayIcon::ActivationReason reason)
|
||||
{
|
||||
switch (reason) {
|
||||
case QSystemTrayIcon::Trigger:
|
||||
{
|
||||
showWindowAnimation = false;
|
||||
closeWindowAnimation = false;
|
||||
|
||||
setWindowState(Qt::WindowActive);
|
||||
activateWindow();
|
||||
show();
|
||||
|
||||
Q_FALLTHROUGH();
|
||||
}
|
||||
default:
|
||||
break;
|
||||
} });
|
||||
|
||||
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::newProcessInstance, this, &MainWindow::onNewProcessInstance);
|
||||
}
|
||||
|
||||
void MainWindow::initTmpDir()
|
||||
{
|
||||
// 新建临时文件夹
|
||||
QDir dir;
|
||||
@ -304,11 +382,11 @@ void MainWindow::switchPage(int now) // 临时方案,回家后修改
|
||||
qDebug() << pageHistory.count();
|
||||
if (pageHistory.count() >= 1)
|
||||
{
|
||||
backButtom->show();
|
||||
backButton->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
backButtom->hide();
|
||||
backButton->hide();
|
||||
}
|
||||
ui->stackedWidget->setCurrentIndex(now);
|
||||
ui->stackedWidget->currentWidget()->setFocus();
|
||||
|
@ -1,21 +1,15 @@
|
||||
#ifndef MAINWINDOWDTK_H
|
||||
#define MAINWINDOWDTK_H
|
||||
|
||||
#include "widgets/base/basewidgetopacity.h"
|
||||
|
||||
#include <DMainWindow>
|
||||
#include <DTitlebar>
|
||||
#include <DPushButton>
|
||||
#include <DSearchEdit>
|
||||
#include <QGraphicsDropShadowEffect>
|
||||
#include <DGuiApplicationHelper>
|
||||
|
||||
#include <QPushButton>
|
||||
#include <QDir>
|
||||
#include <QDesktopServices>
|
||||
|
||||
#include "widgets/base/basewidgetopacity.h"
|
||||
#include "widgets/downloadlistwidget.h"
|
||||
#include "widgets/common/progressbutton.h"
|
||||
#include "utils/widgetanimation.h"
|
||||
#include "dbus/dbussparkstoreservice.h"
|
||||
#include <QSystemTrayIcon>
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
|
||||
@ -23,6 +17,8 @@ namespace Ui {
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
class ProgressButton;
|
||||
class DownloadListWidget;
|
||||
class MainWindow : public BaseWidgetOpacity
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -34,8 +30,14 @@ public:
|
||||
void openUrl(const QString &url);
|
||||
|
||||
private:
|
||||
void initUI();
|
||||
void initTitleBar();
|
||||
void initTitleBarMenu();
|
||||
void initLeftMenu();
|
||||
void initTrayIcon();
|
||||
void initConnections();
|
||||
void initDbus();
|
||||
void initConfig();
|
||||
void initTmpDir();
|
||||
void switchPage(int now);
|
||||
void updateUi(int now);
|
||||
|
||||
@ -46,13 +48,16 @@ private slots:
|
||||
void on_pushButton_14_clicked();
|
||||
|
||||
private:
|
||||
QList<int> pageHistory;
|
||||
|
||||
Ui::MainWindow *ui;
|
||||
DownloadListWidget *downloadlistwidget;
|
||||
ProgressButton *downloadButton;
|
||||
QPushButton *backButtom;
|
||||
|
||||
DPushButton *backButton;
|
||||
DSearchEdit *searchEdit;
|
||||
ProgressButton *downloadButton;
|
||||
DownloadListWidget *downloadlistwidget;
|
||||
|
||||
QSystemTrayIcon *trayIcon = nullptr;
|
||||
|
||||
QList<int> pageHistory;
|
||||
};
|
||||
|
||||
#endif // MAINWINDOWDTK_H
|
||||
|
@ -1,15 +1,37 @@
|
||||
#include "basewidgetopacity.h"
|
||||
#include "utils/widgetanimation.h"
|
||||
|
||||
#include <QCloseEvent>
|
||||
#include <QSettings>
|
||||
#include <QStandardPaths>
|
||||
#include <QPropertyAnimation>
|
||||
#include <QCloseEvent>
|
||||
|
||||
BaseWidgetOpacity::BaseWidgetOpacity(QWidget *parent) : DBlurEffectWidget(parent)
|
||||
{
|
||||
// WidgetAnimation::widgetOpacity(this,true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 窗口显示事件
|
||||
* @param event
|
||||
*/
|
||||
void BaseWidgetOpacity::showEvent(QShowEvent *event)
|
||||
{
|
||||
// FIXME: wayland 不支持直接设置窗口透明度,需要调用 wayland 相关库(考虑抄控制中心“窗口移动时启用透明特效”代码?)
|
||||
QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
|
||||
bool isWayland = config.value("build/isWayland").toBool();
|
||||
if (!isWayland)
|
||||
{
|
||||
if (!showWindowAnimation)
|
||||
{
|
||||
showWindowAnimation = true;
|
||||
WidgetAnimation::widgetOpacity(this, true);
|
||||
}
|
||||
}
|
||||
|
||||
DBlurEffectWidget::showEvent(event);
|
||||
}
|
||||
|
||||
/// @brief 窗口关闭事件
|
||||
/// @param event
|
||||
void BaseWidgetOpacity::closeEvent(QCloseEvent *event)
|
||||
@ -17,7 +39,7 @@ void BaseWidgetOpacity::closeEvent(QCloseEvent *event)
|
||||
// FIXME: wayland 不支持直接设置窗口透明度,需要调用 wayland 相关库(考虑抄控制中心“窗口移动时启用透明特效”代码?)
|
||||
QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
|
||||
bool isWayland = config.value("build/isWayland").toBool();
|
||||
if(isWayland)
|
||||
if (isWayland)
|
||||
{
|
||||
return DBlurEffectWidget::closeEvent(event);
|
||||
}
|
||||
|
@ -8,17 +8,17 @@ DWIDGET_USE_NAMESPACE
|
||||
class BaseWidgetOpacity : public DBlurEffectWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BaseWidgetOpacity(QWidget *parent = nullptr);
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
// QWidget interface
|
||||
protected:
|
||||
bool closeWindowAnimation = false;
|
||||
void showEvent(QShowEvent *event) override;
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
|
||||
protected:
|
||||
bool showWindowAnimation = false;
|
||||
bool closeWindowAnimation = false;
|
||||
};
|
||||
|
||||
#endif // BASEWIDGETOPACITY_H
|
||||
|
@ -240,12 +240,12 @@
|
||||
<context>
|
||||
<name>DAboutDialog</name>
|
||||
<message>
|
||||
<location filename="../src/application.cpp" line="88"/>
|
||||
<location filename="../src/application.cpp" line="90"/>
|
||||
<source>Version: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/application.cpp" line="95"/>
|
||||
<location filename="../src/application.cpp" line="97"/>
|
||||
<source>%1 is released under %2</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -452,32 +452,32 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="45"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="161"/>
|
||||
<source>Submit App</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="46"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="162"/>
|
||||
<source>Submit App with client(Recommanded)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="47"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="163"/>
|
||||
<source>Settings</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="48"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="164"/>
|
||||
<source>APP Upgrade and Install Settings</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="161"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="123"/>
|
||||
<source>Spark Store</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="162"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="128"/>
|
||||
<source>Search or enter spk://</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -485,19 +485,19 @@
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../src/application.cpp" line="26"/>
|
||||
<location filename="../src/application.cpp" line="27"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="22"/>
|
||||
<location filename="../src/application.cpp" line="28"/>
|
||||
<location filename="../src/application.cpp" line="29"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="103"/>
|
||||
<source>Spark Store</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/application.cpp" line="31"/>
|
||||
<location filename="../src/application.cpp" line="33"/>
|
||||
<source><span style=' font-size:10pt;font-weight:60;'>An appstore powered by community</span><br/><a href='https://www.spark-app.store/'>https://www.spark-app.store</a><br/><span style=' font-size:12pt;'>Spark developers</span></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/application.cpp" line="92"/>
|
||||
<location filename="../src/application.cpp" line="94"/>
|
||||
<source>Spark Project</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -506,6 +506,11 @@
|
||||
<source>Download list</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="217"/>
|
||||
<source>Show MainWindow</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsPage</name>
|
||||
@ -610,4 +615,17 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TitleBarMenu</name>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="218"/>
|
||||
<source>About</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="219"/>
|
||||
<source>Exit</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
@ -240,12 +240,12 @@
|
||||
<context>
|
||||
<name>DAboutDialog</name>
|
||||
<message>
|
||||
<location filename="../src/application.cpp" line="88"/>
|
||||
<location filename="../src/application.cpp" line="90"/>
|
||||
<source>Version: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/application.cpp" line="95"/>
|
||||
<location filename="../src/application.cpp" line="97"/>
|
||||
<source>%1 is released under %2</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -452,32 +452,32 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="45"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="161"/>
|
||||
<source>Submit App</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="46"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="162"/>
|
||||
<source>Submit App with client(Recommanded)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="47"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="163"/>
|
||||
<source>Settings</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="48"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="164"/>
|
||||
<source>APP Upgrade and Install Settings</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="161"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="123"/>
|
||||
<source>Spark Store</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="162"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="128"/>
|
||||
<source>Search or enter spk://</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -485,19 +485,19 @@
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../src/application.cpp" line="26"/>
|
||||
<location filename="../src/application.cpp" line="27"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="22"/>
|
||||
<location filename="../src/application.cpp" line="28"/>
|
||||
<location filename="../src/application.cpp" line="29"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="103"/>
|
||||
<source>Spark Store</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/application.cpp" line="31"/>
|
||||
<location filename="../src/application.cpp" line="33"/>
|
||||
<source><span style=' font-size:10pt;font-weight:60;'>An appstore powered by community</span><br/><a href='https://www.spark-app.store/'>https://www.spark-app.store</a><br/><span style=' font-size:12pt;'>Spark developers</span></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/application.cpp" line="92"/>
|
||||
<location filename="../src/application.cpp" line="94"/>
|
||||
<source>Spark Project</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -506,6 +506,11 @@
|
||||
<source>Download list</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="217"/>
|
||||
<source>Show MainWindow</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsPage</name>
|
||||
@ -610,4 +615,17 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TitleBarMenu</name>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="218"/>
|
||||
<source>About</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="219"/>
|
||||
<source>Exit</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
@ -131,7 +131,7 @@
|
||||
<location filename="../src/pages/appintopage.ui" line="429"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="432"/>
|
||||
<source><html><head/><body><p>Capable to Ubuntu 22.04</p></body></html></source>
|
||||
<translation type="unfinished"><html><head/><body><p>支持Ubuntu 22.04</p></body></html></translation>
|
||||
<translation><html><head/><body><p>支持Ubuntu 22.04</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="543"/>
|
||||
@ -240,12 +240,12 @@
|
||||
<context>
|
||||
<name>DAboutDialog</name>
|
||||
<message>
|
||||
<location filename="../src/application.cpp" line="88"/>
|
||||
<location filename="../src/application.cpp" line="90"/>
|
||||
<source>Version: %1</source>
|
||||
<translation>版本:%1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/application.cpp" line="95"/>
|
||||
<location filename="../src/application.cpp" line="97"/>
|
||||
<source>%1 is released under %2</source>
|
||||
<translation>%1遵循%2协议发布</translation>
|
||||
</message>
|
||||
@ -452,32 +452,32 @@
|
||||
<translation>更新</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="45"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="161"/>
|
||||
<source>Submit App</source>
|
||||
<translation>投递应用</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="46"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="162"/>
|
||||
<source>Submit App with client(Recommanded)</source>
|
||||
<translation>使用本地投稿器投递应用(推荐)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="47"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="163"/>
|
||||
<source>Settings</source>
|
||||
<translation>设置</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="48"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="164"/>
|
||||
<source>APP Upgrade and Install Settings</source>
|
||||
<translation>应用更新和安装设置</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="161"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="123"/>
|
||||
<source>Spark Store</source>
|
||||
<translation>星火应用商店</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="162"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="128"/>
|
||||
<source>Search or enter spk://</source>
|
||||
<translation>搜索或打开链接</translation>
|
||||
</message>
|
||||
@ -485,19 +485,19 @@
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../src/application.cpp" line="26"/>
|
||||
<location filename="../src/application.cpp" line="27"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="22"/>
|
||||
<location filename="../src/application.cpp" line="28"/>
|
||||
<location filename="../src/application.cpp" line="29"/>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="103"/>
|
||||
<source>Spark Store</source>
|
||||
<translation>星火应用商店</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/application.cpp" line="31"/>
|
||||
<location filename="../src/application.cpp" line="33"/>
|
||||
<source><span style=' font-size:10pt;font-weight:60;'>An appstore powered by community</span><br/><a href='https://www.spark-app.store/'>https://www.spark-app.store</a><br/><span style=' font-size:12pt;'>Spark developers</span></source>
|
||||
<translation><span style=' font-size:10pt;font-weight:60;'>一款由社区提供的应用商店</span><br/><a href='https://www.spark-app.store/'>https://www.spark-app.store</a><br/><span style=' font-size:12pt;'>星火计划开发者</span></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/application.cpp" line="92"/>
|
||||
<location filename="../src/application.cpp" line="94"/>
|
||||
<source>Spark Project</source>
|
||||
<translation>星火计划</translation>
|
||||
</message>
|
||||
@ -506,6 +506,11 @@
|
||||
<source>Download list</source>
|
||||
<translation>下载列表</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="217"/>
|
||||
<source>Show MainWindow</source>
|
||||
<translation>显示主窗口</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsPage</name>
|
||||
@ -610,4 +615,17 @@
|
||||
<translation>缓存目录已清空</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TitleBarMenu</name>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="218"/>
|
||||
<source>About</source>
|
||||
<translation>关于</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainwindow-dtk.cpp" line="219"/>
|
||||
<source>Exit</source>
|
||||
<translation>退出</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
Loading…
x
Reference in New Issue
Block a user