Move custom 'exec' into dialog - required for overlay scrollbars
This commit is contained in:
committed by
craig.p.drummond
parent
72e847ea28
commit
4c01b70835
@@ -22,6 +22,24 @@
|
||||
*/
|
||||
|
||||
#include "dialog.h"
|
||||
|
||||
#ifdef ENABLE_OVERLAYSCROLLBARS
|
||||
int Dialog::exec()
|
||||
{
|
||||
QWidget *win=parentWidget() ? parentWidget()->window() : 0;
|
||||
bool wasGl=win ? win->testAttribute(Qt::WA_GroupLeader) : false;
|
||||
if (win && !wasGl) {
|
||||
win->setAttribute(Qt::WA_GroupLeader, true);
|
||||
}
|
||||
int rv=QDialog::exec();
|
||||
if (win && !wasGl) {
|
||||
win->setAttribute(Qt::WA_GroupLeader, false);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_KDE_SUPPORT
|
||||
#include "icon.h"
|
||||
#include <QDialogButtonBox>
|
||||
#include <QPushButton>
|
||||
@@ -211,3 +229,4 @@ QAbstractButton *Dialog::getButton(ButtonCode button)
|
||||
}
|
||||
return b;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -24,13 +24,23 @@
|
||||
#ifndef DIALOG_H
|
||||
#define DIALOG_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef ENABLE_KDE_SUPPORT
|
||||
#include <KDE/KDialog>
|
||||
#ifdef ENABLE_OVERLAYSCROLLBARS
|
||||
struct Dialog : public KDialog {
|
||||
Dialog(QWidget *parent) : KDialog(parent) { }
|
||||
int exec();
|
||||
};
|
||||
#else
|
||||
typedef KDialog Dialog;
|
||||
#endif
|
||||
typedef KGuiItem GuiItem;
|
||||
#else
|
||||
#include <QDialog>
|
||||
#include <QMap>
|
||||
#include <QDebug>
|
||||
|
||||
struct GuiItem {
|
||||
GuiItem(const QString &t=QString(), const QString &i=QString())
|
||||
@@ -100,6 +110,10 @@ public:
|
||||
return mw;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_OVERLAYSCROLLBARS
|
||||
int exec();
|
||||
#endif
|
||||
|
||||
private Q_SLOTS:
|
||||
void buttonPressed(QAbstractButton *button);
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "icon.h"
|
||||
#include "dialog.h"
|
||||
#include "localize.h"
|
||||
#include "config.h"
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <QListWidget>
|
||||
@@ -94,13 +95,5 @@ void MessageBox::errorListEx(QWidget *parent, const QString &message, const QStr
|
||||
lay->addWidget(list, 1, 0, 1, 2);
|
||||
list->insertItems(0, strlist);
|
||||
dlg->setMainWidget(wid);
|
||||
QWidget *win=parent ? parent->window() : 0;
|
||||
bool wasGl=win ? win->testAttribute(Qt::WA_GroupLeader) : false;
|
||||
if (win && !wasGl) {
|
||||
win->setAttribute(Qt::WA_GroupLeader, true);
|
||||
}
|
||||
dlg->exec();
|
||||
if (win && !wasGl) {
|
||||
win->setAttribute(Qt::WA_GroupLeader, false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user