Changeset View
Changeset View
Standalone View
Standalone View
kcms/style/kcmstyle.cpp
Show First 20 Lines • Show All 158 Lines • ▼ Show 20 Line(s) | 157 | if (m_otherToolBarStyle != style) { | |||
---|---|---|---|---|---|
159 | emit otherToolBarStyleChanged(); | 159 | emit otherToolBarStyleChanged(); | ||
160 | 160 | | |||
161 | const QMetaEnum toolBarStyleEnum = QMetaEnum::fromType<ToolBarStyle>(); | 161 | const QMetaEnum toolBarStyleEnum = QMetaEnum::fromType<ToolBarStyle>(); | ||
162 | m_settings->setToolButtonStyleOtherToolbars(toolBarStyleEnum.valueToKey(m_otherToolBarStyle)); | 162 | m_settings->setToolButtonStyleOtherToolbars(toolBarStyleEnum.valueToKey(m_otherToolBarStyle)); | ||
163 | m_effectsDirty = true; | 163 | m_effectsDirty = true; | ||
164 | } | 164 | } | ||
165 | } | 165 | } | ||
166 | 166 | | |||
167 | void KCMStyle::configure(const QString &styleName, QQuickItem *ctx) | 167 | void KCMStyle::configure(const QString &title, const QString &styleName, QQuickItem *ctx) | ||
168 | { | 168 | { | ||
169 | if (m_styleConfigDialog) { | 169 | if (m_styleConfigDialog) { | ||
170 | return; | 170 | return; | ||
171 | } | 171 | } | ||
172 | 172 | | |||
173 | const QString configPage = m_model->styleConfigPage(styleName); | 173 | const QString configPage = m_model->styleConfigPage(styleName); | ||
174 | if (configPage.isEmpty()) { | 174 | if (configPage.isEmpty()) { | ||
175 | return; | 175 | return; | ||
176 | } | 176 | } | ||
177 | 177 | | |||
178 | QLibrary library(KPluginLoader::findPlugin(configPage)); | 178 | QLibrary library(KPluginLoader::findPlugin(configPage)); | ||
179 | if (!library.load()) { | 179 | if (!library.load()) { | ||
180 | qWarning() << "Failed to load style config page" << configPage << library.errorString(); | 180 | qWarning() << "Failed to load style config page" << configPage << library.errorString(); | ||
181 | emit showErrorMessage(i18n("There was an error loading the configuration dialog for this style.")); | 181 | emit showErrorMessage(i18n("There was an error loading the configuration dialog for this style.")); | ||
182 | return; | 182 | return; | ||
183 | } | 183 | } | ||
184 | 184 | | |||
185 | auto allocPtr = library.resolve("allocate_kstyle_config"); | 185 | auto allocPtr = library.resolve("allocate_kstyle_config"); | ||
186 | if (!allocPtr) { | 186 | if (!allocPtr) { | ||
187 | qWarning() << "Failed to resolve allocate_kstyle_config in" << configPage; | 187 | qWarning() << "Failed to resolve allocate_kstyle_config in" << configPage; | ||
188 | emit showErrorMessage(i18n("There was an error loading the configuration dialog for this style.")); | 188 | emit showErrorMessage(i18n("There was an error loading the configuration dialog for this style.")); | ||
189 | return; | 189 | return; | ||
190 | } | 190 | } | ||
191 | 191 | | |||
192 | m_styleConfigDialog = new StyleConfigDialog(nullptr/*this*/, configPage); | 192 | m_styleConfigDialog = new StyleConfigDialog(nullptr/*this*/, title); | ||
193 | m_styleConfigDialog->setAttribute(Qt::WA_DeleteOnClose); | 193 | m_styleConfigDialog->setAttribute(Qt::WA_DeleteOnClose); | ||
194 | m_styleConfigDialog->setWindowModality(Qt::WindowModal); | 194 | m_styleConfigDialog->setWindowModality(Qt::WindowModal); | ||
195 | m_styleConfigDialog->winId(); // so it creates windowHandle | 195 | m_styleConfigDialog->winId(); // so it creates windowHandle | ||
196 | 196 | | |||
197 | if (ctx && ctx->window()) { | 197 | if (ctx && ctx->window()) { | ||
198 | if (QWindow *actualWindow = QQuickRenderControl::renderWindowFor(ctx->window())) { | 198 | if (QWindow *actualWindow = QQuickRenderControl::renderWindowFor(ctx->window())) { | ||
199 | m_styleConfigDialog->windowHandle()->setTransientParent(actualWindow); | 199 | m_styleConfigDialog->windowHandle()->setTransientParent(actualWindow); | ||
200 | } | 200 | } | ||
▲ Show 20 Lines • Show All 142 Lines • Show Last 20 Lines |