Make showing song progress on taskbar optional

This commit is contained in:
Jonas Kvinge
2024-04-04 16:49:53 +02:00
parent 70809e0647
commit d398c86b0c
4 changed files with 49 additions and 6 deletions

View File

@@ -69,6 +69,10 @@ BehaviourSettingsPage::BehaviourSettingsPage(SettingsDialog *dialog, QWidget *pa
ui_->checkbox_showtrayicon->hide();
ui_->checkbox_trayicon_progress->hide();
ui_->groupbox_startup->hide();
#else
# ifndef HAVE_DBUS
ui_->checkbox_taskbar_progress->hide();
# endif
#endif
#ifdef HAVE_TRANSLATIONS
@@ -156,6 +160,9 @@ void BehaviourSettingsPage::Load() {
ui_->checkbox_trayicon_progress->setEnabled(systemtray_available && ui_->checkbox_showtrayicon->isChecked());
ui_->checkbox_trayicon_progress->setChecked(systemtray_available && ui_->checkbox_showtrayicon->isChecked() && s.value("trayicon_progress", false).toBool());
ui_->radiobutton_hide->setEnabled(systemtray_available && ui_->checkbox_showtrayicon->isChecked());
#ifdef HAVE_DBUS
ui_->checkbox_taskbar_progress->setChecked(s.value("taskbar_progress", true).toBool());
#endif
#endif
ui_->checkbox_resumeplayback->setChecked(s.value("resumeplayback", false).toBool());
@@ -222,6 +229,9 @@ void BehaviourSettingsPage::Save() {
s.setValue("showtrayicon", ui_->checkbox_showtrayicon->isChecked());
s.setValue("keeprunning", ui_->checkbox_keeprunning->isChecked());
s.setValue("trayicon_progress", ui_->checkbox_trayicon_progress->isChecked());
#if defined(HAVE_DBUS) && !defined(Q_OS_MACOS)
s.setValue("taskbar_progress", ui_->checkbox_taskbar_progress->isChecked());
#endif
s.setValue("resumeplayback", ui_->checkbox_resumeplayback->isChecked());
s.setValue("playing_widget", ui_->checkbox_playingwidget->isChecked());