mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-22 01:10:53 +01:00
Title block tempalte editor: added undo/redo menu entries.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1460 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -239,6 +239,8 @@ void QETTitleBlockTemplateEditor::initActions() {
|
|||||||
save_as_ = new QAction(QET::Icons::DocumentSave, tr("Enregistrer sous", "menu entry"), this);
|
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);
|
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);
|
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_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_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);
|
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);
|
merge_cells_ = new QAction( tr("&Fusionner les cellules", "menu entry"), this);
|
||||||
split_cell_ = new QAction( tr("&S\351parer 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);
|
new_ -> setShortcut(QKeySequence::New);
|
||||||
open_ -> setShortcut(QKeySequence::Open);
|
open_ -> setShortcut(QKeySequence::Open);
|
||||||
save_ -> setShortcut(QKeySequence::Save);
|
save_ -> setShortcut(QKeySequence::Save);
|
||||||
quit_ -> setShortcut(QKeySequence(tr("Ctrl+Q", "shortcut to quit")));
|
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")));
|
merge_cells_ -> setShortcut(QKeySequence(tr("Ctrl+K", "shortcut to merge cells")));
|
||||||
split_cell_ -> setShortcut(QKeySequence(tr("Ctrl+J", "shortcut to split merged cell")));
|
split_cell_ -> setShortcut(QKeySequence(tr("Ctrl+J", "shortcut to split merged cell")));
|
||||||
zoom_in_ -> setShortcut(QKeySequence::ZoomIn);
|
zoom_in_ -> setShortcut(QKeySequence::ZoomIn);
|
||||||
@@ -307,6 +314,9 @@ void QETTitleBlockTemplateEditor::initMenus() {
|
|||||||
file_menu_ -> addSeparator();
|
file_menu_ -> addSeparator();
|
||||||
file_menu_ -> addAction(quit_);
|
file_menu_ -> addAction(quit_);
|
||||||
|
|
||||||
|
edit_menu_ -> addAction(undo_);
|
||||||
|
edit_menu_ -> addAction(redo_);
|
||||||
|
edit_menu_ -> addSeparator();
|
||||||
edit_menu_ -> addAction(merge_cells_);
|
edit_menu_ -> addAction(merge_cells_);
|
||||||
edit_menu_ -> addAction(split_cell_);
|
edit_menu_ -> addAction(split_cell_);
|
||||||
|
|
||||||
|
|||||||
@@ -49,8 +49,11 @@ class QETTitleBlockTemplateEditor : public QMainWindow {
|
|||||||
/// menus TODO
|
/// menus TODO
|
||||||
QMenu *file_menu_, *edit_menu_,/* *paste_from_menu_, */*display_menu_,/* *tools_menu_,*/ *config_menu_, *help_menu_;
|
QMenu *file_menu_, *edit_menu_,/* *paste_from_menu_, */*display_menu_,/* *tools_menu_,*/ *config_menu_, *help_menu_;
|
||||||
/// actions
|
/// 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 *zoom_in_, *zoom_out_, *zoom_fit_, *zoom_reset_;
|
||||||
|
QAction *configure_;
|
||||||
|
QAction *about_qt_, *about_qet_;
|
||||||
/// Location of the currently edited template
|
/// Location of the currently edited template
|
||||||
TitleBlockTemplateLocation location_;
|
TitleBlockTemplateLocation location_;
|
||||||
/// Filepath of the currently edited template, if opened from a file
|
/// Filepath of the currently edited template, if opened from a file
|
||||||
|
|||||||
@@ -231,6 +231,7 @@ void TitleBlockTemplateCellWidget::editLabelDisplayed() {
|
|||||||
void TitleBlockTemplateCellWidget::editLabel() {
|
void TitleBlockTemplateCellWidget::editLabel() {
|
||||||
if (!edited_cell_) return;
|
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());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -240,6 +241,7 @@ void TitleBlockTemplateCellWidget::editLabel() {
|
|||||||
void TitleBlockTemplateCellWidget::editValue() {
|
void TitleBlockTemplateCellWidget::editValue() {
|
||||||
if (!edited_cell_) return;
|
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());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -347,6 +349,7 @@ void TitleBlockTemplateCellWidget::editTranslatableValue(NamesList &names, const
|
|||||||
edit_dialog.setLayout(editor_layout);
|
edit_dialog.setLayout(editor_layout);
|
||||||
if (edit_dialog.exec() == QDialog::Accepted) {
|
if (edit_dialog.exec() == QDialog::Accepted) {
|
||||||
emitModification(attribute, qVariantFromValue(names_widget -> names()));
|
emitModification(attribute, qVariantFromValue(names_widget -> names()));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user