swift
Loading...
Searching...
No Matches
settingsadvancedcomponent.cpp
1// SPDX-FileCopyrightText: Copyright (C) 2015 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#include "ui_settingsadvancedcomponent.h"
7
8using namespace swift::misc;
9
11{
14 {
15 ui->setupUi(this);
16
17 const bool crashDumpUploadEnabled = m_crashDumpUploadEnabled.getThreadLocal();
18 ui->cb_crashDumpsUpload->setChecked(crashDumpUploadEnabled);
19 connect(ui->cb_crashDumpsUpload, &QCheckBox::checkStateChanged, this,
20 &CSettingsAdvancedComponent::crashDumpUploadEnabledChanged);
21 }
22
24
25 void CSettingsAdvancedComponent::crashDumpUploadEnabledChanged(Qt::CheckState state)
26 {
27 auto text = ui->cb_crashDumpsUpload->text();
28 if (!text.endsWith("(restart needed)"))
29 {
30 ui->cb_crashDumpsUpload->setText(ui->cb_crashDumpsUpload->text() + " (restart needed)");
31 }
32
33 m_crashDumpUploadEnabled.set(state == Qt::Checked);
34 }
35
36} // namespace swift::gui::components
CSettingsAdvancedComponent(QWidget *parent=nullptr)
Constructor.
CStatusMessage set(const T &value, qint64 timestamp=0)
Write a new value. Must be called from the thread in which the owner lives.
Definition valuecache.h:414
High level reusable GUI components.
Free functions in swift::misc.
void checkStateChanged(Qt::CheckState state)
QFrame(QWidget *parent, Qt::WindowFlags f)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const
CheckState
QWidget(QWidget *parent, Qt::WindowFlags f)