mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 13:36:48 +08:00
43
src/blackgui/components/settingsadvancedcomponent.cpp
Normal file
43
src/blackgui/components/settingsadvancedcomponent.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
/* Copyright (C) 2015
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackgui/components/settingsadvancedcomponent.h"
|
||||
#include "ui_settingsadvancedcomponent.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
CSettingsAdvancedComponent::CSettingsAdvancedComponent(QWidget *parent) :
|
||||
QFrame(parent),
|
||||
ui(new Ui::CSettingsAdvancedComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->m_crashDumpsUpload->setChecked(m_crashDumpUploadEnabled.getThreadLocal());
|
||||
connect(ui->m_crashDumpsUpload, &QCheckBox::stateChanged, this, &CSettingsAdvancedComponent::crashDumpUploadEnabledChanged);
|
||||
}
|
||||
|
||||
CSettingsAdvancedComponent::~CSettingsAdvancedComponent()
|
||||
{
|
||||
}
|
||||
|
||||
void CSettingsAdvancedComponent::crashDumpUploadEnabledChanged(int state)
|
||||
{
|
||||
auto text = ui->m_crashDumpsUpload->text();
|
||||
if (!text.endsWith("(restart needed)"))
|
||||
{
|
||||
ui->m_crashDumpsUpload->setText(ui->m_crashDumpsUpload->text() + " (restart needed)");
|
||||
}
|
||||
m_crashDumpUploadEnabled.set(state == Qt::Checked);
|
||||
}
|
||||
|
||||
} // ns
|
||||
} // ns
|
||||
Reference in New Issue
Block a user