mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-10-26 12:12:21 +08:00
* 添加 Application 类,继承 DApplication,将 main 函数中设置属性、关于信息等操作移至 Application 构造函数中进行 * 1.1. 添加 setOrganizationName 操作,设置组织名称为 spark-union,与 SWRT 保持一致 * 1.2. 设置组织名称后,QStandardPaths::AppConfigLocation 等路径相应改变,修改所有配置文件和缓存文件路径(server.list/config.ini 等) * 1.3. 关于对话框设置父对象后,对话框背景色受主窗口样式表影响,移动部分控件样式表设置方式与位置 * 修复关于窗口不显示组织 Logo 的问题,补充丢失的资源文件,整理资源文件 * 去除 .pro 文件中无效的更新翻译文件脚本调用,整理 .pro 文件,添加编译时更新 ts 文件脚本调用 * 继续修复偶现关闭客户端时崩溃问题(疑似 aria2c 进程未启动,pid 未初始化为随机值,执行 kill 操作时未判断导致) * 修复进入详情页时焦点默认在分享链接按钮上的问题 * 暂时去除没有意义的 DBus 接口,使用 DGuiApplicationHelper::newProcessInstance 获取新进程的启动参数 * 更新翻译文件,去除已经不存在的翻译
59 lines
1.2 KiB
C++
59 lines
1.2 KiB
C++
#ifndef MAINWINDOWDTK_H
|
|
#define MAINWINDOWDTK_H
|
|
|
|
#include <DMainWindow>
|
|
#include <DTitlebar>
|
|
#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"
|
|
|
|
DWIDGET_USE_NAMESPACE
|
|
|
|
namespace Ui {
|
|
class MainWindow;
|
|
}
|
|
|
|
class MainWindow : public BaseWidgetOpacity
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit MainWindow(QWidget *parent = nullptr);
|
|
~MainWindow();
|
|
|
|
void openUrl(QUrl);
|
|
|
|
private:
|
|
void initDbus();
|
|
void initConfig();
|
|
void switchPage(int now);
|
|
void updateUi(int now);
|
|
|
|
private slots:
|
|
//接受来自dbus的url
|
|
void onGetUrl(const QString &url);
|
|
void onNewProcessInstance(qint64 pid, const QStringList &arguments);
|
|
void on_pushButton_14_clicked();
|
|
|
|
private:
|
|
QList<int> pageHistory;
|
|
|
|
Ui::MainWindow *ui;
|
|
DownloadListWidget *downloadlistwidget;
|
|
ProgressButton *downloadButton;
|
|
QPushButton *backButtom;
|
|
DSearchEdit *searchEdit;
|
|
};
|
|
|
|
#endif // MAINWINDOWDTK_H
|