settings.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #ifndef SETTINGS_H
  2. #define SETTINGS_H
  3. #include <QSettings>
  4. namespace Settings
  5. {
  6. static inline QMap<QString, QVariant> defaults = {
  7. // General info
  8. {"General/UI_scale", "100"},
  9. {"General/CurrentInitStage", "0"},
  10. {"General/MicroUpdates", "Disabled"},
  11. // Lotro Manager
  12. {"Lotro/game_path", "none"},
  13. {"Lotro/original_locale", "English"},
  14. {"Lotro/skip_raw_downloads", "True"},
  15. {"Lotro/no_splash_screen", "True"},
  16. // Databases download settings
  17. {"DatabaseDownload/sound", "Disabled"},
  18. {"DatabaseDownload/text", "Disabled"},
  19. {"DatabaseDownload/image", "Disabled"},
  20. {"DatabaseDownload/loadscreen", "Disabled"},
  21. {"DatabaseDownload/texture", "Disabled"},
  22. {"DatabaseDownload/font", "Disabled"},
  23. {"DatabaseDownload/video", "Disabled"},
  24. // Databases applied status
  25. {"DatabaseApplied/sound", "False"},
  26. {"DatabaseApplied/text", "False"},
  27. {"DatabaseApplied/image", "False"},
  28. {"DatabaseApplied/loadscreen", "False"},
  29. {"DatabaseApplied/texture", "False"},
  30. {"DatabaseApplied/font", "False"},
  31. {"DatabaseApplied/video", "False"},
  32. // Databases downloaded paths
  33. {"DatabasePath/sound", "False"},
  34. {"DatabasePath/text", "False"},
  35. {"DatabasePath/image", "False"},
  36. {"DatabasePath/loadscreen", "False"},
  37. {"DatabasePath/texture", "False"},
  38. {"DatabasePath/font", "False"},
  39. {"DatabasePath/video", "False"},
  40. // Databases download date
  41. {"DatabaseDownloadDate/sound", "none"},
  42. {"DatabaseDownloadDate/text", "none"},
  43. {"DatabaseDownloadDate/image", "none"},
  44. {"DatabaseDownloadDate/loadscreen", "none"},
  45. {"DatabaseDownloadDate/texture", "none"},
  46. {"DatabaseDownloadDate/font", "none"},
  47. {"DatabaseDownloadDate/video", "none"},
  48. // Localisation components
  49. {"Components/fonts", "Disabled"},
  50. {"Components/texts_main", "Disabled"},
  51. {"Components/texts_items", "Disabled"},
  52. {"Components/texts_emotes", "Disabled"},
  53. {"Components/maps", "Disabled"},
  54. {"Components/loadscreens", "Disabled"},
  55. {"Components/sounds", "Disabled"},
  56. {"Components/videos", "Disabled"}
  57. };
  58. static void setDefaultSettings()
  59. {
  60. QSettings settings;
  61. foreach (QString key, defaults.keys()) {
  62. settings.setValue(key, defaults[key]);
  63. }
  64. }
  65. static QVariant getSettingsValue(QString key) {
  66. QSettings settings;
  67. return settings.value(key);
  68. }
  69. static void setSettingsValue(QString key, QVariant value) {
  70. QSettings settings;
  71. settings.setValue(key, value);
  72. }
  73. }
  74. #endif // SETTINGS_H