Changeset View
Changeset View
Standalone View
Standalone View
shell/currentcontainmentactionsmodel.cpp
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 173 | { | |||
---|---|---|---|---|---|
176 | 176 | | |||
177 | if (m_plugins.contains(action)) { | 177 | if (m_plugins.contains(action)) { | ||
178 | delete m_plugins[action]; | 178 | delete m_plugins[action]; | ||
179 | m_plugins.remove(action); | 179 | m_plugins.remove(action); | ||
180 | m_removedTriggers << action; | 180 | m_removedTriggers << action; | ||
181 | } | 181 | } | ||
182 | } | 182 | } | ||
183 | 183 | | |||
184 | void CurrentContainmentActionsModel::showConfiguration(int row) | 184 | void CurrentContainmentActionsModel::showConfiguration(int row, QQuickItem *ctx) | ||
185 | { | 185 | { | ||
186 | const QString action = itemData(index(row, 0)).value(ActionRole).toString(); | 186 | const QString action = itemData(index(row, 0)).value(ActionRole).toString(); | ||
187 | 187 | | |||
188 | if (!m_plugins.contains(action)) { | 188 | if (!m_plugins.contains(action)) { | ||
189 | return; | 189 | return; | ||
190 | } | 190 | } | ||
191 | 191 | | |||
192 | QDialog *configDlg = new QDialog(); | 192 | QDialog *configDlg = new QDialog(); | ||
193 | configDlg->setAttribute(Qt::WA_DeleteOnClose); | 193 | configDlg->setAttribute(Qt::WA_DeleteOnClose); | ||
194 | QLayout *lay = new QVBoxLayout(configDlg); | 194 | QLayout *lay = new QVBoxLayout(configDlg); | ||
195 | configDlg->setLayout(lay); | 195 | configDlg->setLayout(lay); | ||
196 | configDlg->setWindowModality(Qt::WindowModal); | 196 | if (ctx && ctx->window()) { | ||
197 | configDlg->setWindowModality(Qt::WindowModal); | ||||
198 | configDlg->winId(); // so it creates the windowHandle(); | ||||
199 | configDlg->windowHandle()->setTransientParent(ctx->window()); | ||||
200 | } | ||||
197 | 201 | | |||
198 | Plasma::ContainmentActions *pluginInstance = m_plugins[action]; | 202 | Plasma::ContainmentActions *pluginInstance = m_plugins[action]; | ||
199 | //put the config in the dialog | 203 | //put the config in the dialog | ||
200 | QWidget *w = pluginInstance->createConfigurationInterface(configDlg); | 204 | QWidget *w = pluginInstance->createConfigurationInterface(configDlg); | ||
201 | QString title; | 205 | QString title; | ||
202 | if (w) { | 206 | if (w) { | ||
203 | lay->addWidget(w); | 207 | lay->addWidget(w); | ||
204 | title = w->windowTitle(); | 208 | title = w->windowTitle(); | ||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |