增加变量环境版本

This commit is contained in:
JackLee_CN 2024-10-17 18:53:10 +08:00
parent f8cd167769
commit 017edb3018
14 changed files with 113 additions and 60 deletions

View File

@ -109,7 +109,8 @@
"qgroupbox": "cpp", "qgroupbox": "cpp",
"qheaderview": "cpp", "qheaderview": "cpp",
"qabstractlistmodel": "cpp", "qabstractlistmodel": "cpp",
"qtconcurrentrun": "cpp" "qtconcurrentrun": "cpp",
"*.in": "cpp"
}, },
"Codegeex.RepoIndex": true "Codegeex.RepoIndex": true
} }

View File

@ -109,12 +109,12 @@ SET(PROJECT_SOURCES
${src} ${src}
) )
# qFatalqDebug # qFatalqDebug
#LIST(APPEND CMAKE_CXX_FLAGS "-DQT_NO_DEBUG_OUTPUT") LIST(APPEND CMAKE_CXX_FLAGS "-DQT_NO_DEBUG_OUTPUT")
# #
QT6_ADD_RESOURCES(RCFILES res.qrc) QT6_ADD_RESOURCES(RCFILES res.qrc)
#WIN32 #WIN32
add_executable(${PROJECT_NAME} ${PROJECT_SOURCES} ${RCFILES} xsteam.rc) add_executable(${PROJECT_NAME} WIN32 ${PROJECT_SOURCES} ${RCFILES} xsteam.rc)
# #
#RPATH #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) 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) SET(CMAKE_EXE_LINKER_FLAGS -static)

View File

@ -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)

View File

@ -32,6 +32,11 @@ void xsteam_about_ui::load_about()
QByteArray line = file.readLine(); QByteArray line = file.readLine();
strs.append(QString::fromStdString(line.data())); 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); info->setPlainText(strs);
} }
} }

View File

