Add edit finished signal to settings widget.

This commit is contained in:
Florian Geyer 2012-05-27 20:29:15 +02:00
parent f53768fc84
commit 6cd65ae9a7
3 changed files with 13 additions and 2 deletions

View File

@ -77,8 +77,7 @@ MainWindow::MainWindow()
connect(m_ui->tabWidget, SIGNAL(currentChanged(int)),
SLOT(updateWindowTitle()));
connect(m_ui->stackedWidget, SIGNAL(currentChanged(int)), SLOT(setMenuActionState()));
connect(m_ui->settingsWidget, SIGNAL(accepted()), SLOT(switchToDatabases()));
connect(m_ui->settingsWidget, SIGNAL(rejected()), SLOT(switchToDatabases()));
connect(m_ui->settingsWidget, SIGNAL(editFinished(bool)), SLOT(switchToDatabases()));
connect(m_ui->actionDatabaseNew, SIGNAL(triggered()), SLOT(switchToDatabases()));
connect(m_ui->actionDatabaseNew, SIGNAL(triggered()), m_ui->tabWidget,

View File

@ -31,6 +31,7 @@ SettingsWidget::SettingsWidget(QWidget* parent)
add(tr("Security"), m_secWidget);
connect(this, SIGNAL(accepted()), SLOT(saveSettings()));
connect(this, SIGNAL(rejected()), SLOT(reject()));
connect(m_secUi->clearClipboardCheckBox, SIGNAL(toggled(bool)),
m_secUi->clearClipboardSpinBox, SLOT(setEnabled(bool)));
@ -52,4 +53,11 @@ void SettingsWidget::saveSettings()
{
config()->set("security/clearclipboard", m_secUi->clearClipboardCheckBox->isChecked());
config()->set("security/clearclipboardtimeout", m_secUi->clearClipboardSpinBox->value());
Q_EMIT editFinished(true);
}
void SettingsWidget::reject()
{
Q_EMIT editFinished(false);
}

View File

@ -33,8 +33,12 @@ public:
~SettingsWidget();
void loadSettings();
Q_SIGNALS:
void editFinished(bool accepted);
private Q_SLOTS:
void saveSettings();
void reject();
private:
QWidget* const m_secWidget;