修改新的逻辑

This commit is contained in:
JackLee_CN 2024-10-13 23:58:22 +08:00
parent edf94105a0
commit 05f8f8a9d3
2 changed files with 28 additions and 29 deletions

View File

@ -60,6 +60,8 @@ void xsteam_ui::xsteam_init_mind_layout()
btn_run_steamtools->setObjectName("RUN_STEAMTOOLS");
btn_run_steam = new QPushButton(tr("Steam"));
btn_run_steam->setObjectName("RUN_STEAM");
btn_run_steamdb = new QPushButton(tr("SteamDB"));
btn_run_steamdb->setObjectName("STEAM_DB");
server_layout->addWidget(server_tag);
server_layout->addWidget(server_txt);
@ -67,6 +69,7 @@ void xsteam_ui::xsteam_init_mind_layout()
server_layout->addWidget(btn_server_edit);
server_layout->addWidget(btn_run_steam);
server_layout->addWidget(btn_run_steamtools);
server_layout->addWidget(btn_run_steamdb);
server_layout->setStretch(0, 1);
server_layout->setStretch(1, 7);
server_layout->setStretch(2, 1);
@ -79,21 +82,22 @@ void xsteam_ui::xsteam_init_mind_layout()
ip_uid_edit = new QLineEdit("457140");
ip_uid_edit->setValidator(new QRegularExpressionValidator(QRegularExpression("[0-9]+$")));
ip_uid_edit->setMaxLength(8);
ip_layout->addWidget(ip_uid_tag);
ip_layout->addWidget(ip_uid_edit);
ip_layout->setContentsMargins(2, 2, 2, 2);
btn_dlc_push = new QPushButton(tr("增加DLC"));
btn_dlc_push = new QPushButton(tr("获取DLC"));
btn_dlc_push->setObjectName("SET_DLC");
ip_iu_layout = new QHBoxLayout();
btn_uid_push = new QPushButton(tr("入库"));
btn_uid_push->setObjectName("INPUT");
btn_run_steamdb = new QPushButton(tr("SteamDB"));
btn_run_steamdb->setObjectName("STEAM_DB");
ip_layout->addWidget(ip_uid_tag);
ip_layout->addWidget(ip_uid_edit);
ip_layout->addWidget(btn_dlc_push);
ip_layout->addWidget(btn_uid_push);
ip_layout->addWidget(btn_run_steamdb);
btn_uid_update=new QPushButton(tr("更新"));
btn_uid_update->setObjectName("UPDATE");
ip_iu_layout->addWidget(btn_uid_push);
ip_iu_layout->addWidget(btn_uid_update);
ip_iu_layout->setContentsMargins(2, 2, 2, 2);
ip_data_layout = new QHBoxLayout();
// uid info
@ -110,23 +114,27 @@ void xsteam_ui::xsteam_init_mind_layout()
ip_dlc_info_layout = new QVBoxLayout();
ip_all_dlc_group = new QGroupBox(tr("DLC信息"));
ip_all_dlc_group->setObjectName("ALL_DLC_GROUP");
ip_all_dlc_group->setVisible(false);
ip_all_dlc_table = new xsteam_view();
ip_all_dlc_table->init_view(VIEW_MODE::ALL_DLC_INFO);
ip_in_dlc_table = new xsteam_view();
ip_in_dlc_table->init_view(VIEW_MODE::IN_DLC_INFO);
ip_dlc_info_layout->addLayout(ip_layout);
ip_dlc_info_layout->addWidget(btn_dlc_push);
ip_dlc_info_layout->addWidget(ip_in_dlc_table);
ip_dlc_info_layout->addWidget(ip_all_dlc_table);
ip_dlc_info_layout->addLayout(ip_iu_layout);
ip_dlc_info_layout->setContentsMargins(2, 2, 2, 2);
ip_all_dlc_group->setLayout(ip_dlc_info_layout);
ip_data_layout->addWidget(ip_uid_group);
ip_data_layout->addWidget(ip_all_dlc_group);
ip_data_layout->setStretch(0, 8);
ip_data_layout->setStretch(1, 2);
ip_data_layout->setStretch(0, 7);
ip_data_layout->setStretch(1, 3);
mind_layout->addLayout(server_layout);
mind_layout->addLayout(ip_layout);
mind_layout->addLayout(ip_data_layout);
}
void xsteam_ui::xsteam_init_foot_layout()
@ -254,10 +262,6 @@ void xsteam_ui::slots_selection_row(const QItemSelection &current, const QItemSe
QModelIndexList indexes = current.indexes();
if (!indexes.isEmpty())
{
if (!ip_all_dlc_group->isVisible())
{
ip_all_dlc_group->setVisible(true);
}
QModelIndex index = indexes.first();
QAbstractItemModel *model = ip_uid_table->model();
std::string uid = (model->data(model->index(index.row(), 1)).value<QString>()).toStdString();
@ -273,13 +277,6 @@ void xsteam_ui::slots_selection_row(const QItemSelection &current, const QItemSe
ip_all_dlc_table->item_append(u_data, VIEW_MODE::ALL_DLC_INFO);
ip_in_dlc_table->item_append(u_data, VIEW_MODE::IN_DLC_INFO);
}
else
{
if (ip_all_dlc_group->isVisible())
{
ip_all_dlc_group->setVisible(false);
}
}
}
void xsteam_ui::slots_open_steamdb()

View File

@ -48,9 +48,11 @@ private:
QPushButton* btn_run_steamtools;
//入库游戏信息
QHBoxLayout* ip_layout;
QHBoxLayout* ip_iu_layout;
QLabel* ip_uid_tag;
QLineEdit* ip_uid_edit;
QPushButton* btn_uid_push;
QPushButton* btn_uid_update;
QPushButton* btn_dlc_push;
QPushButton* btn_run_steamdb;