[qet] [1460] Title block tempalte editor: added undo/redo menu entries.

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 1460
Author:   xavier
Date:     2012-01-15 01:33:03 +0100 (Sun, 15 Jan 2012)
Log Message:
-----------
Title block tempalte editor: added undo/redo menu entries.

Modified Paths:
--------------
    branches/0.3/sources/titleblock/qettemplateeditor.cpp
    branches/0.3/sources/titleblock/qettemplateeditor.h
    branches/0.3/sources/titleblock/templatecellwidget.cpp

Modified: branches/0.3/sources/titleblock/qettemplateeditor.cpp
===================================================================
--- branches/0.3/sources/titleblock/qettemplateeditor.cpp	2012-01-14 20:22:29 UTC (rev 1459)
+++ branches/0.3/sources/titleblock/qettemplateeditor.cpp	2012-01-15 00:33:03 UTC (rev 1460)
@@ -239,6 +239,8 @@
 	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 @@
 	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 @@
 	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_);
 	

Modified: branches/0.3/sources/titleblock/qettemplateeditor.h
===================================================================
--- branches/0.3/sources/titleblock/qettemplateeditor.h	2012-01-14 20:22:29 UTC (rev 1459)
+++ branches/0.3/sources/titleblock/qettemplateeditor.h	2012-01-15 00:33:03 UTC (rev 1460)
@@ -49,8 +49,11 @@
 	/// 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

Modified: branches/0.3/sources/titleblock/templatecellwidget.cpp
===================================================================
--- branches/0.3/sources/titleblock/templatecellwidget.cpp	2012-01-14 20:22:29 UTC (rev 1459)
+++ branches/0.3/sources/titleblock/templatecellwidget.cpp	2012-01-15 00:33:03 UTC (rev 1460)
@@ -231,6 +231,7 @@
 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::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 @@
 	edit_dialog.setLayout(editor_layout);
 	if (edit_dialog.exec() == QDialog::Accepted) {
 		emitModification(attribute, qVariantFromValue(names_widget -> names()));
+		
 	}
 }
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/