remove checkBool function, add updateSelectAllCheckbox function
Signed-off-by: Marcelo Hernandez <marcelohdez.inq@gmail.com>
This commit is contained in:
parent
a89df42561
commit
385c452ddf
@ -138,12 +138,9 @@ void CopyInstanceDialog::checkAllCheckboxes(const bool& b)
|
||||
ui->copyModsCheckbox->setChecked(b);
|
||||
}
|
||||
|
||||
// Sets b to true if state is a checked checkbox
|
||||
void CopyInstanceDialog::checkBool(bool& b, const int& state)
|
||||
// Check the "Select all" checkbox checked if all options are already checked:
|
||||
void CopyInstanceDialog::updateSelectAllCheckbox()
|
||||
{
|
||||
b = (state == Qt::Checked);
|
||||
|
||||
// Have "Select all" checkbox checked if all options are already checked:
|
||||
ui->selectAllCheckbox->blockSignals(true);
|
||||
ui->selectAllCheckbox->setChecked(m_selectedOptions.allTrue());
|
||||
ui->selectAllCheckbox->blockSignals(false);
|
||||
@ -170,42 +167,49 @@ void CopyInstanceDialog::on_instNameTextBox_textChanged(const QString &arg1)
|
||||
void CopyInstanceDialog::on_selectAllCheckbox_stateChanged(int state)
|
||||
{
|
||||
bool checked;
|
||||
checkBool(checked, state);
|
||||
checked = (state == Qt::Checked);
|
||||
checkAllCheckboxes(checked);
|
||||
}
|
||||
|
||||
void CopyInstanceDialog::on_copySavesCheckbox_stateChanged(int state)
|
||||
{
|
||||
checkBool(m_selectedOptions.copySaves, state);
|
||||
m_selectedOptions.copySaves = (state == Qt::Checked);
|
||||
updateSelectAllCheckbox();
|
||||
}
|
||||
|
||||
|
||||
void CopyInstanceDialog::on_keepPlaytimeCheckbox_stateChanged(int state)
|
||||
{
|
||||
checkBool(m_selectedOptions.keepPlaytime, state);
|
||||
m_selectedOptions.keepPlaytime = (state == Qt::Checked);
|
||||
updateSelectAllCheckbox();
|
||||
}
|
||||
|
||||
void CopyInstanceDialog::on_copyGameOptionsCheckbox_stateChanged(int state)
|
||||
{
|
||||
checkBool(m_selectedOptions.copyGameOptions, state);
|
||||
m_selectedOptions.copyGameOptions = (state == Qt::Checked);
|
||||
updateSelectAllCheckbox();
|
||||
}
|
||||
|
||||
void CopyInstanceDialog::on_copyResPacksCheckbox_stateChanged(int state)
|
||||
{
|
||||
checkBool(m_selectedOptions.copyResourcePacks, state);
|
||||
m_selectedOptions.copyResourcePacks = (state == Qt::Checked);
|
||||
updateSelectAllCheckbox();
|
||||
}
|
||||
|
||||
void CopyInstanceDialog::on_copyShaderPacksCheckbox_stateChanged(int state)
|
||||
{
|
||||
checkBool(m_selectedOptions.copyShaderPacks, state);
|
||||
m_selectedOptions.copyShaderPacks = (state == Qt::Checked);
|
||||
updateSelectAllCheckbox();
|
||||
}
|
||||
|
||||
void CopyInstanceDialog::on_copyServersCheckbox_stateChanged(int state)
|
||||
{
|
||||
checkBool(m_selectedOptions.copyServers, state);
|
||||
m_selectedOptions.copyServers = (state == Qt::Checked);
|
||||
updateSelectAllCheckbox();
|
||||
}
|
||||
|
||||
void CopyInstanceDialog::on_copyModsCheckbox_stateChanged(int state)
|
||||
{
|
||||
checkBool(m_selectedOptions.copyMods, state);
|
||||
m_selectedOptions.copyMods = (state == Qt::Checked);
|
||||
updateSelectAllCheckbox();
|
||||
}
|
||||
|
@ -45,11 +45,7 @@ private
|
||||
slots:
|
||||
void on_iconButton_clicked();
|
||||
void on_instNameTextBox_textChanged(const QString &arg1);
|
||||
|
||||
// Checkbox options:
|
||||
void checkAllCheckboxes(const bool& b);
|
||||
void checkBool(bool& b, const int& state);
|
||||
|
||||
// Checkboxes
|
||||
void on_selectAllCheckbox_stateChanged(int state);
|
||||
void on_copySavesCheckbox_stateChanged(int state);
|
||||
void on_keepPlaytimeCheckbox_stateChanged(int state);
|
||||
@ -60,6 +56,9 @@ slots:
|
||||
void on_copyModsCheckbox_stateChanged(int state);
|
||||
|
||||
private:
|
||||
void checkAllCheckboxes(const bool& b);
|
||||
void updateSelectAllCheckbox();
|
||||
/* data */
|
||||
Ui::CopyInstanceDialog *ui;
|
||||
QString InstIconKey;
|
||||
InstancePtr m_original;
|
||||
|
Loading…
Reference in New Issue
Block a user