Logo Search packages:      
Sourcecode: qelectrotech version File versions  Download package

void QETDiagramEditor::slot_updateComplexActions (  )  [slot]

gere les actions ayant des besoins precis pour etre active ou non Cette methode ne fait rien si aucun document n'est ouvert

Definition at line 1125 of file qetdiagrameditor.cpp.

References conductor_reset, copy, currentDiagram(), cut, delete_selection, rotate_selection, and selection_prop.

Referenced by diagramWasAdded(), and slot_updateActions().

                                                 {
      DiagramView *dv = currentDiagram();
      bool editable_diagram = (dv && !dv -> diagram() -> isReadOnly());
      
      // nombre de conducteurs selectionnes
      int selected_conductors_count = dv ? dv -> diagram() -> selectedConductors().count() : 0;
      conductor_reset  -> setEnabled(editable_diagram && selected_conductors_count);
      
      // actions ayant aussi besoin d'elements selectionnes
      bool selected_elements = dv ? (dv -> hasSelectedItems()) : false;
      cut              -> setEnabled(editable_diagram && selected_elements);
      copy             -> setEnabled(selected_elements);
      delete_selection -> setEnabled(editable_diagram && selected_elements);
      rotate_selection -> setEnabled(editable_diagram && selected_elements && dv -> diagram() -> canRotateSelection());
      selection_prop   -> setEnabled(editable_diagram && selected_elements);
}


Generated by  Doxygen 1.6.0   Back to index