Skip to content

Commit

Permalink
chore: Enable unhide source option in output mapping UI
Browse files Browse the repository at this point in the history
  • Loading branch information
royshil committed Jul 25, 2024
1 parent f7ebe6f commit e26d7f0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/ui/outputmapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ OutputMapping::OutputMapping(const output_mapping_data &mapping_data_in,
ui->toolButton_removeMapping->setEnabled(enable);
ui->plainTextEdit_template->setEnabled(enable);
ui->plainTextEdit_cssProps->setEnabled(enable);
ui->checkBox_unhide_Source->setEnabled(enable);

if (enable) {
// get the selected row
Expand Down Expand Up @@ -85,6 +86,15 @@ OutputMapping::OutputMapping(const output_mapping_data &mapping_data_in,
// call update_handler
this->update_handler(this->mapping_data);
});
connect(ui->checkBox_unhide_Source, &QCheckBox::stateChanged, [this]() {
// get the selected row
const auto row = ui->tableView->currentIndex().row();
// set the unhide_output_source of the selected row to the checkBox_unhide_Source state
this->mapping_data.mappings[row].unhide_output_source =
ui->checkBox_unhide_Source->isChecked();
// call update_handler
this->update_handler(this->mapping_data);
});

// populate the model with the mapping data
for (const auto &mapping : mapping_data.mappings) {
Expand Down
9 changes: 9 additions & 0 deletions src/ui/outputmapping.ui
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ Use {{body}} variable for unparsed object/array representation of the entire res
<property name="plainText">
<string/>
</property>
<property name="placeholderText">
<string>Select a mapping above</string>
</property>
</widget>
</item>
<item>
Expand All @@ -135,13 +138,19 @@ Use {{body}} variable for unparsed object/array representation of the entire res
<property name="plainText">
<string/>
</property>
<property name="placeholderText">
<string>Select a mapping above</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_unhide_Source">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Unhide output source on update</string>
</property>
Expand Down

0 comments on commit e26d7f0

Please sign in to comment.