diff --git a/sources/titleblock/qettemplateeditor.cpp b/sources/titleblock/qettemplateeditor.cpp index 33e8fa8b5..db1973e40 100644 --- a/sources/titleblock/qettemplateeditor.cpp +++ b/sources/titleblock/qettemplateeditor.cpp @@ -239,6 +239,8 @@ void QETTitleBlockTemplateEditor::initActions() { save_as_ = new QAction(QET::Icons::DocumentSave, tr("Enregistrer sous", "menu entry"), this); save_as_file_ = new QAction(QET::Icons::DocumentSave, tr("Enregistrer vers un fichier", "menu entry"), this); quit_ = new QAction(QET::Icons::ApplicationExit, tr("&Quitter", "menu entry"), this); + undo_ = undo_stack_ -> createUndoAction(this); + redo_ = undo_stack_ -> createRedoAction(this); zoom_in_ = new QAction(QET::Icons::ZoomIn, tr("Zoom avant", "menu entry"), this); zoom_out_ = new QAction(QET::Icons::ZoomOut, tr("Zoom arri\350re", "menu entry"), this); zoom_fit_ = new QAction(QET::Icons::ZoomFitBest, tr("Zoom adapt\351", "menu entry"), this); @@ -249,10 +251,15 @@ void QETTitleBlockTemplateEditor::initActions() { merge_cells_ = new QAction( tr("&Fusionner les cellules", "menu entry"), this); split_cell_ = new QAction( tr("&S\351parer les cellules", "menu entry"), this); + undo_ -> setIcon(QET::Icons::EditUndo); + redo_ -> setIcon(QET::Icons::EditRedo); + new_ -> setShortcut(QKeySequence::New); open_ -> setShortcut(QKeySequence::Open); save_ -> setShortcut(QKeySequence::Save); quit_ -> setShortcut(QKeySequence(tr("Ctrl+Q", "shortcut to quit"))); + undo_ -> setShortcut(QKeySequence::Undo); + redo_ -> setShortcut(QKeySequence::Redo); merge_cells_ -> setShortcut(QKeySequence(tr("Ctrl+K", "shortcut to merge cells"))); split_cell_ -> setShortcut(QKeySequence(tr("Ctrl+J", "shortcut to split merged cell"))); zoom_in_ -> setShortcut(QKeySequence::ZoomIn); @@ -307,6 +314,9 @@ void QETTitleBlockTemplateEditor::initMenus() { file_menu_ -> addSeparator(); file_menu_ -> addAction(quit_); + edit_menu_ -> addAction(undo_); + edit_menu_ -> addAction(redo_); + edit_menu_ -> addSeparator(); edit_menu_ -> addAction(merge_cells_); edit_menu_ -> addAction(split_cell_); diff --git a/sources/titleblock/qettemplateeditor.h b/sources/titleblock/qettemplateeditor.h index 49fb28d7e..02f0a9f64 100644 --- a/sources/titleblock/qettemplateeditor.h +++ b/sources/titleblock/qettemplateeditor.h @@ -49,8 +49,11 @@ class QETTitleBlockTemplateEditor : public QMainWindow { /// menus TODO QMenu *file_menu_, *edit_menu_,/* *paste_from_menu_, */*display_menu_,/* *tools_menu_,*/ *config_menu_, *help_menu_; /// actions - QAction *new_, *open_, *open_from_file_, *save_, *save_as_, *save_as_file_, *quit_, *configure_, *about_qt_, *about_qet_, *merge_cells_, *split_cell_; + QAction *new_, *open_, *open_from_file_, *save_, *save_as_, *save_as_file_, *quit_; + QAction *undo_, *redo_, *merge_cells_, *split_cell_; QAction *zoom_in_, *zoom_out_, *zoom_fit_, *zoom_reset_; + QAction *configure_; + QAction *about_qt_, *about_qet_; /// Location of the currently edited template TitleBlockTemplateLocation location_; /// Filepath of the currently edited template, if opened from a file diff --git a/sources/titleblock/templatecellwidget.cpp b/sources/titleblock/templatecellwidget.cpp index 712cecaf5..7bd8c3366 100644 --- a/sources/titleblock/templatecellwidget.cpp +++ b/sources/titleblock/templatecellwidget.cpp @@ -231,6 +231,7 @@ void TitleBlockTemplateCellWidget::editLabelDisplayed() { void TitleBlockTemplateCellWidget::editLabel() { if (!edited_cell_) return; editTranslatableValue(edited_cell_ -> label, "label", tr("Label de cette cellule :")); + label_input_ -> setText(edited_cell_ -> label.name()); } /** @@ -240,6 +241,7 @@ void TitleBlockTemplateCellWidget::editLabel() { void TitleBlockTemplateCellWidget::editValue() { if (!edited_cell_) return; editTranslatableValue(edited_cell_ -> value, "value", tr("Valeur de cette cellule :")); + value_input_ -> setText(edited_cell_ -> value.name()); } /** @@ -347,6 +349,7 @@ void TitleBlockTemplateCellWidget::editTranslatableValue(NamesList &names, const edit_dialog.setLayout(editor_layout); if (edit_dialog.exec() == QDialog::Accepted) { emitModification(attribute, qVariantFromValue(names_widget -> names())); + } }