Commit 56a93683 authored by Laurent Montel's avatar Laurent Montel 😁

Start to create restore value

parent 1676b0d1
......@@ -37,12 +37,13 @@ TextToSpeechConfigDialog::TextToSpeechConfigDialog(QWidget *parent)
mTextToSpeechConfigWidget = new TextToSpeechConfigWidget(parent);
mainLayout->addWidget(mTextToSpeechConfigWidget);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults, this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &TextToSpeechConfigDialog::slotAccepted);
connect(buttonBox, &QDialogButtonBox::rejected, this, &TextToSpeechConfigDialog::reject);
connect(buttonBox->button(QDialogButtonBox::RestoreDefaults), &QPushButton::clicked, this, &TextToSpeechConfigDialog::slotRestoreDefaults);
mainLayout->addWidget(buttonBox);
mTextToSpeechConfigWidget->readConfig();
readConfig();
......@@ -53,6 +54,11 @@ TextToSpeechConfigDialog::~TextToSpeechConfigDialog()
writeConfig();
}
void TextToSpeechConfigDialog::slotRestoreDefaults()
{
mTextToSpeechConfigWidget->restoreDefaults();
}
void TextToSpeechConfigDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openConfig(), "TextToSpeechConfigDialog");
......
......@@ -31,10 +31,9 @@ public:
explicit TextToSpeechConfigDialog(QWidget *parent = nullptr);
~TextToSpeechConfigDialog();
private Q_SLOTS:
void slotAccepted();
private:
void slotAccepted();
void slotRestoreDefaults();
void readConfig();
void writeConfig();
KPIMTextEdit::TextToSpeechConfigWidget *mTextToSpeechConfigWidget;
......
......@@ -135,6 +135,11 @@ void TextToSpeechConfigWidget::setTextToSpeechConfigInterface(AbstractTextToSpee
slotUpdateSettings();
}
void TextToSpeechConfigWidget::restoreDefaults()
{
//TODO
}
void TextToSpeechConfigWidget::updateAvailableEngine()
{
mAvailableEngine->clear();
......
......@@ -37,6 +37,7 @@ public:
void readConfig();
void setTextToSpeechConfigInterface(AbstractTextToSpeechConfigInterface *interface);
void restoreDefaults();
Q_SIGNALS:
void configChanged(bool state);
......
Markdown is supported
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