diff --git a/res.qrc b/res.qrc index 414ebd5..f325f16 100644 --- a/res.qrc +++ b/res.qrc @@ -2,6 +2,7 @@ res/img/btn/btn_setting.png res/img/btn/btn_about.png + res/img/btn/btn_update.png res/img/btn/net_ok.png res/img/btn/net_error.png res/img/btn/net_wait.png diff --git a/res/img/btn/btn_update.png b/res/img/btn/btn_update.png new file mode 100644 index 0000000..1f08cd4 Binary files /dev/null and b/res/img/btn/btn_update.png differ diff --git a/res/qss/dark_style.qss b/res/qss/dark_style.qss index 7dd859a..3d3f41e 100644 --- a/res/qss/dark_style.qss +++ b/res/qss/dark_style.qss @@ -11,11 +11,17 @@ QPushButton#ico_button{ QLabel#HEAD_STR,QLabel#SRC_SERVER,QLabel#GAME_UID,QLabel#VERSION_TIPS,QLabel#STATE_TIPS,QLabel#VERSION_TIPS_TXT,QLabel#INFO{ color:#F2F2F2; } + QPushButton#BTN_SETS{ width:25px; height:25px; image:url(":/res/img/btn/btn_setting.png"); } +QPushButton#BTN_UPDATE{ + width:25px; + height:25px; + image:url(":/res/img/btn/btn_update.png"); +} QPushButton#BTN_ABOUT{ width:25px; height:25px; @@ -26,9 +32,7 @@ QPushButton:hover{ padding-left:1px; padding-top:1px; } -QGroupBox#GAME_INFO_GROUP,QGroupBox#ALL_DLC_GROUP{ - color: #F0F0F0F0; -} + QTableView#GAME_INFO_TABLE::item:selected { background-color: #0078d4; } diff --git a/res/qss/light_style.qss b/res/qss/light_style.qss index 75511be..1d36780 100644 --- a/res/qss/light_style.qss +++ b/res/qss/light_style.qss @@ -27,14 +27,16 @@ QPushButton#BTN_SETS{ height:25px; image:url(":/res/img/btn/btn_setting.png"); } +QPushButton#BTN_UPDATE{ + width:25px; + height:25px; + image:url(":/res/img/btn/btn_update.png"); +} QPushButton#BTN_ABOUT{ width:25px; height:25px; image:url(":/res/img/btn/btn_about.png"); } -QGroupBox#GAME_INFO_GROUP,QGroupBox#ALL_DLC_GROUP{ - color: black; -} QTableView#GAME_INFO_TABLE::item:selected { background-color: #0078d4; } diff --git a/src/xsteam_set_ui.cpp b/src/xsteam_set_ui.cpp index 117cf58..c625313 100644 --- a/src/xsteam_set_ui.cpp +++ b/src/xsteam_set_ui.cpp @@ -14,7 +14,8 @@ void xsteam_set_ui::init_set() main_layout = new QVBoxLayout; foot_layout = new QHBoxLayout; body_layout = new QVBoxLayout; - src_group=new QGroupBox(tr("设置参数")); + set_group=new QGroupBox(tr("参数设置")); + set_group->setObjectName("SET_GROUP"); steam_layout=new QHBoxLayout; steam_path_str=new QLabel(tr("Steam路径设置:")); @@ -60,14 +61,14 @@ void xsteam_set_ui::init_set() body_layout->addLayout(steam_api_layout); body_layout->addLayout(steam_head_api_layout); body_layout->addWidget(new QWidget()); - src_group->setLayout(body_layout); + set_group->setLayout(body_layout); _pSaveData = new QPushButton(tr("保存")); foot_layout->addSpacerItem(sparcer_item); foot_layout->addWidget(_pSaveData); foot_layout->addSpacerItem(sparcer_item); - main_layout->addWidget(src_group); + main_layout->addWidget(set_group); main_layout->addLayout(foot_layout); main_layout->setStretch(0, 8); main_layout->setStretch(1, 2); diff --git a/src/xsteam_set_ui.h b/src/xsteam_set_ui.h index 0218247..287733a 100644 --- a/src/xsteam_set_ui.h +++ b/src/xsteam_set_ui.h @@ -45,7 +45,7 @@ private: QVBoxLayout* body_layout; QHBoxLayout* foot_layout; - QGroupBox* src_group; + QGroupBox* set_group; QPushButton* _pSaveData={}; QSpacerItem * sparcer_item = new QSpacerItem(0,0,QSizePolicy::Expanding,QSizePolicy::Fixed); diff --git a/src/xsteam_src_edit_ui.cpp b/src/xsteam_src_edit_ui.cpp index bd2adc6..5dd2d42 100644 --- a/src/xsteam_src_edit_ui.cpp +++ b/src/xsteam_src_edit_ui.cpp @@ -28,7 +28,9 @@ void xsteam_src_edit_ui::init_table_view_style() void xsteam_src_edit_ui::init_src_edit_ui() { setWindowTitle(tr("XSteam源数据")); - src_group = new QGroupBox(tr("数据源信息")); + src_group = new QGroupBox(tr("源信息表")); + src_group->setObjectName("SRC_GROUP"); + gr_Layout = new QVBoxLayout(); main_Layout = new QVBoxLayout; foot_Layout = new QHBoxLayout; diff --git a/src/xsteam_ui.cpp b/src/xsteam_ui.cpp index 3f26637..738303f 100644 --- a/src/xsteam_ui.cpp +++ b/src/xsteam_ui.cpp @@ -63,7 +63,7 @@ void xsteam_ui::xsteam_init_mind_layout() btn_run_steamdb->setObjectName("STEAM_DB"); btn_push_manifest = new QPushButton(tr("清单分享")); btn_push_manifest->setObjectName("PUSH_MANIFEST"); - btn_push_manifest->setVisible(false); + //btn_push_manifest->setVisible(false); server_layout->addWidget(server_tag); server_layout->addWidget(server_txt); @@ -158,7 +158,11 @@ void xsteam_ui::xsteam_init_foot_layout() btn_xs_sets = new QPushButton(); btn_xs_sets->setMaximumSize(25, 25); btn_xs_sets->setObjectName(tr("BTN_SETS")); - + + btn_xs_update = new QPushButton(); + btn_xs_update->setMaximumSize(25, 25); + btn_xs_update->setObjectName(tr("BTN_UPDATE")); + btn_xs_about = new QPushButton(); btn_xs_about->setMaximumSize(25, 25); btn_xs_about->setObjectName(tr("BTN_ABOUT")); @@ -171,6 +175,7 @@ void xsteam_ui::xsteam_init_foot_layout() foot_status_data_layout->addItem(sparcer_item); foot_status_data_layout->addWidget(btn_xs_sets); + foot_status_data_layout->addWidget(btn_xs_update); foot_status_data_layout->addWidget(btn_xs_about); foot_layout->addLayout(foot_status_data_layout); xs_git_fetch = new xsteam_git_fetch(); @@ -192,6 +197,7 @@ void xsteam_ui::xsteam_init_connect() connect(btn_run_steam, SIGNAL(clicked()), this, SLOT(slots_run_steam_steamtools())); connect(btn_run_steamtools, SIGNAL(clicked()), this, SLOT(slots_run_steam_steamtools())); connect(btn_xs_about, SIGNAL(clicked()), this, SLOT(slots_open_about())); + connect(btn_xs_update, SIGNAL(clicked()), this, SLOT(slots_open_update())); connect(btn_fetch_src_data, SIGNAL(clicked()), this, SLOT(slots_fetch_src_data())); connect(btn_uid_push, SIGNAL(clicked()), this, SLOT(slots_imput_update_uid_push())); connect(btn_uid_update, SIGNAL(clicked()), this, SLOT(slots_imput_update_uid_push())); @@ -491,6 +497,13 @@ void xsteam_ui::slots_open_server_edit() connect(xs_src_edit_ui, SIGNAL(signals_update()), this, SLOT(slots_server_combobox_load_data())); xs_src_edit_ui->exec(); } +void xsteam_ui::slots_open_update() +{ + xs_update_ui = xsteam_update_ui::Instance(); + xs_update_ui->setMaximumSize(440, 580); + xs_update_ui->setGeometry(((QWidget *)this->parent())->geometry()); + xs_update_ui->exec(); +} void xsteam_ui::slots_open_setting() { xs_sets_ui = xsteam_set_ui::Instance(); diff --git a/src/xsteam_ui.h b/src/xsteam_ui.h index 65b372b..b99d56c 100644 --- a/src/xsteam_ui.h +++ b/src/xsteam_ui.h @@ -14,6 +14,7 @@ #include "xsteam_src_edit_ui.h" #include "xsteam_set_ui.h" #include "xsteam_about_ui.h" +#include "xsteam_update_ui.h" #include "xsteam_view.h" #include "xsteam_git_fetch.h" #include "xsteam_push_manifest.h" @@ -77,10 +78,12 @@ private: QLabel* version_tips_txt; QLabel* state_tips_txt; QPushButton* btn_xs_sets; - QPushButton* btn_xs_about; + QPushButton* btn_xs_update; + QPushButton* btn_xs_about; xsteam_src_edit_ui* xs_src_edit_ui; xsteam_set_ui * xs_sets_ui; xsteam_about_ui* xs_about_ui; + xsteam_update_ui* xs_update_ui; xsteam_git_fetch* xs_git_fetch; xsteam_push_manifest* xs_push_manifest; QSpacerItem * sparcer_item = new QSpacerItem(0,0,QSizePolicy::Expanding,QSizePolicy::Fixed); @@ -90,6 +93,7 @@ private: private slots: void slots_open_server_edit(); void slots_open_setting(); + void slots_open_update(); void slots_open_about(); void slots_open_steamdb(); void slots_push_manifest(); diff --git a/src/xsteam_update_ui.cpp b/src/xsteam_update_ui.cpp new file mode 100644 index 0000000..7516cda --- /dev/null +++ b/src/xsteam_update_ui.cpp @@ -0,0 +1,43 @@ +#include "xsteam_update_ui.h" + +xsteam_update_ui::xsteam_update_ui() +{ + m_Layout = new QVBoxLayout(); + f_Layout =new QHBoxLayout(); + copyright_tips_txt=new QLabel(tr("Copyright © 2024 JackLee_CN. All rights reserved.")); + info = new QTextEdit(); + info->setReadOnly(true); + m_Layout->addWidget(info); + f_Layout->addItem(sparcer_item); + f_Layout->addWidget(copyright_tips_txt); + f_Layout->addItem(sparcer_item); + m_Layout->addLayout(f_Layout); + load_about(); + setWindowTitle(tr("About XSteam")); + m_Layout->setContentsMargins(0, 0, 0, 0); + setLayout(m_Layout); +} +xsteam_update_ui::~xsteam_update_ui() +{ + delete this; +} +void xsteam_update_ui::load_about() +{ + QFile file(tr(":/res/txt/about.txt")); + if(file.open(QIODevice::ReadOnly | QIODevice::Text)) + { + QString strs; + while(!file.atEnd()) + { + QByteArray line = file.readLine(); + strs.append(QString::fromStdString(line.data())); + } + strs.append(QString::fromStdString("编译环境")+"\n"); + strs.append("qt_version:"+QString::fromStdString(QT_VERSION_STR)+"\n"); + strs.append("gcc_version:"+QString::fromStdString(GCC_GXX_VERSION_STR)+"\n"); + strs.append("g++_version:"+QString::fromStdString(GCC_GXX_VERSION_STR)+"\n"); + strs.append("libcurl_version:"+QString::fromStdString(LIBCURL_VERSION_STR)+"\n"); + strs.append("libgit2_version:"+QString::fromStdString(LIBGIT2_VERSION_STR)+"\n"); + info->setPlainText(strs); + } +} \ No newline at end of file diff --git a/src/xsteam_update_ui.h b/src/xsteam_update_ui.h new file mode 100644 index 0000000..932cae2 --- /dev/null +++ b/src/xsteam_update_ui.h @@ -0,0 +1,48 @@ +#ifndef XSTEAM_UPDATE_UI_H +#define XSTEAM_UPDATE_UI_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class xsteam_update_ui :public QDialog{ + Q_OBJECT +public: + static xsteam_update_ui *Instance() + { + if (!_instance) + { + static QMutex mutex; + mutex.lock(); + if (!_instance) + { + _instance = new xsteam_update_ui(); + } + mutex.unlock(); + } + return _instance; + } +private: + xsteam_update_ui(); + ~xsteam_update_ui(); + xsteam_update_ui(const xsteam_update_ui &other); + const xsteam_update_ui &operator=(const xsteam_update_ui &other); + static xsteam_update_ui* _instance; + static QMutex mutex; + QVBoxLayout* m_Layout={}; + QHBoxLayout* f_Layout={}; + QTextEdit* info={}; + void load_about(); + QLabel* copyright_tips_txt; + QSpacerItem * sparcer_item = new QSpacerItem(0,0,QSizePolicy::Expanding,QSizePolicy::Fixed); +}; +xsteam_update_ui *xsteam_update_ui::_instance = {}; +QMutex xsteam_update_ui::mutex; + +#endif // XSTEAM_UPDATE_UI_H \ No newline at end of file