Changeset View
Changeset View
Standalone View
Standalone View
src/crypto/gui/decryptverifyfilesdialog.cpp
Show All 36 Lines | |||||
37 | 37 | | |||
38 | #include "crypto/taskcollection.h" | 38 | #include "crypto/taskcollection.h" | ||
39 | #include "crypto/decryptverifytask.h" | 39 | #include "crypto/decryptverifytask.h" | ||
40 | #include "crypto/gui/resultpage.h" | 40 | #include "crypto/gui/resultpage.h" | ||
41 | #include "crypto/gui/resultlistwidget.h" | 41 | #include "crypto/gui/resultlistwidget.h" | ||
42 | 42 | | |||
43 | #include <Libkleo/FileNameRequester> | 43 | #include <Libkleo/FileNameRequester> | ||
44 | 44 | | |||
45 | #include <QWindow> | ||||
dfaure: unused | |||||
andreylegayev: removed | |||||
45 | #include <QVBoxLayout> | 46 | #include <QVBoxLayout> | ||
46 | #include <QProgressBar> | 47 | #include <QProgressBar> | ||
dfaure: unused | |||||
andreylegayev: removed | |||||
47 | #include <QLabel> | 48 | #include <QLabel> | ||
48 | #include <QDialogButtonBox> | 49 | #include <QDialogButtonBox> | ||
49 | #include <QPushButton> | 50 | #include <QPushButton> | ||
50 | 51 | | |||
51 | #include <vector> | 52 | #include <vector> | ||
52 | 53 | | |||
53 | #include <KLocalizedString> | 54 | #include <KLocalizedString> | ||
54 | #include <KMessageBox> | 55 | #include <KMessageBox> | ||
55 | #include <KConfigGroup> | 56 | #include <KConfigGroup> | ||
56 | #include <KSharedConfig> | 57 | #include <KSharedConfig> | ||
58 | #include <KWindowConfig> | ||||
57 | 59 | | |||
58 | using namespace Kleo; | 60 | using namespace Kleo; | ||
59 | using namespace Kleo::Crypto; | 61 | using namespace Kleo::Crypto; | ||
60 | using namespace Kleo::Crypto::Gui; | 62 | using namespace Kleo::Crypto::Gui; | ||
61 | 63 | | |||
62 | DecryptVerifyFilesDialog::DecryptVerifyFilesDialog(const std::shared_ptr<TaskCollection> &coll, QWidget *parent) | 64 | DecryptVerifyFilesDialog::DecryptVerifyFilesDialog(const std::shared_ptr<TaskCollection> &coll, QWidget *parent) | ||
63 | : QDialog(parent), m_tasks(coll), m_saveButton(QDialogButtonBox::NoButton), m_buttonBox(new QDialogButtonBox) | 65 | : QDialog(parent), m_tasks(coll), m_saveButton(QDialogButtonBox::NoButton), m_buttonBox(new QDialogButtonBox) | ||
64 | { | 66 | { | ||
▲ Show 20 Lines • Show All 173 Lines • ▼ Show 20 Line(s) | 215 | void DecryptVerifyFilesDialog::checkAccept() { | |||
238 | } | 240 | } | ||
239 | 241 | | |||
240 | KMessageBox::information(this, i18n("Please select a different output folder."), | 242 | KMessageBox::information(this, i18n("Please select a different output folder."), | ||
241 | i18n("Invalid output folder.")); | 243 | i18n("Invalid output folder.")); | ||
242 | } | 244 | } | ||
243 | 245 | | |||
244 | void DecryptVerifyFilesDialog::readConfig() | 246 | void DecryptVerifyFilesDialog::readConfig() | ||
245 | { | 247 | { | ||
248 | winId(); // ensure there's a window created | ||||
249 | | ||||
250 | // set default window size | ||||
251 | windowHandle()->resize(640, 480); | ||||
252 | | ||||
253 | // restore size from config file | ||||
246 | KConfigGroup cfgGroup(KSharedConfig::openConfig(), "DecryptVerifyFilesDialog"); | 254 | KConfigGroup cfgGroup(KSharedConfig::openConfig(), "DecryptVerifyFilesDialog"); | ||
247 | const QByteArray geom = cfgGroup.readEntry("geometry", QByteArray()); | 255 | KWindowConfig::restoreWindowSize(windowHandle(), cfgGroup); | ||
248 | if (!geom.isEmpty()) { | 256 | | ||
249 | restoreGeometry(geom); | 257 | // NOTICE: QWindow::setGeometry() does NOT impact the backing QWidget geometry even if the platform | ||
250 | return; | 258 | // window was created -> QTBUG-40584. We therefore copy the size here. | ||
251 | } | 259 | // TODO: remove once this was resolved in QWidget QPA | ||
252 | resize(QSize(640, 480)); | 260 | resize(windowHandle()->size()); | ||
253 | } | 261 | } | ||
254 | 262 | | |||
255 | void DecryptVerifyFilesDialog::writeConfig() | 263 | void DecryptVerifyFilesDialog::writeConfig() | ||
256 | { | 264 | { | ||
257 | KConfigGroup cfgGroup(KSharedConfig::openConfig(), "DecryptVerifyFilesDialog"); | 265 | KConfigGroup cfgGroup(KSharedConfig::openConfig(), "DecryptVerifyFilesDialog"); | ||
258 | cfgGroup.writeEntry("geometry", saveGeometry()); | 266 | KWindowConfig::saveWindowSize(windowHandle(), cfgGroup); | ||
259 | cfgGroup.sync(); | 267 | cfgGroup.sync(); | ||
260 | } | 268 | } |
unused