window-basic-settings.hpp 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /******************************************************************************
  2. Copyright (C) 2013 by Hugh Bailey <[email protected]>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ******************************************************************************/
  14. #pragma once
  15. #include <util/util.hpp>
  16. #include <QDialog>
  17. #include <memory>
  18. class QAbstractButton;
  19. #include "ui_OBSBasicSettings.h"
  20. class OBSBasicSettings : public QDialog {
  21. Q_OBJECT
  22. private:
  23. std::unique_ptr<Ui::OBSBasicSettings> ui;
  24. ConfigFile localeIni;
  25. bool generalChanged;
  26. bool outputsChanged;
  27. bool audioChanged;
  28. bool videoChanged;
  29. int pageIndex;
  30. bool loading;
  31. inline bool Changed() const
  32. {
  33. return generalChanged || outputsChanged || audioChanged ||
  34. videoChanged;
  35. }
  36. inline void ClearChanged()
  37. {
  38. generalChanged = false;
  39. outputsChanged = false;
  40. audioChanged = false;
  41. videoChanged = false;
  42. }
  43. bool QueryChanges();
  44. void LoadGeneralSettings();
  45. //void LoadOutputSettings();
  46. //void LoadAudioSettings();
  47. void LoadVideoSettings();
  48. /* general */
  49. void LoadLanguageList();
  50. /* video */
  51. void LoadRendererList();
  52. void ResetDownscales(uint32_t cx, uint32_t cy);
  53. void LoadResolutionLists();
  54. void LoadFPSData();
  55. void LoadSettings(bool changedOnly);
  56. void SaveGeneralSettings();
  57. //void SaveOutputSettings();
  58. //void SaveAudioSettings();
  59. void SaveVideoSettings();
  60. void SaveSettings();
  61. private slots:
  62. void on_listWidget_itemSelectionChanged();
  63. void on_buttonBox_clicked(QAbstractButton *button);
  64. void on_language_currentIndexChanged(int index);
  65. void on_renderer_currentIndexChanged(int index);
  66. void on_fpsType_currentIndexChanged(int index);
  67. void on_baseResolution_editTextChanged(const QString &text);
  68. void on_outputResolution_editTextChanged(const QString &text);
  69. protected:
  70. virtual void closeEvent(QCloseEvent *event);
  71. public:
  72. OBSBasicSettings(QWidget *parent);
  73. };