Discord RPC implementation
This commit is contained in:
committed by
Jonas Kvinge
parent
2a4fc185ac
commit
9fa9012c70
@@ -129,6 +129,7 @@ NotificationsSettingsPage::NotificationsSettingsPage(SettingsDialog *dialog, OSD
|
||||
ui_->notifications_exp_chooser2->setIcon(IconLoader::Load(u"list-add"_s));
|
||||
|
||||
QObject::connect(pretty_popup_, &OSDPretty::PositionChanged, this, &NotificationsSettingsPage::PrettyOSDChanged);
|
||||
QObject::connect(ui_->richpresence_enabled, &QCheckBox::toggled, this, &NotificationsSettingsPage::DiscordRPCChanged);
|
||||
|
||||
}
|
||||
|
||||
@@ -205,6 +206,11 @@ void NotificationsSettingsPage::Load() {
|
||||
|
||||
ui_->notifications_fading->setChecked(pretty_popup_->fading());
|
||||
|
||||
// Discord
|
||||
s.beginGroup(DiscordRPCSettings::kSettingsGroup);
|
||||
ui_->richpresence_enabled->setChecked(s.value(DiscordRPCSettings::kEnabled).toBool());
|
||||
s.endGroup();
|
||||
|
||||
UpdatePopupVisible();
|
||||
|
||||
Init(ui_->layout_notificationssettingspage->parentWidget());
|
||||
@@ -247,6 +253,9 @@ void NotificationsSettingsPage::Save() {
|
||||
s.setValue(OSDPrettySettings::kFading, ui_->notifications_fading->isChecked());
|
||||
s.endGroup();
|
||||
|
||||
s.beginGroup(DiscordRPCSettings::kSettingsGroup);
|
||||
s.setValue(DiscordRPCSettings::kEnabled, ui_->richpresence_enabled->isChecked());
|
||||
s.endGroup();
|
||||
}
|
||||
|
||||
void NotificationsSettingsPage::PrettyOpacityChanged(int value) {
|
||||
@@ -385,3 +394,7 @@ void NotificationsSettingsPage::NotificationTypeChanged() {
|
||||
void NotificationsSettingsPage::PrettyOSDChanged() {
|
||||
set_changed();
|
||||
}
|
||||
|
||||
void NotificationsSettingsPage::DiscordRPCChanged() {
|
||||
set_changed();
|
||||
}
|
||||
|
||||
@@ -70,6 +70,8 @@ class NotificationsSettingsPage : public SettingsPage {
|
||||
|
||||
void PrettyOSDChanged();
|
||||
|
||||
void DiscordRPCChanged();
|
||||
|
||||
private:
|
||||
Ui_NotificationsSettingsPage *ui_;
|
||||
OSDBase *osd_;
|
||||
|
||||
@@ -367,6 +367,22 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupbox_discord">
|
||||
<property name="title">
|
||||
<string>Discord</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="richpresence_enabled">
|
||||
<property name="text">
|
||||
<string>Enable Rich Presence</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="spacer_bottom">
|
||||
<property name="orientation">
|
||||
|
||||
Reference in New Issue
Block a user