Added setReadOnly() methods to the title block template editor classes.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1473 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2012-01-22 14:35:57 +00:00
parent 0e0e4dfc29
commit 21c8ffbd7b
10 changed files with 152 additions and 10 deletions

View File

@@ -28,7 +28,7 @@
*/
TitleBlockTemplateCellWidget::TitleBlockTemplateCellWidget(TitleBlockTemplate *parent_template, QWidget *parent) :
QWidget(parent),
read_only(false)
read_only_(false)
{
initWidgets();
updateLogosComboBox(parent_template);
@@ -316,6 +316,25 @@ void TitleBlockTemplateCellWidget::updateLogosComboBox(const TitleBlockTemplate
}
}
/**
@param read_only whether this edition widget should be read only
*/
void TitleBlockTemplateCellWidget::setReadOnly(bool read_only) {
if (read_only_ == read_only) return;
read_only_ = read_only;
cell_type_input_ -> setEnabled(!read_only_);
logo_input_ -> setEnabled(!read_only_);
name_input_ -> setReadOnly(read_only_);
label_checkbox_ -> setEnabled(!read_only_);
label_edit_ -> setEnabled(!read_only_);
value_edit_ -> setEnabled(!read_only_);
horiz_align_input_ -> setEnabled(!read_only_);
vert_align_input_ -> setEnabled(!read_only_);
font_size_input_ -> setReadOnly(read_only_);
font_adjust_input_ -> setEnabled(!read_only_);
}
/**
Emit a horizontal alignment modification command.
@see ModifyTitleBlockCellCommand
@@ -339,6 +358,13 @@ int TitleBlockTemplateCellWidget::alignment() const {
return(horizontalAlignment() | verticalAlignment());
}
/**
@return whether this edition widget is read only
*/
bool TitleBlockTemplateCellWidget::isReadOnly() const {
return(read_only_);
}
/**
Allow the user to edit a translatable string (e.g. value or label).
If the user modified the string, this method emits a