[qet] [834] Rapatriement dans la branche 0.3 des revisions 815 a 833. |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 834
Author: xavier
Date: 2010-01-03 20:51:02 +0100 (Sun, 03 Jan 2010)
Log Message:
-----------
Rapatriement dans la branche 0.3 des revisions 815 a 833.
Modified Paths:
--------------
branches/0.3/sources/conductor.h
branches/0.3/sources/diagramprintdialog.cpp
branches/0.3/sources/editor/qetelementeditor.cpp
branches/0.3/sources/projectview.cpp
Added Paths:
-----------
branches/0.3/man/files/es/
Modified: branches/0.3/sources/conductor.h
===================================================================
--- branches/0.3/sources/conductor.h 2010-01-03 19:45:33 UTC (rev 833)
+++ branches/0.3/sources/conductor.h 2010-01-03 19:51:02 UTC (rev 834)
@@ -123,7 +123,7 @@
static QBrush square_brush;
static bool pen_and_brush_initialized;
/// facteur de taille du carre de saisie du segment
- int segments_squares_scale_;
+ qreal segments_squares_scale_;
private:
void segmentsToPath();
Modified: branches/0.3/sources/diagramprintdialog.cpp
===================================================================
--- branches/0.3/sources/diagramprintdialog.cpp 2010-01-03 19:45:33 UTC (rev 833)
+++ branches/0.3/sources/diagramprintdialog.cpp 2010-01-03 19:51:02 UTC (rev 834)
@@ -320,6 +320,7 @@
if (!filepath.isEmpty()) {
if (!filepath.endsWith(extension)) filepath += extension;
+ filepath = QDir::toNativeSeparators(QDir::cleanPath(filepath));
filepath_field_ -> setText(filepath);
}
}
@@ -355,7 +356,7 @@
/**
Imprime un schema
@param diagram Schema a imprimer
- @param fit_page True pour adapter les schemas aux pages, false sinon
+ @param fit_page True pour adapter les schemas aux pages, false sinon
@param options Options de rendu a appliquer pour l'impression
@param qp QPainter a utiliser (deja initialise sur printer)
@param printer Imprimante a utiliser
@@ -372,6 +373,10 @@
saveReloadDiagramParameters(diagram, options, true);
+ // deselectionne tous les elements
+ QList<QGraphicsItem *> selected_elmts = diagram -> selectedItems();
+ foreach (QGraphicsItem *qgi, selected_elmts) qgi -> setSelected(false);
+
if (fit_page) {
// impression adaptee sur une seule page
diagram -> render(qp, QRectF(), diagramRect(diagram), Qt::KeepAspectRatio);
@@ -415,10 +420,7 @@
QVector<QRect> pages_to_print;
for (int i = 0 ; i < v_pages_count ; ++ i) {
for (int j = 0 ; j < h_pages_count ; ++ j) {
- //int page_number = (i * h_pages_count) + j + 1;
- //if (page_number >= first_page && page_number <= last_page) {
- pages_to_print << pages_grid.at(i).at(j);
- //}
+ pages_to_print << pages_grid.at(i).at(j);
}
}
//qDebug() << " " << pages_to_print.count() << " pages a imprimer :";
@@ -438,6 +440,10 @@
}
}
}
+
+ // restaure les elements selectionnes
+ foreach (QGraphicsItem *qgi, selected_elmts) qgi -> setSelected(true);
+
saveReloadDiagramParameters(diagram, options, false);
}
Modified: branches/0.3/sources/editor/qetelementeditor.cpp
===================================================================
--- branches/0.3/sources/editor/qetelementeditor.cpp 2010-01-03 19:45:33 UTC (rev 833)
+++ branches/0.3/sources/editor/qetelementeditor.cpp 2010-01-03 19:51:02 UTC (rev 834)
@@ -403,21 +403,41 @@
Met a jour les menus
*/
void QETElementEditor::slot_updateMenus() {
- bool selected_items = !ce_scene -> selectedItems().isEmpty();
- bool clipboard_elmt = ElementScene::clipboardMayContainElement();
+ bool selected_items = !read_only && !ce_scene -> selectedItems().isEmpty();
+ bool clipboard_elmt = !read_only && ElementScene::clipboardMayContainElement();
- deselectall -> setEnabled(selected_items);
- cut -> setEnabled(selected_items);
- copy -> setEnabled(selected_items);
- paste -> setEnabled(clipboard_elmt);
- paste_in_area -> setEnabled(clipboard_elmt);
- edit_delete -> setEnabled(selected_items);
- edit_forward -> setEnabled(selected_items);
- edit_raise -> setEnabled(selected_items);
- edit_lower -> setEnabled(selected_items);
- edit_backward -> setEnabled(selected_items);
- save -> setEnabled(!ce_scene -> undoStack().isClean());
+ // actions dependant seulement de l'etat "lecture seule" de l'editeur
+ foreach (QAction *action, parts -> actions()) {
+ action -> setEnabled(!read_only);
+ }
+ selectall -> setEnabled(!read_only);
+ inv_select -> setEnabled(!read_only);
+ paste_from_file -> setEnabled(!read_only);
+ paste_from_elmt -> setEnabled(!read_only);
+ edit_size_hs -> setEnabled(!read_only);
+ edit_names -> setEnabled(!read_only);
+ edit_ori -> setEnabled(!read_only);
+ parts_list -> setEnabled(!read_only);
+ // actions dependant de la presence de parties selectionnees
+ deselectall -> setEnabled(selected_items);
+ cut -> setEnabled(selected_items);
+ copy -> setEnabled(selected_items);
+ edit_delete -> setEnabled(selected_items);
+ edit_forward -> setEnabled(selected_items);
+ edit_raise -> setEnabled(selected_items);
+ edit_lower -> setEnabled(selected_items);
+ edit_backward -> setEnabled(selected_items);
+
+ // actions dependant du contenu du presse-papiers
+ paste -> setEnabled(clipboard_elmt);
+ paste_in_area -> setEnabled(clipboard_elmt);
+
+ // actions dependant de l'etat de la pile d'annulation
+ save -> setEnabled(!read_only && !ce_scene -> undoStack().isClean());
+ undo -> setEnabled(!read_only && ce_scene -> undoStack().canUndo());
+ redo -> setEnabled(!read_only && ce_scene -> undoStack().canRedo());
+
slot_updateFullScreenAction();
}
@@ -704,6 +724,8 @@
tr("Vous n'avez pas les privil\350ges n\351cessaires pour modifier cet \351lement. Il sera donc ouvert en lecture seule.", "message box content")
);
setReadOnly(true);
+ } else {
+ setReadOnly(false);
}
// memorise le fichier
@@ -775,26 +797,11 @@
*/
void QETElementEditor::setReadOnly(bool ro) {
read_only = ro;
- // active / desactive les actions
- foreach (QAction *action, parts -> actions()) action -> setEnabled(!ro);
// active / desactive les interactions avec la scene
ce_view -> setInteractive(!ro);
- // active / desactive l'edition de la taille, du hotspot, des noms et des orientations
- cut -> setEnabled(!ro);
- copy -> setEnabled(!ro);
- paste -> setEnabled(!ro);
- selectall -> setEnabled(!ro);
- deselectall -> setEnabled(!ro);
- inv_select -> setEnabled(!ro);
- undo -> setEnabled(!ro);
- redo -> setEnabled(!ro);
- edit_delete -> setEnabled(!ro);
- edit_size_hs -> setEnabled(!ro);
- edit_names -> setEnabled(!ro);
- edit_ori -> setEnabled(!ro);
- parts_list -> setEnabled(!ro);
+ slot_updateMenus();
}
/**
@@ -1236,6 +1243,8 @@
tr("Vous n'avez pas les privil\350ges n\351cessaires pour modifier cet \351lement. Il sera donc ouvert en lecture seule.", "message box content")
);
setReadOnly(true);
+ } else {
+ setReadOnly(false);
}
// memorise le fichier
Modified: branches/0.3/sources/projectview.cpp
===================================================================
--- branches/0.3/sources/projectview.cpp 2010-01-03 19:45:33 UTC (rev 833)
+++ branches/0.3/sources/projectview.cpp 2010-01-03 19:51:02 UTC (rev 834)
@@ -513,7 +513,7 @@
QString dir_path = project_ -> currentDir();
// determine un chemin pour le pdf / ps
- QString file_name = QDir::toNativeSeparators(dir_path + "/" + doc_name);
+ QString file_name = QDir::toNativeSeparators(QDir::cleanPath(dir_path + "/" + doc_name));
DiagramPrintDialog print_dialog(project_, this);
print_dialog.setDocName(doc_name);