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

Fix dialog size

parent 72954452
Pipeline #240951 passed with stage
in 14 minutes and 33 seconds
......@@ -9,11 +9,12 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QLabel>
#include <QListWidget>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char myConfigCheckDuplicateEmailsDialog[] = "CheckDuplicateEmailsDialog";
......@@ -56,14 +57,14 @@ void CheckDuplicateEmailsDialog::setDuplicatedEmails(const QMap<QString, int> &e
void CheckDuplicateEmailsDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigCheckDuplicateEmailsDialog);
group.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), group);
}
void CheckDuplicateEmailsDialog::readConfig()
{
create(); // ensure a window is created
windowHandle()->resize(QSize(500, 300));
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigCheckDuplicateEmailsDialog);
const QSize sizeDialog = group.readEntry("Size", QSize(500, 300));
if (sizeDialog.isValid()) {
resize(sizeDialog);
}
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
......@@ -7,11 +7,12 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QLabel>
#include <QListWidget>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char myConfigCheckAttachmentDialog[] = "CheckAttachmentDialog";
......@@ -52,14 +53,14 @@ void CheckAttachmentDialog::setEmails(const QStringList &emails)
void CheckAttachmentDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigCheckAttachmentDialog);
group.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), group);
}
void CheckAttachmentDialog::readConfig()
{
create(); // ensure a window is created
windowHandle()->resize(QSize(500, 300));
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigCheckAttachmentDialog);
const QSize sizeDialog = group.readEntry("Size", QSize(500, 300));
if (sizeDialog.isValid()) {
resize(sizeDialog);
}
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
......@@ -9,9 +9,10 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char myConfigGrammalecteConfigDialog[] = "GrammalecteConfigDialog";
......@@ -43,14 +44,14 @@ GrammalecteConfigDialog::~GrammalecteConfigDialog()
void GrammalecteConfigDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGrammalecteConfigDialog);
group.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), group);
}
void GrammalecteConfigDialog::readConfig()
{
create(); // ensure a window is created
windowHandle()->resize(QSize(500, 300));
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGrammalecteConfigDialog);
const QSize sizeDialog = group.readEntry("Size", QSize(500, 300));
if (sizeDialog.isValid()) {
resize(sizeDialog);
}
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
......@@ -9,10 +9,11 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char myConfigGroupName[] = "LanguageToolConfigDialog";
......@@ -45,14 +46,14 @@ LanguageToolConfigDialog::~LanguageToolConfigDialog()
void LanguageToolConfigDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGroupName);
group.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), group);
}
void LanguageToolConfigDialog::readConfig()
{
create(); // ensure a window is created
windowHandle()->resize(QSize(500, 300));
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGroupName);
const QSize sizeDialog = group.readEntry("Size", QSize(500, 300));
if (sizeDialog.isValid()) {
resize(sizeDialog);
}
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
......@@ -9,9 +9,10 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char myConfigGroupName[] = "AkonadiDatabaseToolsDialog";
......@@ -55,14 +56,14 @@ void AkonadiDatabaseToolsDialog::appendErrorText(const QString &text)
void AkonadiDatabaseToolsDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGroupName);
group.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), group);
}
void AkonadiDatabaseToolsDialog::readConfig()
{
create(); // ensure a window is created
windowHandle()->resize(QSize(500, 300));
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGroupName);
const QSize sizeDialog = group.readEntry("Size", QSize(500, 300));
if (sizeDialog.isValid()) {
resize(sizeDialog);
}
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
......@@ -10,13 +10,14 @@
#include <KLocalizedString>
#include <KPluginFactory>
#include <KSharedConfig>
#include <KWindowConfig>
#include <PimCommonAkonadi/LdapSearchDialog>
#include <QDialogButtonBox>
#include <QLineEdit>
#include <QPushButton>
#include <QTreeView>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char myConfigEmailAddressSelectionLdapDialog[] = "EmailAddressSelectionLdapDialog";
......@@ -55,19 +56,17 @@ EmailAddressSelectionLdapDialog::EmailAddressSelectionLdapDialog(QWidget *parent
void EmailAddressSelectionLdapDialog::readConfig()
{
create(); // ensure a window is created
windowHandle()->resize(QSize(500, 300));
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigEmailAddressSelectionLdapDialog);
const QSize size = group.readEntry("Size", QSize());
if (size.isValid()) {
resize(size);
} else {
resize(sizeHint().width(), sizeHint().height());
}
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
void EmailAddressSelectionLdapDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigEmailAddressSelectionLdapDialog);
group.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), group);
}
EmailAddressSelectionLdapDialog::~EmailAddressSelectionLdapDialog()
......
......@@ -10,11 +10,12 @@
#include <KPIMTextEdit/PlainTextEditor>
#include <KPIMTextEdit/PlainTextEditorWidget>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char myConfigReactionToInvitationDialog[] = "ReactionToInvitationDialog";
......@@ -61,16 +62,16 @@ QString ReactionToInvitationDialog::comment() const
void ReactionToInvitationDialog::readConfig()
{
create(); // ensure a window is created
windowHandle()->resize(QSize(600, 400));
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigReactionToInvitationDialog);
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 ReactionToInvitationDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigReactionToInvitationDialog);
group.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), group);
group.sync();
}
......@@ -9,9 +9,10 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char myConfigGroupName[] = "DKIMAuthenticationVerifiedServerDialog";
......@@ -51,16 +52,16 @@ void DKIMAuthenticationVerifiedServerDialog::slotAccepted()
void DKIMAuthenticationVerifiedServerDialog::readConfig()
{
create(); // ensure a window is created
windowHandle()->resize(QSize(600, 400));
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGroupName);
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 DKIMAuthenticationVerifiedServerDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGroupName);
group.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), group);
group.sync();
}
......@@ -9,10 +9,11 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char myConfigGroupName[] = "DKIMConfigureDialog";
......@@ -58,16 +59,16 @@ void DKIMConfigureDialog::slotReset()
void DKIMConfigureDialog::readConfig()
{
create(); // ensure a window is created
windowHandle()->resize(QSize(600, 400));
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGroupName);
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 DKIMConfigureDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGroupName);
group.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), group);
group.sync();
}
......@@ -9,9 +9,10 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char myConfigGroupName[] = "ExpireAccountTrashFolderConfigDialog";
......@@ -44,16 +45,16 @@ ExpireAccountTrashFolderConfigDialog::~ExpireAccountTrashFolderConfigDialog()
void ExpireAccountTrashFolderConfigDialog::readConfig()
{
KConfigGroup grp(KSharedConfig::openStateConfig(), myConfigGroupName);
const QSize size = grp.readEntry("Size", QSize(300, 200));
if (size.isValid()) {
resize(size);
}
create(); // ensure a window is created
windowHandle()->resize(QSize(300, 200));
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGroupName);
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
void ExpireAccountTrashFolderConfigDialog::writeConfig()
{
KConfigGroup grp(KSharedConfig::openStateConfig(), myConfigGroupName);
grp.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), grp);
grp.sync();
}
......@@ -9,9 +9,10 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char myConfigGroupName[] = "FolderConfigureSettingsDialog";
......@@ -49,16 +50,16 @@ void FolderConfigureSettingsDialog::slotSave()
void FolderConfigureSettingsDialog::readConfig()
{
KConfigGroup grp(KSharedConfig::openStateConfig(), myConfigGroupName);
const QSize size = grp.readEntry("Size", QSize(300, 200));
if (size.isValid()) {
resize(size);
}
create(); // ensure a window is created
windowHandle()->resize(QSize(300, 200));
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGroupName);
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
void FolderConfigureSettingsDialog::writeConfig()
{
KConfigGroup grp(KSharedConfig::openStateConfig(), myConfigGroupName);
grp.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), grp);
grp.sync();
}
......@@ -9,9 +9,10 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char myOpenUrlWithConfigureConfigGroupName[] = "OpenUrlWithConfigureDialog";
......@@ -51,16 +52,16 @@ void OpenUrlWithConfigureDialog::slotAccepted()
void OpenUrlWithConfigureDialog::readConfig()
{
KConfigGroup grp(KSharedConfig::openStateConfig(), myOpenUrlWithConfigureConfigGroupName);
const QSize size = grp.readEntry("Size", QSize(300, 200));
if (size.isValid()) {
resize(size);
}
create(); // ensure a window is created
windowHandle()->resize(QSize(300, 200));
KConfigGroup group(KSharedConfig::openStateConfig(), myOpenUrlWithConfigureConfigGroupName);
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
void OpenUrlWithConfigureDialog::writeConfig()
{
KConfigGroup grp(KSharedConfig::openStateConfig(), myOpenUrlWithConfigureConfigGroupName);
grp.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), grp);
grp.sync();
}
......@@ -9,9 +9,10 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char myScamConfigureSettingsDialogConfigGroupName[] = "ScamConfigureSettingsDialog";
......@@ -51,16 +52,16 @@ void ScamConfigureSettingsDialog::slotAccepted()
void ScamConfigureSettingsDialog::readConfig()
{
KConfigGroup grp(KSharedConfig::openStateConfig(), myScamConfigureSettingsDialogConfigGroupName);
const QSize size = grp.readEntry("Size", QSize(300, 200));
if (size.isValid()) {
resize(size);
}
create(); // ensure a window is created
windowHandle()->resize(QSize(300, 200));
KConfigGroup group(KSharedConfig::openStateConfig(), myScamConfigureSettingsDialogConfigGroupName);
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
void ScamConfigureSettingsDialog::writeConfig()
{
KConfigGroup grp(KSharedConfig::openStateConfig(), myScamConfigureSettingsDialogConfigGroupName);
grp.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), grp);
grp.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