diff --git a/.vscode/settings.json b/.vscode/settings.json index 1219347..b2a92bf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -109,7 +109,8 @@ "qgroupbox": "cpp", "qheaderview": "cpp", "qabstractlistmodel": "cpp", - "qtconcurrentrun": "cpp" + "qtconcurrentrun": "cpp", + "*.in": "cpp" }, "Codegeex.RepoIndex": true } \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index f5e960a..50436da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,12 +109,12 @@ SET(PROJECT_SOURCES ${src} ) # 设置消息策略为qFatal来禁用qDebug信息 -#LIST(APPEND CMAKE_CXX_FLAGS "-DQT_NO_DEBUG_OUTPUT") +LIST(APPEND CMAKE_CXX_FLAGS "-DQT_NO_DEBUG_OUTPUT") #资源文件 QT6_ADD_RESOURCES(RCFILES res.qrc) #WIN32 -add_executable(${PROJECT_NAME} ${PROJECT_SOURCES} ${RCFILES} xsteam.rc) +add_executable(${PROJECT_NAME} WIN32 ${PROJECT_SOURCES} ${RCFILES} xsteam.rc) #安全编译 #关闭RPATH特性 @@ -150,6 +150,22 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -fstack-check") #忽略多重定引用 target_link_options(${PROJECT_NAME} PUBLIC -Wl,--allow-multiple-definition) + +# 打印GCC版本号信息 +message(STATUS "G++ version: ${CMAKE_CXX_COMPILER_VERSION}") +# 打印所有CMAKE_开头的变量 +foreach(var IN LISTS CMAKE_VARIABLES) + if(var MATCHES "^CMAKE_") + message(STATUS "${var} = ${${var}}") + endif() +endforeach() +# 获取Qt版本号 +SET(QT_VERSION_STR "${Qt6_VERSION}") +# 打印Qt版本号 +message(STATUS "Qt Version: ${QT_VERSION_STR}") +#设定版本 +configure_file (version.h.in version.h @ONLY) + # 设置链接标志为静态链接 SET(CMAKE_EXE_LINKER_FLAGS -static) diff --git a/res/txt/about.txt b/res/txt/about.txt index d4c777c..6c4ac75 100644 --- a/res/txt/about.txt +++ b/res/txt/about.txt @@ -1,18 +1,16 @@ - About XSteam -software name:XSteam -builder:JackLee_CN -github:vek-zvo -src github(don't open) - - 作者申明 + 作者申明 本软件仅供学习和研究,软件内置数据仅限于测试. 开发者不对本软件所造成的计算机软件侵权法律问题承担任何法律责任. 禁止本软件源码和软件用于任何商业用途. 禁止任何人恶意举报本软件 禁止任何人恶意盗窃本软件测试数据 - 鸣谢列表 - 皓月代码托管平台 - - 倒卖商用举报黑名单 - + 鸣谢列表 + 皓月代码托管平台 + + About XSteam +software name:XSteam +builder:JackLee_CN +github:vek-zvo +src github(don't open) + diff --git a/src/xsteam_about_ui.cpp b/src/xsteam_about_ui.cpp index 3749613..ae1f276 100644 --- a/src/xsteam_about_ui.cpp +++ b/src/xsteam_about_ui.cpp @@ -32,6 +32,11 @@ void xsteam_about_ui::load_about() QByteArray line = file.readLine(); strs.append(QString::fromStdString(line.data())); } + strs.append("QT Version:"+QString::fromStdString(QT_VERSION_STR)+"\n"); + strs.append("GCC Version:"+QString::fromStdString(GCC_GXX_VERSION_STR)+"\n"); + strs.append("GXX 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_about_ui.h b/src/xsteam_about_ui.h index 7835edc..91f5968 100644 --- a/src/xsteam_about_ui.h +++ b/src/xsteam_about_ui.h @@ -9,6 +9,7 @@ #include #include #include +#include class xsteam_about_ui :public QDialog{ Q_OBJECT diff --git a/src/xsteam_base_ex.h b/src/xsteam_base_ex.h index 42851ff..0294cbb 100644 --- a/src/xsteam_base_ex.h +++ b/src/xsteam_base_ex.h @@ -9,7 +9,7 @@ QString ex_base_exe_ex; QString ex_save_path; QString ex_save_path_ex; -QStringList ex_src_table_head_tips = {QStringLiteral("Src Name"), QStringLiteral("Git Mode"), QStringLiteral("Url")}; +QStringList ex_src_table_head_tips = {QStringLiteral("源名称"), QStringLiteral("GIT模式"), QStringLiteral("地址")}; QStringList ex_uid_table_head_tips = {QStringLiteral("游戏ICO"),QStringLiteral("游戏UID"),QStringLiteral("游戏名"), QStringLiteral("更新时间"),QStringLiteral("入库时间"),QStringLiteral("源服务器")}; diff --git a/src/xsteam_set_ui.cpp b/src/xsteam_set_ui.cpp index 3659ffa..117cf58 100644 --- a/src/xsteam_set_ui.cpp +++ b/src/xsteam_set_ui.cpp @@ -10,10 +10,11 @@ xsteam_set_ui::~xsteam_set_ui() } void xsteam_set_ui::init_set() { - setWindowTitle(tr("XSteam Options")); + setWindowTitle(tr("XSteam设置")); main_layout = new QVBoxLayout; foot_layout = new QHBoxLayout; body_layout = new QVBoxLayout; + src_group=new QGroupBox(tr("设置参数")); steam_layout=new QHBoxLayout; steam_path_str=new QLabel(tr("Steam路径设置:")); @@ -32,7 +33,7 @@ void xsteam_set_ui::init_set() steamtools_layout->addWidget(steamtools_path_btn); steamtools_st_layout=new QHBoxLayout; - steamtools_st_path_str=new QLabel(tr("SteamTools .st路径设置:")); + steamtools_st_path_str=new QLabel(tr("SteamTools .st路径设置(不建议修改):")); steamtools_st_path_edit=new QLineEdit(); steamtools_st_path_btn=new QPushButton(tr("浏览")); steamtools_st_layout->addWidget(steamtools_st_path_str); @@ -41,15 +42,15 @@ void xsteam_set_ui::init_set() steam_api_layout=new QHBoxLayout; - steaminfo_api_path_str=new QLabel(tr("Steam Info Api Url:")); - steaminfo_api_path_edit=new QLineEdit(tr("不建议修改")); + steaminfo_api_path_str=new QLabel(tr("Steam Info Api Url(不建议修改):")); + steaminfo_api_path_edit=new QLineEdit(); steam_api_layout->addWidget(steaminfo_api_path_str); steam_api_layout->addWidget(steaminfo_api_path_edit); steam_head_api_layout=new QHBoxLayout; - steaminfo_head_path_str=new QLabel(tr("Steam Logo Api Url:")); - steaminfo_head_path_edit=new QLineEdit(tr("不建议修改")); + steaminfo_head_path_str=new QLabel(tr("Steam Logo Api Url(不建议修改):")); + steaminfo_head_path_edit=new QLineEdit(); steam_head_api_layout->addWidget(steaminfo_head_path_str); steam_head_api_layout->addWidget(steaminfo_head_path_edit); @@ -58,14 +59,15 @@ void xsteam_set_ui::init_set() body_layout->addLayout(steamtools_st_layout); body_layout->addLayout(steam_api_layout); body_layout->addLayout(steam_head_api_layout); - body_layout->addWidget(new QWidget()); + body_layout->addWidget(new QWidget()); + src_group->setLayout(body_layout); _pSaveData = new QPushButton(tr("保存")); foot_layout->addSpacerItem(sparcer_item); foot_layout->addWidget(_pSaveData); foot_layout->addSpacerItem(sparcer_item); - main_layout->addLayout(body_layout); + main_layout->addWidget(src_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 d4290c2..0218247 100644 --- a/src/xsteam_set_ui.h +++ b/src/xsteam_set_ui.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -43,6 +44,8 @@ private: QVBoxLayout* main_layout; QVBoxLayout* body_layout; QHBoxLayout* foot_layout; + + QGroupBox* src_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 7877a4c..bd2adc6 100644 --- a/src/xsteam_src_edit_ui.cpp +++ b/src/xsteam_src_edit_ui.cpp @@ -20,7 +20,6 @@ void xsteam_src_edit_ui::init_table_view_style() m_Table->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); m_Table->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); m_Table->setShowGrid(false); - m_Table->setAlternatingRowColors(true); m_Table->setFrameShape(QFrame::NoFrame); m_Table->horizontalHeader()->setStretchLastSection(true); m_Table->setColumnWidth(0, m_Table->width() / 5); @@ -71,7 +70,6 @@ void xsteam_src_edit_ui::load_src_data_view(std::vector src_data) { int x = i++; m_Model->setItem(x, 0, new QStandardItem(QString::fromStdString(k.src_name))); - QString g_mode_str; QComboBox *cmb = new QComboBox(); cmb->addItems(src_type); if (k.src_type == GIT_MODE::TAG) @@ -134,9 +132,18 @@ void xsteam_src_edit_ui::slots_on_task_event() } void xsteam_src_edit_ui::object_add_src() { - QAbstractItemModel *modessl = m_Table->model(); - modessl->insertRow(modessl->rowCount()); - m_Table->setModel(modessl); + /* + m_Model->insertRow(m_Model->rowCount()); + QComboBox *cmb = new QComboBox(); + cmb->addItems(src_type); + m_Table->setIndexWidget(m_Model->index(4, 1), cmb); + */ + int index = m_Model->rowCount(); + m_Model->setItem(index, 0, new QStandardItem(QString::fromStdString(""))); + QComboBox *cmb = new QComboBox(); + cmb->addItems(src_type); + m_Table->setIndexWidget(m_Model->index(index, 1), cmb); + m_Model->setItem(index, 2, new QStandardItem(QString::fromStdString(""))); } void xsteam_src_edit_ui::object_delete_src() { @@ -153,17 +160,24 @@ void xsteam_src_edit_ui::object_delete_src() QAbstractItemModel *modessl = m_Table->model(); QModelIndex indextemp = modessl->index(curRow, 0); QString _name = modessl->data(indextemp).value(); - for (auto it = _data.s_data.begin(); it != _data.s_data.end();) + if (_name == "") { - if (it->src_name == _name.toStdString()) + modessl->removeRow(curRow); + } + else + { + for (auto it = _data.s_data.begin(); it != _data.s_data.end();) { - _data.s_data.erase(it); - modessl->removeRow(curRow); - m_Table->setModel(modessl); - } - else - { - ++it; + if (it->src_name == _name.toStdString()) + { + _data.s_data.erase(it); + modessl->removeRow(curRow); + m_Table->setModel(modessl); + } + else + { + ++it; + } } } } @@ -179,10 +193,18 @@ void xsteam_src_edit_ui::slots_save_done() for (int i = 0; i <= curRow - 1; i++) { SrcData _src_data = {}; - QString dataTempA = modessl->data(modessl->index(i, 0)).value(); + QString src_name = modessl->data(modessl->index(i, 0)).value(); QComboBox *cmb = (QComboBox *)m_Table->indexWidget(modessl->index(i, 1)); - QString dataTempC = modessl->data(modessl->index(i, 2)).value(); - _src_data.src_name = dataTempA.toStdString(); + QString src_url = modessl->data(modessl->index(i, 2)).value(); + if(src_name==""){ + xsteam_msg_tip(nullptr,"第"+QString::number(curRow)+"行源名字不允许为空!"); + return; + } + if(src_url==""){ + xsteam_msg_tip(nullptr,"第"+QString::number(curRow)+"行源地址不允许为空!"); + return; + } + _src_data.src_name = src_name.toStdString(); if (cmb->currentIndex() == GIT_MODE::TAG) { _src_data.src_type = GIT_MODE::TAG; @@ -191,7 +213,7 @@ void xsteam_src_edit_ui::slots_save_done() { _src_data.src_type = GIT_MODE::BRANCH; } - _src_data.src_url = dataTempC.toStdString(); + _src_data.src_url = src_url.toStdString(); _data.s_data.push_back(_src_data); } } diff --git a/src/xsteam_src_edit_ui.h b/src/xsteam_src_edit_ui.h index 2fa0eb3..8cc3434 100644 --- a/src/xsteam_src_edit_ui.h +++ b/src/xsteam_src_edit_ui.h @@ -54,10 +54,10 @@ private: QVBoxLayout *main_Layout; QHBoxLayout *foot_Layout; QStandardItemModel *m_Model = {}; - QTableView *m_Table = {}; + QTableView *m_Table = {}; QPushButton *m_Save_Data = {}; QPushButton *m_Update_Src_Data = {}; - QStringList src_type={"BRANCH","TAG"}; + QStringList src_type={"BRANCH","TAG"}; QSpacerItem *sparcer_Item = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Fixed); private slots: void slots_rightMenu(const QPoint &pos); diff --git a/src/xsteam_ui.cpp b/src/xsteam_ui.cpp index 24fd917..e5a7b5d 100644 --- a/src/xsteam_ui.cpp +++ b/src/xsteam_ui.cpp @@ -419,9 +419,9 @@ void xsteam_ui::slots_server_combobox_load_data() server_txt->setCurrentIndex(0); } void xsteam_ui::table_load_ui_data() -{ +{ for (auto x : _data.u_data) - { + { ip_uid_table->item_append(x, VIEW_MODE::UID_INFO); } } @@ -456,7 +456,7 @@ void xsteam_ui::slots_open_setting() void xsteam_ui::slots_open_about() { xs_about_ui = xsteam_about_ui::Instance(); - xs_about_ui->setMaximumSize(660, 580); + xs_about_ui->setMaximumSize(440, 580); xs_about_ui->setGeometry(((QWidget *)this->parent())->geometry()); xs_about_ui->exec(); } diff --git a/src/xsteam_view.cpp b/src/xsteam_view.cpp index 0766d54..4a07edc 100644 --- a/src/xsteam_view.cpp +++ b/src/xsteam_view.cpp @@ -40,21 +40,21 @@ void xsteam_view::init_view(VIEW_MODE view_mode) void xsteam_view::item_append(UidData& data, VIEW_MODE mode) { - QList rows; + QList d_rows; std::vector dlc_uid; if (mode == VIEW_MODE::UID_INFO) { - rows.push_back(new QStandardItem(QString::fromStdString(data.ico))); - rows.push_back(new QStandardItem(QString::fromStdString(data.uid))); - rows.push_back(new QStandardItem(QString::fromStdString(data.name))); - rows.push_back(new QStandardItem(QString::fromStdString(data.m_time))); - rows.push_back(new QStandardItem(QString::fromStdString(data.i_time))); - rows.push_back(new QStandardItem(QString::fromStdString(data.s_name))); - for (auto row : rows) + d_rows.push_back(new QStandardItem(QString::fromStdString(data.ico))); + d_rows.push_back(new QStandardItem(QString::fromStdString(data.uid))); + d_rows.push_back(new QStandardItem(QString::fromStdString(data.name))); + d_rows.push_back(new QStandardItem(QString::fromStdString(data.m_time))); + d_rows.push_back(new QStandardItem(QString::fromStdString(data.i_time))); + d_rows.push_back(new QStandardItem(QString::fromStdString(data.s_name))); + for (auto d_row : d_rows) { - row->setTextAlignment(Qt::AlignCenter); + d_row->setTextAlignment(Qt::AlignCenter); } - m_model->appendRow(rows); + m_model->appendRow(d_rows); } else { @@ -69,9 +69,9 @@ void xsteam_view::item_append(UidData& data, VIEW_MODE mode) } for (auto x : dlc_uid) { - rows.clear(); - rows.push_back(new QStandardItem(QString::fromStdString(x))); - m_model->appendRow(rows); + d_rows.clear(); + d_rows.push_back(new QStandardItem(QString::fromStdString(x))); + m_model->appendRow(d_rows); } } } \ No newline at end of file diff --git a/src/xsteam_view.h b/src/xsteam_view.h index 58c0d94..b9f1f8d 100644 --- a/src/xsteam_view.h +++ b/src/xsteam_view.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "xsteam_view_item.h" #include "xsteam_base.h" diff --git a/version.h.in b/version.h.in index d6f9f6f..a731e81 100644 --- a/version.h.in +++ b/version.h.in @@ -7,4 +7,8 @@ #define PROJECT_MINOR_VERSION "@PROJECT_VERSION_MINOR@" #define PROJECT_PATCH_VERSION "@PROJECT_VERSION_PATCH@" +#define QT_VERSION_STR "@QT_VERSION_STR@" +#define GCC_GXX_VERSION_STR "@CMAKE_CXX_COMPILER_VERSION@" +#define LIBCURL_VERSION_STR "@CURL_VERSION@" +#define LIBGIT2_VERSION_STR "@LIBGIT2_VERSION@" #endif // VERSION_H