"show at startup" checkbox always changeable

This commit is contained in:
digant 2024-12-07 16:12:34 +01:00
parent 33c50109dc
commit eb9c3aa5fd
2 changed files with 8 additions and 9 deletions

View file

@ -64,8 +64,7 @@ welcome_dialog::welcome_dialog(std::shared_ptr<gui_settings> gui_settings, bool
ui->reject->setVisible(!is_manual_show);
ui->i_have_read->setVisible(!is_manual_show);
ui->i_have_read->setChecked(is_manual_show);
ui->do_not_show->setVisible(!is_manual_show);
ui->do_not_show->setChecked(!m_gui_settings->GetValue(gui::ib_show_welcome).toBool());
ui->show_at_startup->setChecked(m_gui_settings->GetValue(gui::ib_show_welcome).toBool());
if (!is_manual_show)
{
@ -74,13 +73,13 @@ welcome_dialog::welcome_dialog(std::shared_ptr<gui_settings> gui_settings, bool
ui->accept->setEnabled(checked);
ui->reject->setEnabled(!checked);
});
connect(ui->do_not_show, &QCheckBox::clicked, this, [this](bool checked)
{
m_gui_settings->SetValue(gui::ib_show_welcome, QVariant(!checked));
});
}
connect(ui->show_at_startup, &QCheckBox::clicked, this, [this](bool checked)
{
m_gui_settings->SetValue(gui::ib_show_welcome, QVariant(checked));
});
connect(ui->accept, &QPushButton::clicked, this, &QDialog::accept); // trigger "accept" signal (setting also dialog's result code to QDialog::Accepted)
connect(ui->reject, &QPushButton::clicked, this, &QDialog::reject); // trigger "reject" signal (setting also dialog's result code to QDialog::Rejected)

View file

@ -286,9 +286,9 @@
</spacer>
</item>
<item alignment="Qt::AlignLeft">
<widget class="QCheckBox" name="do_not_show">
<widget class="QCheckBox" name="show_at_startup">
<property name="text">
<string>Do not show again</string>
<string>Show at startup</string>
</property>
</widget>
</item>