diff --git a/sources/titleblock/templatecellwidget.cpp b/sources/titleblock/templatecellwidget.cpp index 73aa7ec3c..01fc429a2 100644 --- a/sources/titleblock/templatecellwidget.cpp +++ b/sources/titleblock/templatecellwidget.cpp @@ -245,7 +245,7 @@ void TitleBlockTemplateCellWidget::editLabelDisplayed() { */ void TitleBlockTemplateCellWidget::editLabel() { if (!edited_cell_) return; - editTranslatableValue(edited_cell_ -> label, "label", tr("Label de cette cellule :")); + editTranslatableValue(edited_cell_ -> label, "label", tr("Label de cette cellule")); label_input_ -> setText(edited_cell_ -> label.name()); } @@ -255,7 +255,7 @@ void TitleBlockTemplateCellWidget::editLabel() { */ void TitleBlockTemplateCellWidget::editValue() { if (!edited_cell_) return; - editTranslatableValue(edited_cell_ -> value, "value", tr("Valeur de cette cellule :")); + editTranslatableValue(edited_cell_ -> value, "value", tr("Valeur de cette cellule")); value_input_ -> setText(edited_cell_ -> value.name()); } @@ -372,19 +372,28 @@ bool TitleBlockTemplateCellWidget::isReadOnly() const { ModifyTitleBlockCellCommand object through the cellModified() signal. @param names Translatable string to be edited @param attribute Name of the edited cell attribute - @param label Label to be displayed when editing the string + @param title Title of the dialog window */ -void TitleBlockTemplateCellWidget::editTranslatableValue(NamesList &names, const QString &attribute, const QString &label) const { +void TitleBlockTemplateCellWidget::editTranslatableValue(NamesList &names, const QString &attribute, const QString &title) const { NamesListWidget *names_widget = new NamesListWidget(); names_widget -> setNames(names); QDialogButtonBox * buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + QLabel *information = new QLabel(labelValueInformationString()); + information -> setTextFormat(Qt::RichText); + information -> setWordWrap(true); + + QLabel *def_var_label = new QLabel(defaultVariablesString()); + def_var_label -> setTextFormat(Qt::RichText); + QVBoxLayout *editor_layout = new QVBoxLayout(); - editor_layout -> addWidget(new QLabel(label)); + editor_layout -> addWidget(information); editor_layout -> addWidget(names_widget); + editor_layout -> addWidget(def_var_label); editor_layout -> addWidget(buttons); QDialog edit_dialog; + edit_dialog.setWindowTitle(title); connect(buttons, SIGNAL(rejected()), &edit_dialog, SLOT(reject())); connect(buttons, SIGNAL(accepted()), &edit_dialog, SLOT(accept())); edit_dialog.setLayout(editor_layout); @@ -410,8 +419,46 @@ void TitleBlockTemplateCellWidget::emitModification(const QString &attribute, co ModifyTitleBlockCellCommand *command = new ModifyTitleBlockCellCommand(edited_cell_); command -> addModification(attribute, new_value); command -> setText( - tr("Édition d'une cellule : %1", "label of and undo command when editing a cell") + tr("\311dition d'une cellule : %1", "label of and undo command when editing a cell") .arg(TitleBlockCell::attributeName(attribute)) ); emit(cellModified(command)); } + +/** + @return a string describing the various variables provided by default by + the application. +*/ +QString TitleBlockTemplateCellWidget::defaultVariablesString() const { + QString def_var_string = tr( + "Par d\351faut, les variables suivantes sont disponibles :" + "