Commit c3b92566 authored by Laurent Montel's avatar Laurent Montel
Browse files

Fix dialog size

parent 5e7ac13b
Pipeline #237327 canceled with stage
in 3 minutes and 29 seconds
......@@ -18,7 +18,9 @@
#include <PimCommon/PimUtil>
#include <importwizard/checks/importimapsettingsakonadipassword.h>
#include <KWindowConfig>
#include <QPushButton>
#include <QWindow>
ImportImapSettingWizard::ImportImapSettingWizard(QWidget *parent)
: KAssistantDialog(parent)
......@@ -117,17 +119,17 @@ void ImportImapSettingWizard::next()
void ImportImapSettingWizard::readConfig()
{
create(); // ensure a window is created
windowHandle()->resize(QSize(600, 400));
KConfigGroup group(KSharedConfig::openStateConfig(), "SieveEditorConfigureDialog");
const QSize size = group.readEntry("Size", QSize(600, 400));
if (size.isValid()) {
resize(size);
}
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
void ImportImapSettingWizard::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SieveEditorConfigureDialog");
group.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), group);
group.sync();
}
......
......@@ -8,9 +8,11 @@
#include "serversievesettings.h"
#include <KLocalizedString>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
#include <QWindow>
ServerSieveSettingsDialog::ServerSieveSettingsDialog(QWidget *parent)
: QDialog(parent)
......@@ -46,17 +48,17 @@ ServerSieveSettingsDialog::~ServerSieveSettingsDialog()
void ServerSieveSettingsDialog::readConfig()
{
create(); // ensure a window is created
windowHandle()->resize(QSize(450, 350));
KConfigGroup group(KSharedConfig::openStateConfig(), "ServerSieveSettingsDialog");
const QSize size = group.readEntry("Size", QSize(450, 350));
if (size.isValid()) {
resize(size);
}
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
void ServerSieveSettingsDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "ServerSieveSettingsDialog");
group.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), group);
group.sync();
}
......
......@@ -5,7 +5,6 @@
*/
#include "sieveeditorconfiguredialog.h"
#include "serversievelistwidget.h"
#include "sieveeditorconfigureserverwidget.h"
#include "sieveeditorglobalconfig.h"
#include <PimCommon/ConfigureImmutableWidgetUtils>
......@@ -20,10 +19,12 @@
#include <KSharedConfig>
#include <KConfigGroup>
#include <KWindowConfig>
#include <QCheckBox>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
#include <QWindow>
SieveEditorConfigureDialog::SieveEditorConfigureDialog(QWidget *parent)
: KPageDialog(parent)
......@@ -106,16 +107,16 @@ void SieveEditorConfigureDialog::saveServerSieveConfig()
void SieveEditorConfigureDialog::readConfig()
{
create(); // ensure a window is created
windowHandle()->resize(QSize(600, 400));
KConfigGroup group(KSharedConfig::openStateConfig(), "SieveEditorConfigureDialog");
const QSize size = group.readEntry("Size", QSize(600, 400));
if (size.isValid()) {
resize(size);
}
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
void SieveEditorConfigureDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SieveEditorConfigureDialog");
group.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), group);
group.sync();
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment