540 lines
15 KiB
C++
540 lines
15 KiB
C++
#include "Setting.h"
|
|||
|
|
#include "Global.h"
|
||
|
|
#include "Utils.h"
|
||
|
|
#include "CrownClient.h"
|
||
|
|
Setting::Setting(QWidget *parent)
|
||
|
|
: QWidget(parent)
|
||
|
|
{
|
||
|
|
ui.setupUi(this);
|
||
|
|
// 设置窗口图标
|
||
|
|
this->setWindowIcon(QIcon(":/images/Images/client.ico"));
|
||
|
|
// 设置窗口标题
|
||
|
|
this->setWindowTitle("跟单设置");
|
||
|
|
// 设置为对话框窗口
|
||
|
|
setWindowFlags(Qt::Dialog);
|
||
|
|
// 设置窗口仅有关闭按钮
|
||
|
|
setWindowFlags(Qt::WindowCloseButtonHint);
|
||
|
|
setFixedSize(1188, 711);
|
||
|
|
|
||
|
|
// 跟单项目窗口
|
||
|
|
window_followProject = new FollowProject();
|
||
|
|
connect(ui.followProjectButton, &QPushButton::clicked, window_followProject, &QWidget::show);
|
||
|
|
|
||
|
|
// 注单盘口窗口
|
||
|
|
window_handicap = new Handicap();
|
||
|
|
connect(ui.handicapButton, &QPushButton::clicked, window_handicap, &QWidget::show);
|
||
|
|
|
||
|
|
// 注单赔率窗口
|
||
|
|
window_odds = new Odds();
|
||
|
|
connect(ui.oddsButton, &QPushButton::clicked, window_odds, &QWidget::show);
|
||
|
|
|
||
|
|
// 注单金额窗口
|
||
|
|
window_amount = new Amount();
|
||
|
|
connect(ui.amountButton, &QPushButton::clicked, window_amount, &QWidget::show);
|
||
|
|
|
||
|
|
// 赛事盘口窗口
|
||
|
|
window_screen = new Screen();
|
||
|
|
connect(ui.screenButton, &QPushButton::clicked, window_screen, &QWidget::show);
|
||
|
|
connect(this, &Setting::signalUpdateLeagueAndTeam, window_screen, &Screen::slotUpdateLeagueAndTeam);
|
||
|
|
|
||
|
|
// 赛事盘口窗口
|
||
|
|
window_project = new Project();
|
||
|
|
connect(ui.projectButton, &QPushButton::clicked, window_project, &QWidget::show);
|
||
|
|
|
||
|
|
// 补单筛选窗口
|
||
|
|
window_rebet = new Rebet();
|
||
|
|
connect(ui.rebetButton, &QPushButton::clicked, window_rebet, &QWidget::show);
|
||
|
|
|
||
|
|
window_sleep = new class Sleep();
|
||
|
|
connect(ui.sleepButton, &QPushButton::clicked, window_sleep, &QWidget::show);
|
||
|
|
// 跟单声音窗口
|
||
|
|
window_sound = new Sound();
|
||
|
|
connect(ui.soundButton, &QPushButton::clicked, window_sound, &QWidget::show);
|
||
|
|
|
||
|
|
|
||
|
|
// 初始化表格
|
||
|
|
ui.tableWidget->setColumnCount(8);
|
||
|
|
ui.tableWidget->setHorizontalHeaderLabels({ "启用","注单账号","账号类型","跟单方式","跟单盘口","计算方式","缩放比率","固定金额" });
|
||
|
|
|
||
|
|
ui.tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||
|
|
ui.tableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||
|
|
ui.tableWidget->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
|
||
|
|
ui.tableWidget->horizontalHeader()->resizeSection(0, 50);
|
||
|
|
|
||
|
|
connect(ui.tableWidget, &QTableWidget::cellClicked, this, &Setting::slotCellClicked);
|
||
|
|
|
||
|
|
// 读取配置
|
||
|
|
QList<QString> followType = g_config->followType();
|
||
|
|
if (followType.contains("normal"))
|
||
|
|
{
|
||
|
|
ui.followNormalCheckBox->setChecked(true);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
ui.followNormalCheckBox->setChecked(false);
|
||
|
|
}
|
||
|
|
|
||
|
|
if (followType.contains("addTime"))
|
||
|
|
{
|
||
|
|
ui.followAddTimeCheckBox->setChecked(true);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
ui.followAddTimeCheckBox->setChecked(false);
|
||
|
|
}
|
||
|
|
|
||
|
|
if (followType.contains("corner"))
|
||
|
|
{
|
||
|
|
ui.cornerCheckBox->setChecked(true);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
ui.cornerCheckBox->setChecked(false);
|
||
|
|
}
|
||
|
|
|
||
|
|
if (followType.contains("free"))
|
||
|
|
{
|
||
|
|
ui.freeCheckBox->setChecked(true);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
ui.freeCheckBox->setChecked(false);
|
||
|
|
}
|
||
|
|
|
||
|
|
if (followType.contains("promotion"))
|
||
|
|
{
|
||
|
|
ui.promotionCheckBox->setChecked(true);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
ui.promotionCheckBox->setChecked(false);
|
||
|
|
}
|
||
|
|
|
||
|
|
if (followType.contains("champion"))
|
||
|
|
{
|
||
|
|
ui.championCheckBox->setChecked(true);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
ui.championCheckBox->setChecked(false);
|
||
|
|
}
|
||
|
|
|
||
|
|
if (followType.contains("point"))
|
||
|
|
{
|
||
|
|
ui.pointCheckBox->setChecked(true);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
ui.pointCheckBox->setChecked(false);
|
||
|
|
}
|
||
|
|
ui.lackHandicapCombo->setCurrentIndex(g_config->lackType());
|
||
|
|
ui.followDeviceCombo->setCurrentIndex(g_config->followDeviceType());
|
||
|
|
ui.rebetMaxEdit->setText(QString::number(g_config->rebetMaxTimes()));
|
||
|
|
ui.rebetSleepTimesEdit->setText(QString::number(g_config->rebetSleepTimes()));
|
||
|
|
ui.rebetSleepEdit->setText(QString::number(g_config->rebetSleep()));
|
||
|
|
ui.sessionAutoChangeCheckBox->setChecked(g_config->sessionAutoChangeEnable());
|
||
|
|
ui.ignoreScoreChangedCheckBox->setChecked(g_config->ignoreScoreChangedEnable());
|
||
|
|
ui.followFixedScoreCheckBox->setChecked(g_config->followFixedScoreEnable());
|
||
|
|
ui.fixedScoreMasterEdit->setText(QString::number(g_config->fixedScoreMaster()));
|
||
|
|
ui.fixedScoreVisitorEdit->setText(QString::number(g_config->fixedScoreVisitor()));
|
||
|
|
|
||
|
|
// 用户/代理独立规则设置
|
||
|
|
for (int i = 0; i < 10; i++)
|
||
|
|
{
|
||
|
|
int index = ui.tableWidget->rowCount();
|
||
|
|
ui.tableWidget->insertRow(index);
|
||
|
|
|
||
|
|
QWidget* widget_enable = new QWidget;
|
||
|
|
QHBoxLayout* layout_enale = new QHBoxLayout;
|
||
|
|
QCheckBox* chekcBox = new QCheckBox;
|
||
|
|
layout_enale->addWidget(chekcBox);
|
||
|
|
layout_enale->setContentsMargins(0, 0, 0, 0);
|
||
|
|
layout_enale->setAlignment(chekcBox, Qt::AlignCenter);
|
||
|
|
widget_enable->setLayout(layout_enale);
|
||
|
|
ui.tableWidget->setCellWidget(index, 0, widget_enable);
|
||
|
|
|
||
|
|
|
||
|
|
QComboBox* userNameCombo = new QComboBox;
|
||
|
|
if (i == 0)
|
||
|
|
{
|
||
|
|
userNameCombo->addItem("其他会员");
|
||
|
|
userNameCombo->setDisabled(true);
|
||
|
|
}
|
||
|
|
|
||
|
|
ui.tableWidget->setCellWidget(index, 1, userNameCombo);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
QComboBox* userTypeCombo = new QComboBox;
|
||
|
|
userTypeCombo->addItem("会员");
|
||
|
|
userTypeCombo->addItem("代理");
|
||
|
|
if (i == 0)
|
||
|
|
{
|
||
|
|
userTypeCombo->setDisabled(true);
|
||
|
|
}
|
||
|
|
ui.tableWidget->setCellWidget(index, 2, userTypeCombo);
|
||
|
|
|
||
|
|
connect(userTypeCombo, static_cast<void(QComboBox::*)(const QString&)>(&QComboBox::activated), this,&Setting::slotAlertUsersCombo);
|
||
|
|
|
||
|
|
// 跟单方式
|
||
|
|
QTableWidgetItem* follow = new QTableWidgetItem("正跟");
|
||
|
|
ui.tableWidget->setItem(index, 3, follow);
|
||
|
|
FollowType* followType = new FollowType();
|
||
|
|
m_followTypeList.append(followType);
|
||
|
|
connect(followType, &FollowType::signalUpdateStatus, this, &Setting::slotUpdateFollowType);
|
||
|
|
|
||
|
|
ui.tableWidget->setItem(index, 4, new QTableWidgetItem("原始盘口"));
|
||
|
|
FollowHandicap* handicap = new FollowHandicap();
|
||
|
|
connect(handicap, &FollowHandicap::signalUpdateStatus, this, &Setting::slotUpdateHandicap);
|
||
|
|
m_followHandicapList.append(handicap);
|
||
|
|
|
||
|
|
|
||
|
|
QComboBox* ratioAmountCombo = new QComboBox;
|
||
|
|
ratioAmountCombo->addItem("缩放比率");
|
||
|
|
ratioAmountCombo->addItem("固定金额");
|
||
|
|
ratioAmountCombo->addItem("项目设置");
|
||
|
|
|
||
|
|
ui.tableWidget->setCellWidget(index, 5, ratioAmountCombo);
|
||
|
|
|
||
|
|
RatioAmount* ratioAmount = new RatioAmount();
|
||
|
|
m_ratioAmountList.append(ratioAmount);
|
||
|
|
connect(ratioAmountCombo, static_cast<void(QComboBox::*)(const QString&)>(&QComboBox::activated), this, [&](const QString& text) {
|
||
|
|
if (text == "项目设置")
|
||
|
|
{
|
||
|
|
m_ratioAmountList[m_ratioAmountList.count() - 1]->show();
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
ui.tableWidget->setItem(index, 6, new QTableWidgetItem("1"));
|
||
|
|
ui.tableWidget->setItem(index, 7, new QTableWidgetItem("50"));
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
// 读取配置
|
||
|
|
QList<QMap<QString, QString>> list = g_config->setting();
|
||
|
|
|
||
|
|
for (int row = 0; row < list.count(); row++)
|
||
|
|
{
|
||
|
|
QMap<QString, QString> map = list[row];
|
||
|
|
|
||
|
|
if (map["enable"] == "true")
|
||
|
|
{
|
||
|
|
reinterpret_cast<QCheckBox*>(ui.tableWidget->cellWidget(row, 0)->layout()->itemAt(0)->widget())->setChecked(true);
|
||
|
|
}
|
||
|
|
|
||
|
|
// 直接获取的是Combo,转换后再取数据封装保存
|
||
|
|
QComboBox* comboUsername = reinterpret_cast<QComboBox*>(ui.tableWidget->cellWidget(row, 1));
|
||
|
|
if (map["username"] != "")
|
||
|
|
{
|
||
|
|
comboUsername->addItem(map["username"]);
|
||
|
|
comboUsername->setCurrentText(map["username"]);
|
||
|
|
}
|
||
|
|
|
||
|
|
// 类型
|
||
|
|
QComboBox* comboType = reinterpret_cast<QComboBox*>(ui.tableWidget->cellWidget(row, 2));
|
||
|
|
if (map["type"] != "")
|
||
|
|
{
|
||
|
|
//comboType->addItem(map["type"]);
|
||
|
|
comboType->setCurrentText(map["type"]);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
QMap<QString, QString> handicap;
|
||
|
|
handicap["hkEnable"] = map["hkEnable"];
|
||
|
|
handicap["hkChange"] = map["hkChange"];
|
||
|
|
handicap["masEnable"] = map["masEnable"];
|
||
|
|
handicap["masChange"] = map["masChange"];
|
||
|
|
handicap["idaEnable"] = map["idaEnable"];
|
||
|
|
handicap["idaChange"] = map["idaChange"];
|
||
|
|
handicap["eurEnable"] = map["eurEnable"];
|
||
|
|
handicap["eurChange"] = map["eurChange"];
|
||
|
|
m_followHandicapList[row]->setMap(handicap);
|
||
|
|
|
||
|
|
QList<QMap<QString, QString>> followType = g_config->toMapList(map["followType"]);
|
||
|
|
m_followTypeList[row]->setList(followType);
|
||
|
|
|
||
|
|
reinterpret_cast<QComboBox*>(ui.tableWidget->cellWidget(row, 5))->setCurrentText(map["calcType"]);
|
||
|
|
m_ratioAmountList[row]->setList(g_config->toMapList(map["calcType_custom"]));
|
||
|
|
ui.tableWidget->item(row, 6)->setText(map["calcType_scale"]);
|
||
|
|
ui.tableWidget->item(row, 7)->setText(map["calcType_fixed"]);
|
||
|
|
}
|
||
|
|
|
||
|
|
slotUpdateHandicap();
|
||
|
|
slotUpdateFollowType();
|
||
|
|
slotUpdateRatioAmount();
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
Setting::~Setting()
|
||
|
|
{}
|
||
|
|
|
||
|
|
void Setting::slotCellClicked(int row, int column)
|
||
|
|
{
|
||
|
|
QString type = ui.tableWidget->horizontalHeaderItem(column)->text();
|
||
|
|
if (type == "跟单方式")
|
||
|
|
{
|
||
|
|
m_followTypeList[row]->show();
|
||
|
|
}
|
||
|
|
else if (type == "跟单盘口")
|
||
|
|
{
|
||
|
|
m_followHandicapList[row]->show();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
void Setting::slotUpdateFollowType()
|
||
|
|
{
|
||
|
|
for (int row = 0; row < m_followTypeList.count(); row++)
|
||
|
|
{
|
||
|
|
FollowType* followType = m_followTypeList[row];
|
||
|
|
QList<QMap<QString, QString>> list = followType->list();
|
||
|
|
int positiveFollow = 0;
|
||
|
|
int negativeFollow = 0;
|
||
|
|
for (int i = 0; i < list.count(); i++)
|
||
|
|
{
|
||
|
|
QMap<QString, QString> map = list[i];
|
||
|
|
if (map["follow_betType"] == "true")
|
||
|
|
{
|
||
|
|
positiveFollow++;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
negativeFollow++;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (positiveFollow == 0)
|
||
|
|
{
|
||
|
|
ui.tableWidget->item(row, 3)->setText("反跟");
|
||
|
|
}
|
||
|
|
else if (negativeFollow == 0)
|
||
|
|
{
|
||
|
|
ui.tableWidget->item(row, 3)->setText("正跟");
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
ui.tableWidget->item(row, 3)->setText("项目设置");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
void Setting::slotComboChecked(const QString & text)
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
void Setting::slotUpdateRatioAmount()
|
||
|
|
{
|
||
|
|
|
||
|
|
//for (int row = 0; row < m_ratioAmountList.count(); row++)
|
||
|
|
//{
|
||
|
|
// RatioAmount* ratioAmount = m_ratioAmountList[row];
|
||
|
|
// QList<QMap<QString, QString>> list = ratioAmount->list();
|
||
|
|
// int scale = 0;
|
||
|
|
// int fixed = 0;
|
||
|
|
// for (int i = 0; i < list.count(); i++)
|
||
|
|
// {
|
||
|
|
// QMap<QString, QString> map = list[i];
|
||
|
|
// if (map["type"] == "scale")
|
||
|
|
// {
|
||
|
|
// scale++;
|
||
|
|
// }
|
||
|
|
// else
|
||
|
|
// {
|
||
|
|
// fixed++;
|
||
|
|
// }
|
||
|
|
// }
|
||
|
|
// if (scale == 0)
|
||
|
|
// {
|
||
|
|
// QComboBox* combo = reinterpret_cast<QComboBox*>(ui.tableWidget->cellWidget(row, 5));
|
||
|
|
// combo->setCurrentText("固定金额");
|
||
|
|
// }
|
||
|
|
// else if (fixed == 0)
|
||
|
|
// {
|
||
|
|
// QComboBox* combo = reinterpret_cast<QComboBox*>(ui.tableWidget->cellWidget(row, 5));
|
||
|
|
// combo->setCurrentText("缩放比率");
|
||
|
|
// }
|
||
|
|
// else
|
||
|
|
// {
|
||
|
|
// QComboBox* combo = reinterpret_cast<QComboBox*>(ui.tableWidget->cellWidget(row, 5));
|
||
|
|
// combo->setCurrentText("项目设置");
|
||
|
|
// }
|
||
|
|
//}
|
||
|
|
}
|
||
|
|
|
||
|
|
void Setting::slotUpdateHandicap()
|
||
|
|
{
|
||
|
|
for (int row = 0; row < m_followHandicapList.count(); row++)
|
||
|
|
{
|
||
|
|
QMap<QString, QString> map = m_followHandicapList[row]->map();
|
||
|
|
if ((map["hkEnable"] == "true" && map["hkChange"] != "H") ||
|
||
|
|
(map["masEnable"] == "true" && map["masChange"] != "M") ||
|
||
|
|
(map["idaEnable"] == "true" && map["idaChange"] != "I") ||
|
||
|
|
(map["eurEnable"] == "true" && map["eurChange"] != "E"))
|
||
|
|
{
|
||
|
|
ui.tableWidget->item(row, 4)->setText("项目设置");
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
ui.tableWidget->item(row, 4)->setText("原始盘口");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
void Setting::slotUpdateUsers(QList<QMap<QString, QString>> list)
|
||
|
|
{
|
||
|
|
|
||
|
|
m_users = list;
|
||
|
|
//qDebug() << "[收到用户列表下拉框][slotUpdateUsers]:" << m_users;
|
||
|
|
slotAlertUsersCombo();
|
||
|
|
}
|
||
|
|
|
||
|
|
void Setting::slotAlertUsersCombo()
|
||
|
|
{
|
||
|
|
//qDebug() << "[修改用户列表下拉框][slotAlertUsersCombo]:" << m_users;
|
||
|
|
for (int row = 1; row < ui.tableWidget->rowCount(); row++)
|
||
|
|
{
|
||
|
|
QComboBox* comboType = reinterpret_cast<QComboBox*>(ui.tableWidget->cellWidget(row, 2));
|
||
|
|
// qDebug() << "row:" << row << "|" << comboType << "|" << sender();
|
||
|
|
// 找到发送者
|
||
|
|
if (comboType != sender())
|
||
|
|
{
|
||
|
|
continue;
|
||
|
|
}
|
||
|
|
QComboBox* combo = reinterpret_cast<QComboBox*>(ui.tableWidget->cellWidget(row, 1));
|
||
|
|
|
||
|
|
//
|
||
|
|
QString originalText = combo->currentText();
|
||
|
|
combo->clear();
|
||
|
|
|
||
|
|
QString type = reinterpret_cast<QComboBox*>(ui.tableWidget->cellWidget(row, 2))->currentText();
|
||
|
|
|
||
|
|
if (type == "会员")
|
||
|
|
{
|
||
|
|
// 遍历列表
|
||
|
|
for (int i = 0; i < m_users.count(); i++)
|
||
|
|
{
|
||
|
|
// 会员加入
|
||
|
|
// 判断内容为空 且 未加入
|
||
|
|
if (m_users[i]["level"] == "user")
|
||
|
|
{
|
||
|
|
//if(combo->find())
|
||
|
|
if (combo->findText(m_users[i]["username"]) == -1)
|
||
|
|
{
|
||
|
|
combo->addItem(m_users[i]["username"]);
|
||
|
|
if (m_users[i]["username"] == originalText)
|
||
|
|
{
|
||
|
|
combo->setCurrentText(originalText);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
// 遍历列表
|
||
|
|
for (int i = 0; i < m_users.count(); i++)
|
||
|
|
{
|
||
|
|
// 代理加入
|
||
|
|
if (m_users[i]["level"] != "user")
|
||
|
|
{
|
||
|
|
if (combo->findText(m_users[i]["username"]) == -1)
|
||
|
|
{
|
||
|
|
combo->addItem(m_users[i]["username"]);
|
||
|
|
if (m_users[i]["username"] == originalText)
|
||
|
|
{
|
||
|
|
combo->setCurrentText(originalText);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
void Setting::slotUpdateLeagueAndTeam(QList<QMap<QString, QString>> list)
|
||
|
|
{
|
||
|
|
emit signalUpdateLeagueAndTeam(list);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
void Setting::closeEvent(QCloseEvent* event)
|
||
|
|
{
|
||
|
|
QList<QMap<QString, QString>> list;
|
||
|
|
for (int row = 0; row < ui.tableWidget->rowCount(); row++)
|
||
|
|
{
|
||
|
|
// 先获取跟单盘口
|
||
|
|
QMap<QString, QString> map = m_followHandicapList[row]->map();
|
||
|
|
// 启用
|
||
|
|
if (reinterpret_cast<QCheckBox*>(ui.tableWidget->cellWidget(row, 0)->layout()->itemAt(0)->widget())->isChecked())
|
||
|
|
{
|
||
|
|
map["enable"] = "true";
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
map["enable"] = "false";
|
||
|
|
}
|
||
|
|
// 帐号
|
||
|
|
// 直接获取的是Combo,转换后再取数据封装保存
|
||
|
|
QComboBox* comboUsername = reinterpret_cast<QComboBox*>(ui.tableWidget->cellWidget(row, 1));
|
||
|
|
map["username"] = comboUsername->currentText();
|
||
|
|
// 类型
|
||
|
|
QComboBox* comboType = reinterpret_cast<QComboBox*>(ui.tableWidget->cellWidget(row, 2));
|
||
|
|
map["type"] = comboType->currentText();
|
||
|
|
|
||
|
|
// 跟单方式
|
||
|
|
map["followType"] = g_config->toJson(m_followTypeList[row]->list());
|
||
|
|
// 计算方式
|
||
|
|
map["calcType"] = reinterpret_cast<QComboBox*>(ui.tableWidget->cellWidget(row, 5))->currentText();
|
||
|
|
map["calcType_custom"] = g_config->toJson(m_ratioAmountList[row]->list());
|
||
|
|
map["calcType_scale"] = ui.tableWidget->item(row, 6)->text();
|
||
|
|
map["calcType_fixed"] = ui.tableWidget->item(row, 7)->text();
|
||
|
|
list.append(map);
|
||
|
|
}
|
||
|
|
g_config->setSetting(list);
|
||
|
|
|
||
|
|
QList<QString> followType;
|
||
|
|
if (ui.followNormalCheckBox->isChecked())
|
||
|
|
{
|
||
|
|
followType.append("normal");
|
||
|
|
}
|
||
|
|
if (ui.followAddTimeCheckBox->isChecked())
|
||
|
|
{
|
||
|
|
followType.append("addTime");
|
||
|
|
}
|
||
|
|
if (ui.cornerCheckBox->isChecked())
|
||
|
|
{
|
||
|
|
followType.append("corner");
|
||
|
|
}
|
||
|
|
if (ui.freeCheckBox->isChecked())
|
||
|
|
{
|
||
|
|
followType.append("free");
|
||
|
|
}
|
||
|
|
if (ui.promotionCheckBox->isChecked())
|
||
|
|
{
|
||
|
|
followType.append("promotion");
|
||
|
|
}
|
||
|
|
if (ui.championCheckBox->isChecked())
|
||
|
|
{
|
||
|
|
followType.append("champion");
|
||
|
|
}
|
||
|
|
if (ui.pointCheckBox->isChecked())
|
||
|
|
{
|
||
|
|
followType.append("point");
|
||
|
|
}
|
||
|
|
g_config->setFollowType(followType);
|
||
|
|
|
||
|
|
g_config->setLackType(ui.lackHandicapCombo->currentIndex());
|
||
|
|
g_config->setFollowDeviceType(ui.followDeviceCombo->currentIndex());
|
||
|
|
g_config->setReBetMaxTimes(ui.rebetMaxEdit->text().toInt());
|
||
|
|
g_config->setRebetSleepTimes(ui.rebetSleepTimesEdit->text().toInt());
|
||
|
|
g_config->setRebetSleep(ui.rebetSleepEdit->text().toInt());
|
||
|
|
g_config->setSessionAutoChangeEnable(ui.sessionAutoChangeCheckBox->isChecked());
|
||
|
|
g_config->setIgnoreScoreChangedEnable(ui.ignoreScoreChangedCheckBox->isChecked());
|
||
|
|
g_config->setFollowFixedScoreEnable(ui.followFixedScoreCheckBox->isChecked());
|
||
|
|
g_config->setFixedScoreMaster(ui.fixedScoreMasterEdit->text().toInt());
|
||
|
|
g_config->setFixedScoreVisitor(ui.fixedScoreVisitorEdit->text().toInt());
|
||
|
|
}
|