[CurrentContainmentActionsModel] Allow making the action about dialog modal

This adjusts the "configure" dialog in the same way as the "about" dialog I fixed in 2f66c0d11c

Differential Revision: https://phabricator.kde.org/D6440
wilder-5.14
Kai Uwe Broulik 9 years ago
parent 1aa2044760
commit e5e0e91daa
  1. 8
      shell/currentcontainmentactionsmodel.cpp
  2. 2
      shell/currentcontainmentactionsmodel.h

@ -181,7 +181,7 @@ void CurrentContainmentActionsModel::remove(int row)
}
}
void CurrentContainmentActionsModel::showConfiguration(int row)
void CurrentContainmentActionsModel::showConfiguration(int row, QQuickItem *ctx)
{
const QString action = itemData(index(row, 0)).value(ActionRole).toString();
@ -193,7 +193,11 @@ void CurrentContainmentActionsModel::showConfiguration(int row)
configDlg->setAttribute(Qt::WA_DeleteOnClose);
QLayout *lay = new QVBoxLayout(configDlg);
configDlg->setLayout(lay);
configDlg->setWindowModality(Qt::WindowModal);
if (ctx && ctx->window()) {
configDlg->setWindowModality(Qt::WindowModal);
configDlg->winId(); // so it creates the windowHandle();
configDlg->windowHandle()->setTransientParent(ctx->window());
}
Plasma::ContainmentActions *pluginInstance = m_plugins[action];
//put the config in the dialog

@ -56,7 +56,7 @@ public:
Q_INVOKABLE bool append(const QString &action, const QString &plugin);
Q_INVOKABLE void update(int row, const QString &action, const QString &plugin);
Q_INVOKABLE void remove(int row);
Q_INVOKABLE void showConfiguration(int row);
Q_INVOKABLE void showConfiguration(int row, QQuickItem *ctx = nullptr);
Q_INVOKABLE void showAbout(int row, QQuickItem *ctx = nullptr);
Q_INVOKABLE void save();

Loading…
Cancel
Save