Title block template editor: the "Merge cells" and "Splti cell" actions are now enabled and disabled depending on what is currently selected.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1546 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2012-03-04 18:27:37 +00:00
parent ae39ee4713
commit b189c72fd9
5 changed files with 79 additions and 33 deletions

View File

@@ -499,6 +499,7 @@ void QETTitleBlockTemplateEditor::selectedCellsChanged(QList<TitleBlockCell *> s
} else {
template_cell_editor_widget_ -> setVisible(false);
}
updateActions();
}
/**
@@ -561,10 +562,15 @@ void QETTitleBlockTemplateEditor::updateEditorTitle() {
adequate actions.
*/
void QETTitleBlockTemplateEditor::updateActions() {
/// TODO complete this method
save_ -> setEnabled(!read_only_);
merge_cells_ -> setEnabled(!read_only_);
split_cell_ -> setEnabled(!read_only_);
bool can_merge;
bool can_split;
if (!read_only_) {
template_edition_area_view_ -> analyzeSelectedCells(&can_merge, &can_split);
}
merge_cells_ -> setEnabled(!read_only_ && can_merge);
split_cell_ -> setEnabled(!read_only_ && can_split);
}
/**