#include "icon.h"
SettingsDlg::SettingsDlg(QWidget *parent)
- : QDialog(parent),
- _currentPage(nullptr)
+ : QDialog(parent)
{
ui.setupUi(this);
setModal(true);
ui.settingsTree->setRootIsDecorated(false);
- connect(ui.settingsTree, SIGNAL(itemSelectionChanged()), this, SLOT(itemSelected()));
- connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *)));
+ connect(ui.settingsTree, &QTreeWidget::itemSelectionChanged, this, &SettingsDlg::itemSelected);
+ connect(ui.buttonBox, &QDialogButtonBox::clicked, this, &SettingsDlg::buttonClicked);
- connect(Client::instance(), SIGNAL(coreConnectionStateChanged(bool)), SLOT(coreConnectionStateChanged()));
+ connect(Client::instance(), &Client::coreConnectionStateChanged, this, &SettingsDlg::coreConnectionStateChanged);
setButtonStates();
}
void SettingsDlg::setItemState(QTreeWidgetItem *item)
{
- SettingsPage *sp = qobject_cast<SettingsPage *>(item->data(0, SettingsPageRole).value<QObject *>());
+ auto *sp = qobject_cast<SettingsPage *>(item->data(0, SettingsPageRole).value<QObject *>());
Q_ASSERT(sp);
bool disabledDueToConnection = !Client::isConnected() && sp->needsCoreConnection();
bool disabledDueToOwnChoice = !sp->isSelectable();