mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
Ref T401, adjusted settings used in components
This commit is contained in:
@@ -7,12 +7,14 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackmisc/crashsettings.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackconfig/buildconfig.h"
|
||||
#include "legalinfocomponent.h"
|
||||
#include "ui_legalinfocomponent.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Settings;
|
||||
using namespace BlackConfig;
|
||||
|
||||
namespace BlackGui
|
||||
@@ -24,8 +26,9 @@ namespace BlackGui
|
||||
ui(new Ui::CLegalInfoComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
const bool cd = m_crashDumpUploadEnabled.get();
|
||||
ui->cb_CrashDumps->setChecked(cd);
|
||||
|
||||
const CCrashSettings settings = m_crashDumpSettings.get();
|
||||
ui->cb_CrashDumps->setChecked(settings.isEnabled());
|
||||
ui->cb_Agree->setChecked(CBuildConfig::isLocalDeveloperDebugBuild());
|
||||
connect(ui->cb_CrashDumps, &QCheckBox::toggled, this, &CLegalInfoComponent::onAllowCrashDumps);
|
||||
}
|
||||
@@ -48,7 +51,9 @@ namespace BlackGui
|
||||
|
||||
void CLegalInfoComponent::onAllowCrashDumps(bool checked)
|
||||
{
|
||||
m_crashDumpUploadEnabled.setAndSave(checked);
|
||||
CCrashSettings settings = m_crashDumpSettings.get();
|
||||
settings.setEnabled(checked);
|
||||
m_crashDumpSettings.setAndSave(settings);
|
||||
}
|
||||
|
||||
bool CLegalInfoWizardPage::validatePage()
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace BlackGui
|
||||
void onAllowCrashDumps(bool checked);
|
||||
|
||||
QScopedPointer<Ui::CLegalInfoComponent> ui;
|
||||
BlackMisc::CSetting<BlackCore::Application::TCrashDumpUploadEnabled> m_crashDumpUploadEnabled { this };
|
||||
BlackMisc::CSetting<BlackCore::Application::TCrashDumpSettings> m_crashDumpSettings { this };
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,10 +7,12 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackgui/components/settingsadvancedcomponent.h"
|
||||
#include "ui_settingsadvancedcomponent.h"
|
||||
#include "blackgui/components/settingsadvancedcomponent.h"
|
||||
#include "blackmisc/crashsettings.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Settings;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
@@ -21,7 +23,9 @@ namespace BlackGui
|
||||
ui(new Ui::CSettingsAdvancedComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->cb_crashDumpsUpload->setChecked(m_crashDumpUploadEnabled.getThreadLocal());
|
||||
|
||||
const CCrashSettings settings = m_crashDumpSettings.getThreadLocal();
|
||||
ui->cb_crashDumpsUpload->setChecked(settings.isEnabled());
|
||||
connect(ui->cb_crashDumpsUpload, &QCheckBox::stateChanged, this, &CSettingsAdvancedComponent::crashDumpUploadEnabledChanged);
|
||||
}
|
||||
|
||||
@@ -35,7 +39,10 @@ namespace BlackGui
|
||||
{
|
||||
ui->cb_crashDumpsUpload->setText(ui->cb_crashDumpsUpload->text() + " (restart needed)");
|
||||
}
|
||||
m_crashDumpUploadEnabled.set(state == Qt::Checked);
|
||||
|
||||
CCrashSettings settings = m_crashDumpSettings.getThreadLocal();
|
||||
settings.setEnabled(state == Qt::Checked);
|
||||
m_crashDumpSettings.set(settings);
|
||||
}
|
||||
|
||||
} // ns
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
#include <QObject>
|
||||
#include <QScopedPointer>
|
||||
|
||||
class QWidget;
|
||||
|
||||
namespace Ui { class CSettingsAdvancedComponent; }
|
||||
namespace BlackGui
|
||||
{
|
||||
@@ -43,7 +41,7 @@ namespace BlackGui
|
||||
void crashDumpUploadEnabledChanged(int state);
|
||||
|
||||
QScopedPointer<Ui::CSettingsAdvancedComponent> ui;
|
||||
BlackMisc::CSetting<BlackCore::Application::TCrashDumpUploadEnabled> m_crashDumpUploadEnabled { this };
|
||||
BlackMisc::CSetting<BlackCore::Application::TCrashDumpSettings> m_crashDumpSettings { this };
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user