74 lines
2.2 KiB
C++
74 lines
2.2 KiB
C++
#ifndef XSTEAM_SRC_EDIT_UI_H
|
|
#define XSTEAM_SRC_EDIT_UI_H
|
|
|
|
#include <QMutex>
|
|
#include <QGroupBox>
|
|
#include <QTableView>
|
|
#include <QComboBox>
|
|
#include <QStringList>
|
|
#include <QVBoxLayout>
|
|
#include <QHBoxLayout>
|
|
#include <QPushButton>
|
|
#include <QHeaderView>
|
|
#include <QMutexLocker>
|
|
#include <QStandardItem>
|
|
#include <QTableWidgetItem>
|
|
#include <QStandardItemModel>
|
|
#include <QtConcurrent/QtConcurrentRun>
|
|
#include "xsteam_git.h"
|
|
#include "sui.h"
|
|
|
|
class xsteam_src_edit_ui : public sui
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
static xsteam_src_edit_ui *Instance()
|
|
{
|
|
if (!_instance)
|
|
{
|
|
static QMutex mutex;
|
|
mutex.lock();
|
|
if (!_instance)
|
|
{
|
|
_instance = new xsteam_src_edit_ui();
|
|
_instance->title()->set_type(QD_CLOSE);
|
|
_instance->title()->set_title(tr("XSteam源地址管理"));
|
|
_instance->setWindowTitle(tr("XSteam源地址管理"));
|
|
}
|
|
mutex.unlock();
|
|
}
|
|
return _instance;
|
|
}
|
|
private:
|
|
xsteam_src_edit_ui();
|
|
~xsteam_src_edit_ui();
|
|
xsteam_src_edit_ui(const xsteam_src_edit_ui &other);
|
|
const xsteam_src_edit_ui &operator=(const xsteam_src_edit_ui &other);
|
|
static xsteam_src_edit_ui* _instance;
|
|
static QMutex mutex;
|
|
void init_src_edit_ui();
|
|
void load_src_data_view(std::vector<SrcData> src_data);
|
|
void init_table_view_style();
|
|
void object_add_src();
|
|
void object_delete_src();
|
|
void connect_slots();
|
|
QGroupBox* src_group;
|
|
QVBoxLayout *gr_Layout;
|
|
QHBoxLayout *foot_Layout;
|
|
QStandardItemModel *m_Model = {};
|
|
QTableView *m_Table = {};
|
|
QPushButton *m_Save_Data = {};
|
|
QPushButton *m_Update_Src_Data = {};
|
|
QStringList src_type={"BRANCH","TAG"};
|
|
QSpacerItem *sparcer_Item = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Fixed);
|
|
private slots:
|
|
void slots_rightMenu(const QPoint &pos);
|
|
void slots_on_task_event();
|
|
void slots_save_done();
|
|
void slots_update_src_data();
|
|
signals:
|
|
void signals_update();
|
|
};
|
|
xsteam_src_edit_ui *xsteam_src_edit_ui::_instance = {};
|
|
QMutex xsteam_src_edit_ui::mutex;
|
|
#endif |