@ -9,6 +9,7 @@
#include <QFile> #include <QFile>
#include <QIODevice> #include <QIODevice>
#include <QLabel> #include <QLabel>
#include <version.h>
class xsteam_about_ui :public QDialog{ class xsteam_about_ui :public QDialog{
Q_OBJECT Q_OBJECT

View File

@ -9,7 +9,7 @@ QString ex_base_exe_ex;
QString ex_save_path; QString ex_save_path;
QString ex_save_path_ex; 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("游戏名"), QStringList ex_uid_table_head_tips = {QStringLiteral("游戏ICO"),QStringLiteral("游戏UID"),QStringLiteral("游戏名"),
QStringLiteral("更新时间"),QStringLiteral("入库时间"),QStringLiteral("源服务器")}; QStringLiteral("更新时间"),QStringLiteral("入库时间"),QStringLiteral("源服务器")};

View File

@ -10,10 +10,11 @@ xsteam_set_ui::~xsteam_set_ui()
} }
void xsteam_set_ui::init_set() void xsteam_set_ui::init_set()
{ {
setWindowTitle(tr("XSteam Options")); setWindowTitle(tr("XSteam设置"));
main_layout = new QVBoxLayout; main_layout = new QVBoxLayout;
foot_layout = new QHBoxLayout; foot_layout = new QHBoxLayout;
body_layout = new QVBoxLayout; body_layout = new QVBoxLayout;
src_group=new QGroupBox(tr("设置参数"));
steam_layout=new QHBoxLayout; steam_layout=new QHBoxLayout;
steam_path_str=new QLabel(tr("Steam路径设置:")); steam_path_str=new QLabel(tr("Steam路径设置:"));
@ -32,7 +33,7 @@ void xsteam_set_ui::init_set()
steamtools_layout->addWidget(steamtools_path_btn); steamtools_layout->addWidget(steamtools_path_btn);
steamtools_st_layout=new QHBoxLayout; 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_edit=new QLineEdit();
steamtools_st_path_btn=new QPushButton(tr("浏览")); steamtools_st_path_btn=new QPushButton(tr("浏览"));
steamtools_st_layout->addWidget(steamtools_st_path_str); steamtools_st_layout->addWidget(steamtools_st_path_str);
@ -41,15 +42,15 @@ void xsteam_set_ui::init_set()
steam_api_layout=new QHBoxLayout; steam_api_layout=new QHBoxLayout;
steaminfo_api_path_str=new QLabel(tr("Steam Info Api Url:")); steaminfo_api_path_str=new QLabel(tr("Steam Info Api Url(不建议修改):"));
steaminfo_api_path_edit=new QLineEdit(tr("不建议修改")); steaminfo_api_path_edit=new QLineEdit();
steam_api_layout->addWidget(steaminfo_api_path_str); steam_api_layout->addWidget(steaminfo_api_path_str);
steam_api_layout->addWidget(steaminfo_api_path_edit); steam_api_layout->addWidget(steaminfo_api_path_edit);
steam_head_api_layout=new QHBoxLayout; steam_head_api_layout=new QHBoxLayout;
steaminfo_head_path_str=new QLabel(tr("Steam Logo Api Url:")); steaminfo_head_path_str=new QLabel(tr("Steam Logo Api Url(不建议修改):"));
steaminfo_head_path_edit=new QLineEdit(tr("不建议修改")); steaminfo_head_path_edit=new QLineEdit();
steam_head_api_layout->addWidget(steaminfo_head_path_str); steam_head_api_layout->addWidget(steaminfo_head_path_str);
steam_head_api_layout->addWidget(steaminfo_head_path_edit); 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(steamtools_st_layout);
body_layout->addLayout(steam_api_layout); body_layout->addLayout(steam_api_layout);
body_layout->addLayout(steam_head_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("保存")); _pSaveData = new QPushButton(tr("保存"));
foot_layout->addSpacerItem(sparcer_item); foot_layout->addSpacerItem(sparcer_item);
foot_layout->addWidget(_pSaveData); foot_layout->addWidget(_pSaveData);
foot_layout->addSpacerItem(sparcer_item); foot_layout->addSpacerItem(sparcer_item);
main_layout->addLayout(body_layout); main_layout->addWidget(src_group);
main_layout->addLayout(foot_layout); main_layout->addLayout(foot_layout);
main_layout->setStretch(0, 8); main_layout->setStretch(0, 8);
main_layout->setStretch(1, 2); main_layout->setStretch(1, 2);

View File

@ -9,6 +9,7 @@
#include <QTableView> #include <QTableView>
#include <QTableWidgetItem> #include <QTableWidgetItem>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QGroupBox>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QPushButton> #include <QPushButton>
#include <QLabel> #include <QLabel>
@ -43,6 +44,8 @@ private:
QVBoxLayout* main_layout; QVBoxLayout* main_layout;
QVBoxLayout* body_layout; QVBoxLayout* body_layout;
QHBoxLayout* foot_layout; QHBoxLayout* foot_layout;
QGroupBox* src_group;
QPushButton* _pSaveData={}; QPushButton* _pSaveData={};
QSpacerItem * sparcer_item = new QSpacerItem(0,0,QSizePolicy::Expanding,QSizePolicy::Fixed); QSpacerItem * sparcer_item = new QSpacerItem(0,0,QSizePolicy::Expanding,QSizePolicy::Fixed);

View File

@ -20,7 +20,6 @@ void xsteam_src_edit_ui::init_table_view_style()
m_Table->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); m_Table->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
m_Table->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); m_Table->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
m_Table->setShowGrid(false); m_Table->setShowGrid(false);
m_Table->setAlternatingRowColors(true);
m_Table->setFrameShape(QFrame::NoFrame); m_Table->setFrameShape(QFrame::NoFrame);
m_Table->horizontalHeader()->setStretchLastSection(true); m_Table->horizontalHeader()->setStretchLastSection(true);
m_Table->setColumnWidth(0, m_Table->width() / 5); m_Table->setColumnWidth(0, m_Table->width() / 5);
@ -71,7 +70,6 @@ void xsteam_src_edit_ui::load_src_data_view(std::vector<SrcData> src_data)
{ {
int x = i++; int x = i++;
m_Model->setItem(x, 0, new QStandardItem(QString::fromStdString(k.src_name))); m_Model->setItem(x, 0, new QStandardItem(QString::fromStdString(k.src_name)));
QString g_mode_str;
QComboBox *cmb = new QComboBox(); QComboBox *cmb = new QComboBox();
cmb->addItems(src_type); cmb->addItems(src_type);
if (k.src_type == GIT_MODE::TAG) 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() void xsteam_src_edit_ui::object_add_src()
{ {
QAbstractItemModel *modessl = m_Table->model(); /*
modessl->insertRow(modessl->rowCount()); m_Model->insertRow(m_Model->rowCount());
m_Table->setModel(modessl); 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() 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(); QAbstractItemModel *modessl = m_Table->model();
QModelIndex indextemp = modessl->index(curRow, 0); QModelIndex indextemp = modessl->index(curRow, 0);
QString _name = modessl->data(indextemp).value<QString>(); QString _name = modessl->data(indextemp).value<QString>();
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); if (it->src_name == _name.toStdString())
modessl->removeRow(curRow); {
m_Table->setModel(modessl); _data.s_data.erase(it);
} modessl->removeRow(curRow);
else m_Table->setModel(modessl);
{ }
++it; else
{
++it;
}
} }
} }
} }
@ -179,10 +193,18 @@ void xsteam_src_edit_ui::slots_save_done()
for (int i = 0; i <= curRow - 1; i++) for (int i = 0; i <= curRow - 1; i++)
{ {
SrcData _src_data = {}; SrcData _src_data = {};
QString dataTempA = modessl->data(modessl->index(i, 0)).value<QString>(); QString src_name = modessl->data(modessl->index(i, 0)).value<QString>();
QComboBox *cmb = (QComboBox *)m_Table->indexWidget(modessl->index(i, 1)); QComboBox *cmb = (QComboBox *)m_Table->indexWidget(modessl->index(i, 1));
QString dataTempC = modessl->data(modessl->index(i, 2)).value<QString>(); QString src_url = modessl->data(modessl->index(i, 2)).value<QString>();
_src_data.src_name = dataTempA.toStdString(); 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) if (cmb->currentIndex() == GIT_MODE::TAG)
{ {
_src_data.src_type = 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_type = GIT_MODE::BRANCH;
} }
_src_data.src_url = dataTempC.toStdString(); _src_data.src_url = src_url.toStdString();
_data.s_data.push_back(_src_data); _data.s_data.push_back(_src_data);
} }
} }

View File

@ -54,10 +54,10 @@ private:
QVBoxLayout *main_Layout; QVBoxLayout *main_Layout;
QHBoxLayout *foot_Layout; QHBoxLayout *foot_Layout;
QStandardItemModel *m_Model = {}; QStandardItemModel *m_Model = {};
QTableView *m_Table = {}; QTableView *m_Table = {};
QPushButton *m_Save_Data = {}; QPushButton *m_Save_Data = {};
QPushButton *m_Update_Src_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); QSpacerItem *sparcer_Item = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Fixed);
private slots: private slots:
void slots_rightMenu(const QPoint &pos); void slots_rightMenu(const QPoint &pos);

View File

@ -419,9 +419,9 @@ void xsteam_ui::slots_server_combobox_load_data()
server_txt->setCurrentIndex(0); server_txt->setCurrentIndex(0);
} }
void xsteam_ui::table_load_ui_data() void xsteam_ui::table_load_ui_data()
{ {
for (auto x : _data.u_data) for (auto x : _data.u_data)
{ {
ip_uid_table->item_append(x, VIEW_MODE::UID_INFO); 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() void xsteam_ui::slots_open_about()
{ {
xs_about_ui = xsteam_about_ui::Instance(); 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->setGeometry(((QWidget *)this->parent())->geometry());
xs_about_ui->exec(); xs_about_ui->exec();
} }

View File

@ -40,21 +40,21 @@ void xsteam_view::init_view(VIEW_MODE view_mode)
void xsteam_view::item_append(UidData& data, VIEW_MODE mode) void xsteam_view::item_append(UidData& data, VIEW_MODE mode)
{ {
QList<QStandardItem *> rows; QList<QStandardItem *> d_rows;
std::vector<std::string> dlc_uid; std::vector<std::string> dlc_uid;
if (mode == VIEW_MODE::UID_INFO) if (mode == VIEW_MODE::UID_INFO)
{ {
rows.push_back(new QStandardItem(QString::fromStdString(data.ico))); d_rows.push_back(new QStandardItem(QString::fromStdString(data.ico)));
rows.push_back(new QStandardItem(QString::fromStdString(data.uid))); d_rows.push_back(new QStandardItem(QString::fromStdString(data.uid)));
rows.push_back(new QStandardItem(QString::fromStdString(data.name))); d_rows.push_back(new QStandardItem(QString::fromStdString(data.name)));
rows.push_back(new QStandardItem(QString::fromStdString(data.m_time))); d_rows.push_back(new QStandardItem(QString::fromStdString(data.m_time)));
rows.push_back(new QStandardItem(QString::fromStdString(data.i_time))); d_rows.push_back(new QStandardItem(QString::fromStdString(data.i_time)));
rows.push_back(new QStandardItem(QString::fromStdString(data.s_name))); d_rows.push_back(new QStandardItem(QString::fromStdString(data.s_name)));
for (auto row : rows) 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 else
{ {
@ -69,9 +69,9 @@ void xsteam_view::item_append(UidData& data, VIEW_MODE mode)
} }
for (auto x : dlc_uid) for (auto x : dlc_uid)
{ {
rows.clear(); d_rows.clear();
rows.push_back(new QStandardItem(QString::fromStdString(x))); d_rows.push_back(new QStandardItem(QString::fromStdString(x)));
m_model->appendRow(rows); m_model->appendRow(d_rows);
} }
} }
} }

View File

@ -7,6 +7,7 @@
#include <QFile> #include <QFile>
#include <QDir> #include <QDir>
#include <QLabel> #include <QLabel>
#include <QComboBox>
#include <QStandardItemModel> #include <QStandardItemModel>
#include "xsteam_view_item.h" #include "xsteam_view_item.h"
#include "xsteam_base.h" #include "xsteam_base.h"

View File

@ -7,4 +7,8 @@
#define PROJECT_MINOR_VERSION "@PROJECT_VERSION_MINOR@" #define PROJECT_MINOR_VERSION "@PROJECT_VERSION_MINOR@"
#define PROJECT_PATCH_VERSION "@PROJECT_VERSION_PATCH@" #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 #endif // VERSION_H