[qet] [2445] Workaround to add cut copy remove actions in contextmenu for image |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 2445
Author: scorpio810
Date: 2013-08-22 17:08:12 +0200 (Thu, 22 Aug 2013)
Log Message:
-----------
Workaround to add cut copy remove actions in contextmenu for image
Modified Paths:
--------------
branches/0.4/sources/diagramview.cpp
branches/0.4/sources/qetdiagrameditor.cpp
Modified: branches/0.4/sources/diagramview.cpp
===================================================================
--- branches/0.4/sources/diagramview.cpp 2013-08-21 20:34:12 UTC (rev 2444)
+++ branches/0.4/sources/diagramview.cpp 2013-08-22 15:08:12 UTC (rev 2445)
@@ -641,7 +641,8 @@
foreach(QGraphicsItem *qgi, scene -> selectedItems()) {
if (
qgraphicsitem_cast<Element *>(qgi) ||
- qgraphicsitem_cast<IndependentTextItem *>(qgi)
+ qgraphicsitem_cast<IndependentTextItem *>(qgi) ||
+ qgraphicsitem_cast<DiagramImageItem *>(qgi)
) {
return(true);
}
Modified: branches/0.4/sources/qetdiagrameditor.cpp
===================================================================
--- branches/0.4/sources/qetdiagrameditor.cpp 2013-08-21 20:34:12 UTC (rev 2444)
+++ branches/0.4/sources/qetdiagrameditor.cpp 2013-08-22 15:08:12 UTC (rev 2445)
@@ -1197,8 +1197,8 @@
// actions ayant aussi besoin d'items (elements, conducteurs, textes, ...) selectionnes
bool copiable_items = dv ? (dv -> hasCopiableItems()) : false;
bool deletable_items = dv ? (dv -> hasDeletableItems()) : false;
- cut -> setEnabled(editable_diagram && copiable_items);
- copy -> setEnabled(copiable_items);
+ cut -> setEnabled(editable_diagram);
+ copy -> setEnabled(editable_diagram);
delete_selection -> setEnabled(editable_diagram && deletable_items);
rotate_selection -> setEnabled(editable_diagram && dv -> diagram() -> canRotateSelection());
selection_prop -> setEnabled(deletable_items);