Git commit 800f187cab5f6c860914ba784535ed5f9416b92f by Montel Laurent. Committed on 31/10/2014 at 22:08. Pushed by mlaurent into branch 'master'. Save/load dialog size M +19 -0 pimcommon/texttospeech/texttospeechconfigdialog.cpp M +2 -0 pimcommon/texttospeech/texttospeechconfigdialog.h M +0 -1 pimcommon/texttospeech/texttospeechinterface.cpp http://commits.kde.org/kdepim/800f187cab5f6c860914ba784535ed5f9416b92f diff --git a/pimcommon/texttospeech/texttospeechconfigdialog.cpp b/pimcommo= n/texttospeech/texttospeechconfigdialog.cpp index 9fed35c..747e8e9 100644 --- a/pimcommon/texttospeech/texttospeechconfigdialog.cpp +++ b/pimcommon/texttospeech/texttospeechconfigdialog.cpp @@ -22,6 +22,8 @@ #include #include #include +#include +#include = using namespace PimCommon; = @@ -41,13 +43,30 @@ TextToSpeechConfigDialog::TextToSpeechConfigDialog(QWid= get *parent) connect(buttonBox, &QDialogButtonBox::rejected, this, &TextToSpeechCon= figDialog::reject); mainLayout->addWidget(buttonBox); mTextToSpeechConfigWidget->readConfig(); + readConfig(); } = TextToSpeechConfigDialog::~TextToSpeechConfigDialog() { + writeConfig(); +} + +void TextToSpeechConfigDialog::readConfig() +{ + KConfigGroup group(KSharedConfig::openConfig(), "TextToSpeechConfigDia= log"); + const QSize sizeDialog =3D group.readEntry("Size", QSize(600, 400)); + if (sizeDialog.isValid()) { + resize(sizeDialog); + } +} = +void TextToSpeechConfigDialog::writeConfig() +{ + KConfigGroup group(KSharedConfig::openConfig(), "TextToSpeechConfigDia= log"); + group.writeEntry("Size", size()); } = + void TextToSpeechConfigDialog::slotAccepted() { mTextToSpeechConfigWidget->writeConfig(); diff --git a/pimcommon/texttospeech/texttospeechconfigdialog.h b/pimcommon/= texttospeech/texttospeechconfigdialog.h index abe6d7c..621c9cd 100644 --- a/pimcommon/texttospeech/texttospeechconfigdialog.h +++ b/pimcommon/texttospeech/texttospeechconfigdialog.h @@ -33,6 +33,8 @@ private Q_SLOTS: void slotAccepted(); = private: + void readConfig(); + void writeConfig(); PimCommon::TextToSpeechConfigWidget *mTextToSpeechConfigWidget; }; } diff --git a/pimcommon/texttospeech/texttospeechinterface.cpp b/pimcommon/t= exttospeech/texttospeechinterface.cpp index f8ea34a..cbceb70 100644 --- a/pimcommon/texttospeech/texttospeechinterface.cpp +++ b/pimcommon/texttospeech/texttospeechinterface.cpp @@ -60,7 +60,6 @@ void TextToSpeechInterface::stateChanged(TextToSpeechWidg= et::State state) switch (state) { case TextToSpeechWidget::Stop: PimCommon::TextToSpeech::self()->stop(); - //TODO hide widget break; case TextToSpeechWidget::Play: PimCommon::TextToSpeech::self()->resume();