AUTO_PROPERTY finished
This commit is contained in:
parent
63ffa4a212
commit
16e887dcf0
34 changed files with 510 additions and 3156 deletions
|
@ -12,7 +12,7 @@ CloakLogic::CloakLogic(UiLogic *logic, QObject *parent):
|
|||
m_lineEditProtoCloakSiteText{"tile.openstreetmap.org"},
|
||||
m_lineEditProtoCloakPortText{},
|
||||
m_widgetProtoCloakEnabled{false},
|
||||
m_pushButtonProtoCloakSaveVisible{false},
|
||||
m_pushButtonCloakSaveVisible{false},
|
||||
m_progressBarProtoCloakResetVisible{false},
|
||||
m_lineEditProtoCloakPortEnabled{false},
|
||||
m_pageProtoCloakEnabled{true},
|
||||
|
@ -26,190 +26,31 @@ CloakLogic::CloakLogic(UiLogic *logic, QObject *parent):
|
|||
|
||||
void CloakLogic::updateCloakPage(const QJsonObject &ckConfig, DockerContainer container, bool haveAuthData)
|
||||
{
|
||||
setWidgetProtoCloakEnabled(haveAuthData);
|
||||
setPushButtonProtoCloakSaveVisible(haveAuthData);
|
||||
setProgressBarProtoCloakResetVisible(haveAuthData);
|
||||
set_widgetProtoCloakEnabled(haveAuthData);
|
||||
set_pushButtonCloakSaveVisible(haveAuthData);
|
||||
set_progressBarProtoCloakResetVisible(haveAuthData);
|
||||
|
||||
setComboBoxProtoCloakCipherText(ckConfig.value(config_key::cipher).
|
||||
set_comboBoxProtoCloakCipherText(ckConfig.value(config_key::cipher).
|
||||
toString(protocols::cloak::defaultCipher));
|
||||
|
||||
setLineEditProtoCloakSiteText(ckConfig.value(config_key::site).
|
||||
set_lineEditProtoCloakSiteText(ckConfig.value(config_key::site).
|
||||
toString(protocols::cloak::defaultRedirSite));
|
||||
|
||||
setLineEditProtoCloakPortText(ckConfig.value(config_key::port).
|
||||
set_lineEditProtoCloakPortText(ckConfig.value(config_key::port).
|
||||
toString(protocols::cloak::defaultPort));
|
||||
|
||||
setLineEditProtoCloakPortEnabled(container == DockerContainer::OpenVpnOverCloak);
|
||||
set_lineEditProtoCloakPortEnabled(container == DockerContainer::OpenVpnOverCloak);
|
||||
}
|
||||
|
||||
|
||||
|
||||
QJsonObject CloakLogic::getCloakConfigFromPage(QJsonObject oldConfig)
|
||||
{
|
||||
oldConfig.insert(config_key::cipher, getComboBoxProtoCloakCipherText());
|
||||
oldConfig.insert(config_key::site, getLineEditProtoCloakSiteText());
|
||||
oldConfig.insert(config_key::port, getLineEditProtoCloakPortText());
|
||||
oldConfig.insert(config_key::cipher, comboBoxProtoCloakCipherText());
|
||||
oldConfig.insert(config_key::site, lineEditProtoCloakSiteText());
|
||||
oldConfig.insert(config_key::port, lineEditProtoCloakPortText());
|
||||
|
||||
return oldConfig;
|
||||
}
|
||||
|
||||
QString CloakLogic::getComboBoxProtoCloakCipherText() const
|
||||
{
|
||||
return m_comboBoxProtoCloakCipherText;
|
||||
}
|
||||
|
||||
void CloakLogic::setComboBoxProtoCloakCipherText(const QString &comboBoxProtoCloakCipherText)
|
||||
{
|
||||
if (m_comboBoxProtoCloakCipherText != comboBoxProtoCloakCipherText) {
|
||||
m_comboBoxProtoCloakCipherText = comboBoxProtoCloakCipherText;
|
||||
emit comboBoxProtoCloakCipherTextChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QString CloakLogic::getLineEditProtoCloakPortText() const
|
||||
{
|
||||
return m_lineEditProtoCloakPortText;
|
||||
}
|
||||
|
||||
void CloakLogic::setLineEditProtoCloakPortText(const QString &lineEditProtoCloakPortText)
|
||||
{
|
||||
if (m_lineEditProtoCloakPortText != lineEditProtoCloakPortText) {
|
||||
m_lineEditProtoCloakPortText = lineEditProtoCloakPortText;
|
||||
emit lineEditProtoCloakPortTextChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QString CloakLogic::getLineEditProtoCloakSiteText() const
|
||||
{
|
||||
return m_lineEditProtoCloakSiteText;
|
||||
}
|
||||
|
||||
void CloakLogic::setLineEditProtoCloakSiteText(const QString &lineEditProtoCloakSiteText)
|
||||
{
|
||||
if (m_lineEditProtoCloakSiteText != lineEditProtoCloakSiteText) {
|
||||
m_lineEditProtoCloakSiteText = lineEditProtoCloakSiteText;
|
||||
emit lineEditProtoCloakSiteTextChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool CloakLogic::getWidgetProtoCloakEnabled() const
|
||||
{
|
||||
return m_widgetProtoCloakEnabled;
|
||||
}
|
||||
|
||||
void CloakLogic::setWidgetProtoCloakEnabled(bool widgetProtoCloakEnabled)
|
||||
{
|
||||
if (m_widgetProtoCloakEnabled != widgetProtoCloakEnabled) {
|
||||
m_widgetProtoCloakEnabled = widgetProtoCloakEnabled;
|
||||
emit widgetProtoCloakEnabledChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool CloakLogic::getPushButtonProtoCloakSaveVisible() const
|
||||
{
|
||||
return m_pushButtonProtoCloakSaveVisible;
|
||||
}
|
||||
|
||||
void CloakLogic::setPushButtonProtoCloakSaveVisible(bool pushButtonProtoCloakSaveVisible)
|
||||
{
|
||||
if (m_pushButtonProtoCloakSaveVisible != pushButtonProtoCloakSaveVisible) {
|
||||
m_pushButtonProtoCloakSaveVisible = pushButtonProtoCloakSaveVisible;
|
||||
emit pushButtonProtoCloakSaveVisibleChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool CloakLogic::getProgressBarProtoCloakResetVisible() const
|
||||
{
|
||||
return m_progressBarProtoCloakResetVisible;
|
||||
}
|
||||
|
||||
void CloakLogic::setProgressBarProtoCloakResetVisible(bool progressBarProtoCloakResetVisible)
|
||||
{
|
||||
if (m_progressBarProtoCloakResetVisible != progressBarProtoCloakResetVisible) {
|
||||
m_progressBarProtoCloakResetVisible = progressBarProtoCloakResetVisible;
|
||||
emit progressBarProtoCloakResetVisibleChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool CloakLogic::getLineEditProtoCloakPortEnabled() const
|
||||
{
|
||||
return m_lineEditProtoCloakPortEnabled;
|
||||
}
|
||||
|
||||
void CloakLogic::setLineEditProtoCloakPortEnabled(bool lineEditProtoCloakPortEnabled)
|
||||
{
|
||||
if (m_lineEditProtoCloakPortEnabled != lineEditProtoCloakPortEnabled) {
|
||||
m_lineEditProtoCloakPortEnabled = lineEditProtoCloakPortEnabled;
|
||||
emit lineEditProtoCloakPortEnabledChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool CloakLogic::getPageProtoCloakEnabled() const
|
||||
{
|
||||
return m_pageProtoCloakEnabled;
|
||||
}
|
||||
|
||||
void CloakLogic::setPageProtoCloakEnabled(bool pageProtoCloakEnabled)
|
||||
{
|
||||
if (m_pageProtoCloakEnabled != pageProtoCloakEnabled) {
|
||||
m_pageProtoCloakEnabled = pageProtoCloakEnabled;
|
||||
emit pageProtoCloakEnabledChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool CloakLogic::getLabelProtoCloakInfoVisible() const
|
||||
{
|
||||
return m_labelProtoCloakInfoVisible;
|
||||
}
|
||||
|
||||
void CloakLogic::setLabelProtoCloakInfoVisible(bool labelProtoCloakInfoVisible)
|
||||
{
|
||||
if (m_labelProtoCloakInfoVisible != labelProtoCloakInfoVisible) {
|
||||
m_labelProtoCloakInfoVisible = labelProtoCloakInfoVisible;
|
||||
emit labelProtoCloakInfoVisibleChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QString CloakLogic::getLabelProtoCloakInfoText() const
|
||||
{
|
||||
return m_labelProtoCloakInfoText;
|
||||
}
|
||||
|
||||
void CloakLogic::setLabelProtoCloakInfoText(const QString &labelProtoCloakInfoText)
|
||||
{
|
||||
if (m_labelProtoCloakInfoText != labelProtoCloakInfoText) {
|
||||
m_labelProtoCloakInfoText = labelProtoCloakInfoText;
|
||||
emit labelProtoCloakInfoTextChanged();
|
||||
}
|
||||
}
|
||||
|
||||
int CloakLogic::getProgressBarProtoCloakResetValue() const
|
||||
{
|
||||
return m_progressBarProtoCloakResetValue;
|
||||
}
|
||||
|
||||
void CloakLogic::setProgressBarProtoCloakResetValue(int progressBarProtoCloakResetValue)
|
||||
{
|
||||
if (m_progressBarProtoCloakResetValue != progressBarProtoCloakResetValue) {
|
||||
m_progressBarProtoCloakResetValue = progressBarProtoCloakResetValue;
|
||||
emit progressBarProtoCloakResetValueChanged();
|
||||
}
|
||||
}
|
||||
|
||||
int CloakLogic::getProgressBarProtoCloakResetMaximium() const
|
||||
{
|
||||
return m_progressBarProtoCloakResetMaximium;
|
||||
}
|
||||
|
||||
void CloakLogic::setProgressBarProtoCloakResetMaximium(int progressBarProtoCloakResetMaximium)
|
||||
{
|
||||
if (m_progressBarProtoCloakResetMaximium != progressBarProtoCloakResetMaximium) {
|
||||
m_progressBarProtoCloakResetMaximium = progressBarProtoCloakResetMaximium;
|
||||
emit progressBarProtoCloakResetMaximiumChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CloakLogic::onPushButtonProtoCloakSaveClicked()
|
||||
{
|
||||
QJsonObject protocolConfig = m_settings.protocolConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, Protocol::Cloak);
|
||||
|
@ -221,31 +62,31 @@ void CloakLogic::onPushButtonProtoCloakSaveClicked()
|
|||
|
||||
UiLogic::PageFunc page_proto_cloak;
|
||||
page_proto_cloak.setEnabledFunc = [this] (bool enabled) -> void {
|
||||
setPageProtoCloakEnabled(enabled);
|
||||
set_pageProtoCloakEnabled(enabled);
|
||||
};
|
||||
UiLogic::ButtonFunc pushButton_proto_cloak_save;
|
||||
pushButton_proto_cloak_save.setVisibleFunc = [this] (bool visible) ->void {
|
||||
setPushButtonProtoCloakSaveVisible(visible);
|
||||
set_pushButtonCloakSaveVisible(visible);
|
||||
};
|
||||
UiLogic::LabelFunc label_proto_cloak_info;
|
||||
label_proto_cloak_info.setVisibleFunc = [this] (bool visible) ->void {
|
||||
setLabelProtoCloakInfoVisible(visible);
|
||||
set_labelProtoCloakInfoVisible(visible);
|
||||
};
|
||||
label_proto_cloak_info.setTextFunc = [this] (const QString& text) ->void {
|
||||
setLabelProtoCloakInfoText(text);
|
||||
set_labelProtoCloakInfoText(text);
|
||||
};
|
||||
UiLogic::ProgressFunc progressBar_proto_cloak_reset;
|
||||
progressBar_proto_cloak_reset.setVisibleFunc = [this] (bool visible) ->void {
|
||||
setProgressBarProtoCloakResetVisible(visible);
|
||||
set_progressBarProtoCloakResetVisible(visible);
|
||||
};
|
||||
progressBar_proto_cloak_reset.setValueFunc = [this] (int value) ->void {
|
||||
setProgressBarProtoCloakResetValue(value);
|
||||
set_progressBarProtoCloakResetValue(value);
|
||||
};
|
||||
progressBar_proto_cloak_reset.getValueFunc = [this] (void) -> int {
|
||||
return getProgressBarProtoCloakResetValue();
|
||||
return progressBarProtoCloakResetValue();
|
||||
};
|
||||
progressBar_proto_cloak_reset.getMaximiumFunc = [this] (void) -> int {
|
||||
return getProgressBarProtoCloakResetMaximium();
|
||||
return progressBarProtoCloakResetMaximium();
|
||||
};
|
||||
|
||||
ErrorCode e = uiLogic()->doInstallAction([this, containerConfig, newContainerConfig](){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue