2025-07-19 02:58:46 +00:00
|
|
|
|
#pragma once
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
#include <QTableView>
|
|
|
|
|
#include <QStandardItemModel>
|
|
|
|
|
#include <QTreeView>
|
|
|
|
|
#include <QLineEdit>
|
|
|
|
|
#include <QStackedWidget>
|
|
|
|
|
#include <QSpinBox>
|
2025-08-11 14:11:20 +00:00
|
|
|
|
#include <QPushButton>
|
2025-07-19 02:58:46 +00:00
|
|
|
|
#include <QCheckBox>
|
2025-08-11 14:11:20 +00:00
|
|
|
|
#include <QTextBrowser>
|
2025-08-05 14:04:07 +00:00
|
|
|
|
#include "extract_basic.h"
|
2025-08-10 12:59:10 +00:00
|
|
|
|
#include "TranslateBasic.h"
|
2025-07-19 02:58:46 +00:00
|
|
|
|
|
2025-08-10 12:59:10 +00:00
|
|
|
|
namespace unit_configurations {
|
|
|
|
|
class SingleBasedConfiguration : public QWidget {
|
2025-08-11 14:11:20 +00:00
|
|
|
|
Q_OBJECT
|
|
|
|
|
private:
|
|
|
|
|
std::shared_ptr<TranslateBasic> _bind_core;
|
|
|
|
|
QSpinBox* const _offset_enter;
|
|
|
|
|
QComboBox* const _delegate_changed;
|
|
|
|
|
QPushButton* const _delegate_sync;
|
|
|
|
|
QTextBrowser* const _content_display;
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<extract::SingleBasedUnit> inst_current = nullptr;
|
|
|
|
|
QModelIndex idx_current;
|
|
|
|
|
|
2025-08-10 12:59:10 +00:00
|
|
|
|
public:
|
|
|
|
|
SingleBasedConfiguration(std::shared_ptr<TranslateBasic> core, QWidget* p = nullptr);
|
2025-08-11 14:11:20 +00:00
|
|
|
|
void currentAccept(std::shared_ptr<ExtractUnit> inst_u, const QModelIndex& idx);
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void reloadRequest();
|
2025-08-10 12:59:10 +00:00
|
|
|
|
};
|
2025-08-05 11:26:19 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <20>б<EFBFBD><D0B1>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
/// </summary>
|
2025-08-10 12:59:10 +00:00
|
|
|
|
class ListBasedConfiguration : public QWidget {
|
2025-08-05 11:26:19 +00:00
|
|
|
|
Q_OBJECT
|
|
|
|
|
private:
|
|
|
|
|
std::shared_ptr<TranslateBasic> _bind_core;
|
2025-08-11 14:51:28 +00:00
|
|
|
|
QSpinBox* const _offset_enter;
|
|
|
|
|
QPushButton* const _delegate_sync;
|
2025-08-05 11:26:19 +00:00
|
|
|
|
QComboBox* const _rule_select;
|
|
|
|
|
QComboBox* const _size_layout_select;
|
|
|
|
|
QStackedWidget* const _configs_stack;
|
2025-08-11 14:51:28 +00:00
|
|
|
|
QTextBrowser* const _content_display;
|
|
|
|
|
|
2025-08-05 11:26:19 +00:00
|
|
|
|
QSpinBox* const _const_number_input;
|
|
|
|
|
QComboBox* const _prev_field_refer;
|
|
|
|
|
|
2025-08-11 14:51:28 +00:00
|
|
|
|
std::shared_ptr<extract::ListBasedUnit> _bind_u = nullptr;
|
|
|
|
|
QModelIndex _bind_index;
|
|
|
|
|
|
2025-08-05 11:26:19 +00:00
|
|
|
|
public:
|
2025-08-10 12:59:10 +00:00
|
|
|
|
ListBasedConfiguration(std::shared_ptr<TranslateBasic> core, QWidget* p = nullptr);
|
2025-08-11 14:51:28 +00:00
|
|
|
|
void currentAccept(std::shared_ptr<ExtractUnit> inst_u, const QModelIndex& idx);
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void reloadRequest();
|
2025-08-10 12:59:10 +00:00
|
|
|
|
};
|
2025-08-05 11:26:19 +00:00
|
|
|
|
|
2025-08-10 12:59:10 +00:00
|
|
|
|
class UnionBasedConfiguration : public QWidget {
|
2025-08-11 14:51:28 +00:00
|
|
|
|
Q_OBJECT
|
2025-08-10 12:59:10 +00:00
|
|
|
|
public:
|
|
|
|
|
UnionBasedConfiguration(std::shared_ptr<TranslateBasic> core, QWidget* p = nullptr);
|
2025-08-11 14:51:28 +00:00
|
|
|
|
void currentAccept(std::shared_ptr<ExtractUnit> inst_u, const QModelIndex& idx);
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void reloadRequest();
|
2025-08-05 11:26:19 +00:00
|
|
|
|
};
|
|
|
|
|
}
|
2025-08-03 01:59:00 +00:00
|
|
|
|
|
2025-08-05 13:03:12 +00:00
|
|
|
|
class ExtractRuleView : public QWidget
|
2025-07-19 02:58:46 +00:00
|
|
|
|
{
|
|
|
|
|
private:
|
2025-08-11 14:11:20 +00:00
|
|
|
|
QTableView* const _member_units;
|
|
|
|
|
QStandardItemModel* const _member_model;
|
2025-07-19 02:58:46 +00:00
|
|
|
|
QStackedWidget* const _configs_stack;
|
|
|
|
|
|
2025-08-05 14:00:41 +00:00
|
|
|
|
std::shared_ptr<extract::AsRuleSet> _rule_base;
|
2025-08-11 14:11:20 +00:00
|
|
|
|
std::shared_ptr<TranslateBasic> _base_bind;
|
2025-08-04 01:27:04 +00:00
|
|
|
|
std::shared_ptr<FieldManagerLayer> _current_fields_cache = nullptr;
|
|
|
|
|
|
2025-07-19 02:58:46 +00:00
|
|
|
|
public:
|
2025-08-11 14:11:20 +00:00
|
|
|
|
ExtractRuleView(
|
|
|
|
|
std::shared_ptr<TranslateBasic> base,
|
|
|
|
|
std::shared_ptr<extract::AsRuleSet> inst_r,
|
|
|
|
|
QWidget* p = nullptr);
|
|
|
|
|
|
|
|
|
|
void reload();
|
|
|
|
|
void appendUnit();
|
|
|
|
|
|
|
|
|
|
protected:
|
2025-08-11 14:51:28 +00:00
|
|
|
|
void showEvent(QShowEvent* e) override;
|
2025-07-19 02:58:46 +00:00
|
|
|
|
};
|
|
|
|
|
|