Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.1KB

  1. /*
  2. * Carla plugin host
  3. * Copyright (C) 2011-2023 Filipe Coelho <falktx@falktx.com>
  4. * SPDX-License-Identifier: GPL-2.0-or-later
  5. */
  6. #pragma once
  7. #include "ui_pluginrefreshdialog.h"
  8. #include "qsafesettings.hpp"
  9. // --------------------------------------------------------------------------------------------------------------------
  10. // Plugin Refresh Dialog
  11. struct PluginRefreshDialog : QDialog, Ui_PluginRefreshDialog {
  12. explicit PluginRefreshDialog(QWidget* const parent)
  13. : QDialog(parent)
  14. {
  15. setupUi(this);
  16. setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
  17. #ifdef CARLA_OS_MAC
  18. setWindowModality(Qt::WindowModal);
  19. #endif
  20. b_skip->setEnabled(false);
  21. ch_invalid->setEnabled(false);
  22. // ------------------------------------------------------------------------------------------------------------
  23. // Load settings
  24. {
  25. const QSafeSettings settings;
  26. restoreGeometry(settings.valueByteArray("PluginRefreshDialog/Geometry"));
  27. if (settings.valueBool("PluginRefreshDialog/RefreshAll", false))
  28. ch_all->setChecked(true);
  29. else
  30. ch_updated->setChecked(true);
  31. ch_invalid->setChecked(settings.valueBool("PluginRefreshDialog/CheckInvalid", false));
  32. }
  33. // ------------------------------------------------------------------------------------------------------------
  34. // Set-up connections
  35. QObject::connect(this, &QDialog::finished, this, &PluginRefreshDialog::saveSettings);
  36. }
  37. // ----------------------------------------------------------------------------------------------------------------
  38. // private slots
  39. private Q_SLOTS:
  40. void saveSettings()
  41. {
  42. QSafeSettings settings;
  43. settings.setValue("PluginRefreshDialog/Geometry", saveGeometry());
  44. settings.setValue("PluginRefreshDialog/RefreshAll", ch_all->isChecked());
  45. settings.setValue("PluginRefreshDialog/CheckInvalid", ch_invalid->isChecked());
  46. }
  47. };
  48. // --------------------------------------------------------------------------------------------------------------------