Changeset View
Changeset View
Standalone View
Standalone View
kded/gtkconfig.cpp
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | |||||
63 | 63 | | |||
64 | void GtkConfig::setGtk2Theme(const QString &themeName) const | 64 | void GtkConfig::setGtk2Theme(const QString &themeName) const | ||
65 | { | 65 | { | ||
66 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-theme-name"), themeName); | 66 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-theme-name"), themeName); | ||
67 | } | 67 | } | ||
68 | 68 | | |||
69 | void GtkConfig::setGtk3Theme(const QString &themeName) const | 69 | void GtkConfig::setGtk3Theme(const QString &themeName) const | ||
70 | { | 70 | { | ||
71 | ConfigEditor::setGtk3ConfigValueDconf(QStringLiteral("gtk-theme"), themeName); | 71 | ConfigEditor::setGtk3ConfigValueGSettings(QStringLiteral("gtk-theme"), themeName); | ||
72 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-theme-name"), themeName); | 72 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-theme-name"), themeName); | ||
73 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Net/ThemeName"), themeName); | 73 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Net/ThemeName"), themeName); | ||
74 | } | 74 | } | ||
75 | 75 | | |||
76 | QString GtkConfig::gtk2Theme() const | 76 | QString GtkConfig::gtk2Theme() const | ||
77 | { | 77 | { | ||
78 | return ConfigEditor::gtk2ConfigValue(QStringLiteral("gtk-theme-name")); | 78 | return ConfigEditor::gtk2ConfigValue(QStringLiteral("gtk-theme-name")); | ||
79 | } | 79 | } | ||
Show All 12 Lines | |||||
92 | { | 92 | { | ||
93 | themePreviewer->showGtk3App(themeName); | 93 | themePreviewer->showGtk3App(themeName); | ||
94 | } | 94 | } | ||
95 | 95 | | |||
96 | void GtkConfig::setFont() const | 96 | void GtkConfig::setFont() const | ||
97 | { | 97 | { | ||
98 | const QString configFontName = configValueProvider->fontName(); | 98 | const QString configFontName = configValueProvider->fontName(); | ||
99 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-font-name"), configFontName); | 99 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-font-name"), configFontName); | ||
100 | ConfigEditor::setGtk3ConfigValueDconf(QStringLiteral("font-name"), configFontName); | 100 | ConfigEditor::setGtk3ConfigValueGSettings(QStringLiteral("font-name"), configFontName); | ||
101 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-font-name"), configFontName); | 101 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-font-name"), configFontName); | ||
102 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/FontName"), configFontName); | 102 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/FontName"), configFontName); | ||
103 | } | 103 | } | ||
104 | 104 | | |||
105 | void GtkConfig::setIconTheme() const | 105 | void GtkConfig::setIconTheme() const | ||
106 | { | 106 | { | ||
107 | const QString iconThemeName = configValueProvider->iconThemeName(); | 107 | const QString iconThemeName = configValueProvider->iconThemeName(); | ||
108 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-icon-theme-name"), iconThemeName); | 108 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-icon-theme-name"), iconThemeName); | ||
109 | ConfigEditor::setGtk3ConfigValueDconf(QStringLiteral("icon-theme"), iconThemeName); | 109 | ConfigEditor::setGtk3ConfigValueGSettings(QStringLiteral("icon-theme"), iconThemeName); | ||
110 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-icon-theme-name"), iconThemeName); | 110 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-icon-theme-name"), iconThemeName); | ||
111 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Net/IconThemeName"), iconThemeName); | 111 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Net/IconThemeName"), iconThemeName); | ||
112 | } | 112 | } | ||
113 | 113 | | |||
114 | void GtkConfig::setCursorTheme() const | 114 | void GtkConfig::setCursorTheme() const | ||
115 | { | 115 | { | ||
116 | const QString cursorThemeName = configValueProvider->cursorThemeName(); | 116 | const QString cursorThemeName = configValueProvider->cursorThemeName(); | ||
117 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-cursor-theme-name"), cursorThemeName); | 117 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-cursor-theme-name"), cursorThemeName); | ||
118 | ConfigEditor::setGtk3ConfigValueDconf(QStringLiteral("cursor-theme"), cursorThemeName); | 118 | ConfigEditor::setGtk3ConfigValueGSettings(QStringLiteral("cursor-theme"), cursorThemeName); | ||
119 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-cursor-theme-name"), cursorThemeName); | 119 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-cursor-theme-name"), cursorThemeName); | ||
120 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/CursorThemeName"), cursorThemeName); | 120 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/CursorThemeName"), cursorThemeName); | ||
121 | } | 121 | } | ||
122 | 122 | | |||
123 | void GtkConfig::setIconsOnButtons() const | 123 | void GtkConfig::setIconsOnButtons() const | ||
124 | { | 124 | { | ||
125 | const QString iconsOnButtonsConfigValue = configValueProvider->iconsOnButtons(); | 125 | const bool iconsOnButtonsConfigValue = configValueProvider->iconsOnButtons(); | ||
126 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-button-images"), iconsOnButtonsConfigValue); | 126 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-button-images"), iconsOnButtonsConfigValue); | ||
127 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-button-images"), iconsOnButtonsConfigValue); | 127 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-button-images"), iconsOnButtonsConfigValue); | ||
128 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/ButtonImages"), iconsOnButtonsConfigValue); | 128 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/ButtonImages"), iconsOnButtonsConfigValue); | ||
129 | } | 129 | } | ||
130 | 130 | | |||
131 | void GtkConfig::setIconsInMenus() const | 131 | void GtkConfig::setIconsInMenus() const | ||
132 | { | 132 | { | ||
133 | const QString iconsInMenusConfigValue = configValueProvider->iconsInMenus(); | 133 | const bool iconsInMenusConfigValue = configValueProvider->iconsInMenus(); | ||
134 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-menu-images"), iconsInMenusConfigValue); | 134 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-menu-images"), iconsInMenusConfigValue); | ||
135 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-menu-images"), iconsInMenusConfigValue); | 135 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-menu-images"), iconsInMenusConfigValue); | ||
136 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/MenuImages"), iconsInMenusConfigValue); | 136 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/MenuImages"), iconsInMenusConfigValue); | ||
137 | } | 137 | } | ||
138 | 138 | | |||
139 | void GtkConfig::setToolbarStyle() const | 139 | void GtkConfig::setToolbarStyle() const | ||
140 | { | 140 | { | ||
141 | using ToolbarStyleNotation = ConfigValueProvider::ToolbarStyleNotation; | 141 | const int toolbarStyle = configValueProvider->toolbarStyle(); | ||
142 | 142 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-toolbar-style"), toolbarStyle); | |||
143 | QString toolbarStyleSettingsIni = configValueProvider->toolbarStyle(ToolbarStyleNotation::SettingsIni); | 143 | ConfigEditor::setGtk3ConfigValueGSettingsAsEnum(QStringLiteral("toolbar-style"), toolbarStyle); | ||
144 | QString toolbarStyleDConf = configValueProvider->toolbarStyle(ToolbarStyleNotation::Dconf); | 144 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-toolbar-style"), toolbarStyle); | ||
145 | QString toolbarStyleXSettingsd = configValueProvider->toolbarStyle(ToolbarStyleNotation::Xsettingsd); | 145 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/ToolbarStyle"), toolbarStyle); | ||
146 | | ||||
147 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-toolbar-style"), toolbarStyleSettingsIni); | | |||
148 | ConfigEditor::setGtk3ConfigValueDconf(QStringLiteral("toolbar-style"), toolbarStyleDConf); | | |||
149 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-toolbar-style"), toolbarStyleSettingsIni); | | |||
150 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/ToolbarStyle"), toolbarStyleXSettingsd); | | |||
151 | } | 146 | } | ||
152 | 147 | | |||
153 | void GtkConfig::setScrollbarBehavior() const | 148 | void GtkConfig::setScrollbarBehavior() const | ||
154 | { | 149 | { | ||
155 | const QString scrollbarBehavior = configValueProvider->scrollbarBehavior(); | 150 | const bool scrollbarBehavior = configValueProvider->scrollbarBehavior(); | ||
156 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-primary-button-warps-slider"), scrollbarBehavior); | 151 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-primary-button-warps-slider"), scrollbarBehavior); | ||
157 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-primary-button-warps-slider"), scrollbarBehavior); | 152 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-primary-button-warps-slider"), scrollbarBehavior); | ||
158 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/PrimaryButtonWarpsSlider"), scrollbarBehavior); | 153 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/PrimaryButtonWarpsSlider"), scrollbarBehavior); | ||
159 | } | 154 | } | ||
160 | 155 | | |||
161 | void GtkConfig::setDarkThemePreference() const | 156 | void GtkConfig::setDarkThemePreference() const | ||
162 | { | 157 | { | ||
163 | const QString preferDarkTheme = configValueProvider->preferDarkTheme(); | 158 | const bool preferDarkTheme = configValueProvider->preferDarkTheme(); | ||
164 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-application-prefer-dark-theme"), preferDarkTheme); | 159 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-application-prefer-dark-theme"), preferDarkTheme); | ||
165 | } | 160 | } | ||
166 | 161 | | |||
167 | void GtkConfig::setWindowDecorationsButtonsOrder() const | 162 | void GtkConfig::setWindowDecorationsButtonsOrder() const | ||
168 | { | 163 | { | ||
169 | const QString windowDecorationsButtonOrder = configValueProvider->windowDecorationsButtonsOrder(); | 164 | const QString windowDecorationsButtonOrder = configValueProvider->windowDecorationsButtonsOrder(); | ||
170 | ConfigEditor::setGtk3ConfigValueDconf(QStringLiteral("button-layout"), windowDecorationsButtonOrder, QStringLiteral("org.gnome.desktop.wm.preferences")); | 165 | ConfigEditor::setGtk3ConfigValueGSettings(QStringLiteral("button-layout"), windowDecorationsButtonOrder, QStringLiteral("org.gnome.desktop.wm.preferences")); | ||
171 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-decoration-layout"), windowDecorationsButtonOrder); | 166 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-decoration-layout"), windowDecorationsButtonOrder); | ||
172 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/DecorationLayout"), windowDecorationsButtonOrder); | 167 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/DecorationLayout"), windowDecorationsButtonOrder); | ||
173 | } | 168 | } | ||
174 | 169 | | |||
175 | void GtkConfig::setEnableAnimations() const | 170 | void GtkConfig::setEnableAnimations() const | ||
176 | { | 171 | { | ||
177 | const QString enableAnimations = configValueProvider->enableAnimations(); | 172 | const bool enableAnimations = configValueProvider->enableAnimations(); | ||
178 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-enable-animations"), enableAnimations); | 173 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-enable-animations"), enableAnimations); | ||
179 | // FIXME work with booleans in configValueProvider... | 174 | ConfigEditor::setGtk3ConfigValueGSettings(QStringLiteral("enable-animations"), enableAnimations); | ||
180 | ConfigEditor::setGtk3ConfigValueDconf(QStringLiteral("enable-animations"), enableAnimations == QLatin1String("1")); | | |||
181 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-enable-animations"), enableAnimations); | 175 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-enable-animations"), enableAnimations); | ||
182 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/EnableAnimations"), enableAnimations); | 176 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/EnableAnimations"), enableAnimations); | ||
183 | } | 177 | } | ||
184 | 178 | | |||
185 | void GtkConfig::applyAllSettings() const | 179 | void GtkConfig::applyAllSettings() const | ||
186 | { | 180 | { | ||
187 | setFont(); | 181 | setFont(); | ||
188 | setIconTheme(); | 182 | setIconTheme(); | ||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |