Changeset View
Changeset View
Standalone View
Standalone View
src/kcmultidialog.cpp
Show All 21 Lines | |||||
22 | 22 | | |||
23 | */ | 23 | */ | ||
24 | 24 | | |||
25 | #include "kcmultidialog.h" | 25 | #include "kcmultidialog.h" | ||
26 | #include "kcmultidialog_p.h" | 26 | #include "kcmultidialog_p.h" | ||
27 | 27 | | |||
28 | #include "kcmoduleproxy.h" | 28 | #include "kcmoduleproxy.h" | ||
29 | 29 | | |||
30 | #include <QApplication> | ||||
30 | #include <QDebug> | 31 | #include <QDebug> | ||
31 | #include <QDesktopServices> | 32 | #include <QDesktopServices> | ||
33 | #include <QDesktopWidget> | ||||
32 | #include <QProcess> | 34 | #include <QProcess> | ||
33 | #include <QPushButton> | 35 | #include <QPushButton> | ||
34 | #include <QScrollArea> | 36 | #include <QScrollArea> | ||
35 | #include <QStringList> | 37 | #include <QStringList> | ||
36 | #include <QUrl> | 38 | #include <QUrl> | ||
37 | 39 | | |||
38 | #include <KAuthAction> | 40 | #include <KAuthAction> | ||
39 | #include <KAuthObjectDecorator> | 41 | #include <KAuthObjectDecorator> | ||
▲ Show 20 Lines • Show All 216 Lines • ▼ Show 20 Line(s) | |||||
256 | 258 | | |||
257 | KCMultiDialog::~KCMultiDialog() | 259 | KCMultiDialog::~KCMultiDialog() | ||
258 | { | 260 | { | ||
259 | delete d_ptr; | 261 | delete d_ptr; | ||
260 | } | 262 | } | ||
261 | 263 | | |||
262 | void KCMultiDialog::showEvent(QShowEvent *ev) | 264 | void KCMultiDialog::showEvent(QShowEvent *ev) | ||
263 | { | 265 | { | ||
264 | resize(QSize(800, 550)); | | |||
265 | adjustSize(); | | |||
266 | KPageDialog::showEvent(ev); | 266 | KPageDialog::showEvent(ev); | ||
267 | adjustSize(); | ||||
268 | /** | ||||
269 | * adjustSize() relies on sizeHint but is limited to 2/3 of the desktop size | ||||
270 | * Workaround for https://bugreports.qt.io/browse/QTBUG-3459 | ||||
271 | * | ||||
272 | * We adjust the size after passing the show event | ||||
273 | * because otherwise window pos is set to (0,0) | ||||
274 | */ | ||||
275 | const QSize maxSize = QApplication::desktop()->availableGeometry(pos()).size(); | ||||
276 | resize(qMin(sizeHint().width(), maxSize.width()), | ||||
277 | qMin(sizeHint().height(), maxSize.height())); | ||||
267 | } | 278 | } | ||
268 | 279 | | |||
269 | void KCMultiDialog::slotDefaultClicked() | 280 | void KCMultiDialog::slotDefaultClicked() | ||
270 | { | 281 | { | ||
271 | Q_D(KCMultiDialog); | 282 | Q_D(KCMultiDialog); | ||
272 | const KPageWidgetItem *item = currentPage(); | 283 | const KPageWidgetItem *item = currentPage(); | ||
273 | if (!item) { | 284 | if (!item) { | ||
274 | return; | 285 | return; | ||
▲ Show 20 Lines • Show All 255 Lines • Show Last 20 Lines |