Update Settings and Signals version (#3398)
Co-authored-by: zneix <zneix@zneix.eu>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <QDebug>
|
||||
#include <boost/variant.hpp>
|
||||
#include <pajlada/signals/signalholder.hpp>
|
||||
#include "Application.hpp"
|
||||
#include "common/ChatterinoSetting.hpp"
|
||||
#include "singletons/WindowManager.hpp"
|
||||
@@ -218,7 +219,7 @@ private:
|
||||
QVBoxLayout *navigationLayout_;
|
||||
|
||||
std::vector<Group> groups_;
|
||||
std::vector<pajlada::Signals::ScopedConnection> managedConnections_;
|
||||
pajlada::Signals::SignalHolder managedConnections_;
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -55,9 +55,7 @@ NotificationPage::NotificationPage()
|
||||
// implementation of custom combobox done
|
||||
// because addComboBox only can handle strings-settings
|
||||
// int setting for the ToastReaction is desired
|
||||
openIn
|
||||
.append(this->createToastReactionComboBox(
|
||||
this->managedConnections_))
|
||||
openIn.append(this->createToastReactionComboBox())
|
||||
->setSizePolicy(QSizePolicy::Maximum,
|
||||
QSizePolicy::Preferred);
|
||||
}
|
||||
@@ -118,8 +116,7 @@ NotificationPage::NotificationPage()
|
||||
}
|
||||
}
|
||||
}
|
||||
QComboBox *NotificationPage::createToastReactionComboBox(
|
||||
std::vector<pajlada::Signals::ScopedConnection> managedConnections)
|
||||
QComboBox *NotificationPage::createToastReactionComboBox()
|
||||
{
|
||||
QComboBox *toastReactionOptions = new QComboBox();
|
||||
|
||||
@@ -135,7 +132,7 @@ QComboBox *NotificationPage::createToastReactionComboBox(
|
||||
[toastReactionOptions](const int &index, auto) {
|
||||
toastReactionOptions->setCurrentIndex(index);
|
||||
},
|
||||
managedConnections);
|
||||
this->managedConnections_);
|
||||
|
||||
QObject::connect(toastReactionOptions,
|
||||
QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
|
||||
@@ -15,8 +15,7 @@ public:
|
||||
NotificationPage();
|
||||
|
||||
private:
|
||||
QComboBox *createToastReactionComboBox(
|
||||
std::vector<pajlada::Signals::ScopedConnection> managedConnections);
|
||||
QComboBox *createToastReactionComboBox();
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -157,9 +157,11 @@ QSpinBox *SettingsPage::createSpinBox(pajlada::Settings::Setting<int> &setting,
|
||||
w->setMinimum(min);
|
||||
w->setMaximum(max);
|
||||
|
||||
setting.connect([w](const int &value, auto) {
|
||||
w->setValue(value);
|
||||
});
|
||||
setting.connect(
|
||||
[w](const int &value, auto) {
|
||||
w->setValue(value);
|
||||
},
|
||||
this->managedConnections_);
|
||||
QObject::connect(w, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
[&setting](int value) {
|
||||
setting.setValue(value);
|
||||
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
protected:
|
||||
SettingsDialogTab *tab_;
|
||||
pajlada::Signals::NoArgSignal onCancel_;
|
||||
std::vector<pajlada::Signals::ScopedConnection> managedConnections_;
|
||||
pajlada::Signals::SignalHolder managedConnections_;
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
Reference in New Issue
Block a user