1-更新日志功能
This commit is contained in:
parent
dfd46be74e
commit
4d9740fe7c
@ -21,8 +21,8 @@ int main(int argc, char *argv[])
|
||||
//仅限于windows平台
|
||||
#if defined(__WIN32__)
|
||||
x.title()->set_type(QD_TYPE::QD_EXIT);
|
||||
x.title()->set_font_style();
|
||||
#endif
|
||||
x.title()->set_font_style();
|
||||
x.show();
|
||||
return a.exec();
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ xsteam_update_ui::xsteam_update_ui()
|
||||
copyright_tips_txt=new QLabel(tr("Copyright © 2024 JackLee_CN. All rights reserved."));
|
||||
info = new QTextEdit();
|
||||
info->setReadOnly(true);
|
||||
info->toMarkdown(QTextDocument::MarkdownDialectGitHub);
|
||||
m_Layout->addWidget(info);
|
||||
f_Layout->addItem(sparcer_item);
|
||||
f_Layout->addWidget(copyright_tips_txt);
|
||||
@ -25,21 +26,13 @@ xsteam_update_ui::~xsteam_update_ui()
|
||||
}
|
||||
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);
|
||||
}
|
||||
QFuture<void> future = QtConcurrent::run([=]()
|
||||
{
|
||||
xsteam_curl* _curl=new xsteam_curl();
|
||||
auto log=_curl->get_steam_id_info("https://git.axibug.com/JackLee/XSteam/raw/branch/vcpkg/update.log",NULL);
|
||||
if(log.size()>0)
|
||||
{
|
||||
info->setText(QString::fromStdString(log));
|
||||
}
|
||||
});
|
||||
}
|
@ -9,6 +9,7 @@
|
||||
#include <QIODevice>
|
||||
#include <QLabel>
|
||||
#include <version.h>
|
||||
#include "xsteam_curl.h"
|
||||
#include "sui.h"
|
||||
class xsteam_update_ui :public sui{
|
||||
Q_OBJECT
|
||||
|
@ -13,22 +13,26 @@ void xsteam_view::item_clear()
|
||||
void xsteam_view::init_view(VIEW_MODE view_mode)
|
||||
{
|
||||
m_model = new QStandardItemModel();
|
||||
if (view_mode == VIEW_MODE::UID_INFO)
|
||||
auto view = [=](VIEW_MODE view_mode)
|
||||
{
|
||||
m_model->setColumnCount(ex_uid_table_head_tips.count());
|
||||
m_model->setHorizontalHeaderLabels(ex_uid_table_head_tips);
|
||||
setItemDelegate(new xsteam_view_item());
|
||||
}
|
||||
else if (view_mode == VIEW_MODE::ALL_DLC_INFO)
|
||||
{
|
||||
m_model->setColumnCount(ex_all_dlc_table_head_tips.count());
|
||||
m_model->setHorizontalHeaderLabels(ex_all_dlc_table_head_tips);
|
||||
}
|
||||
else if (view_mode == VIEW_MODE::IN_DLC_INFO)
|
||||
{
|
||||
m_model->setColumnCount(ex_in_dlc_table_head_tips.count());
|
||||
m_model->setHorizontalHeaderLabels(ex_in_dlc_table_head_tips);
|
||||
}
|
||||
if (view_mode == VIEW_MODE::UID_INFO)
|
||||
{
|
||||
m_model->setColumnCount(ex_uid_table_head_tips.count());
|
||||
m_model->setHorizontalHeaderLabels(ex_uid_table_head_tips);
|
||||
setItemDelegate(new xsteam_view_item());
|
||||
}
|
||||
else if (view_mode == VIEW_MODE::ALL_DLC_INFO)
|
||||
{
|
||||
m_model->setColumnCount(ex_all_dlc_table_head_tips.count());
|
||||
m_model->setHorizontalHeaderLabels(ex_all_dlc_table_head_tips);
|
||||
}
|
||||
else if (view_mode == VIEW_MODE::IN_DLC_INFO)
|
||||
{
|
||||
m_model->setColumnCount(ex_in_dlc_table_head_tips.count());
|
||||
m_model->setHorizontalHeaderLabels(ex_in_dlc_table_head_tips);
|
||||
}
|
||||
};
|
||||
view(view_mode);
|
||||
setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
@ -39,7 +43,7 @@ void xsteam_view::init_view(VIEW_MODE view_mode)
|
||||
setModel(m_model);
|
||||
}
|
||||
|
||||
void xsteam_view::item_append(UidData& data, VIEW_MODE mode)
|
||||
void xsteam_view::item_append(UidData &data, VIEW_MODE mode)
|
||||
{
|
||||
QList<QStandardItem *> d_rows;
|
||||
std::vector<std::string> dlc_uid;
|
||||
|
Loading…
Reference in New Issue
Block a user