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

void QETDiagramEditor::slot_updateActions (  )  [slot]

gere les actions

Definition at line 1068 of file qetdiagrameditor.cpp.

References add_column, add_row, add_text, close_file, conductor_default, currentDiagram(), currentProject(), export_diagram, import_diagram, infos_diagram, print, prj_add_diagram, prj_clean, prj_del_diagram, prj_edit_prop, redo, remove_column, remove_row, save_all, save_file, save_file_sous, select_all, select_invert, select_nothing, slot_updateComplexActions(), slot_updateFullScreenAction(), slot_updateModeActions(), slot_updatePasteAction(), undo, zoom_fit, zoom_in, zoom_out, and zoom_reset.

Referenced by addProjectView(), and QETDiagramEditor().

                                          {
      DiagramView *dv = currentDiagram();
      ProjectView *pv = currentProject();
      bool opened_project = pv;
      bool opened_diagram = dv;
      bool editable_project = (pv && !pv -> project() -> isReadOnly());
      bool editable_diagram = (dv && !dv -> diagram() -> isReadOnly());
      
      // actions ayant juste besoin d'un document ouvert
      close_file        -> setEnabled(opened_project);
      save_file         -> setEnabled(opened_project && editable_project);
      save_file_sous    -> setEnabled(opened_project);
      save_all          -> setEnabled(opened_diagram && editable_diagram);
      prj_edit_prop     -> setEnabled(editable_project);
      prj_add_diagram   -> setEnabled(editable_project);
      prj_del_diagram   -> setEnabled(editable_project);
      prj_clean         -> setEnabled(editable_project);
      import_diagram    -> setEnabled(editable_project);
      export_diagram    -> setEnabled(opened_diagram);
      print             -> setEnabled(opened_diagram);
      select_all        -> setEnabled(opened_diagram);
      select_nothing    -> setEnabled(opened_diagram);
      select_invert     -> setEnabled(opened_diagram);
      zoom_in           -> setEnabled(opened_diagram);
      zoom_out          -> setEnabled(opened_diagram);
      zoom_fit          -> setEnabled(opened_diagram);
      zoom_reset        -> setEnabled(opened_diagram);
      conductor_default -> setEnabled(editable_diagram);
      infos_diagram     -> setEnabled(editable_diagram);
      add_text          -> setEnabled(editable_diagram);
      add_column        -> setEnabled(editable_diagram);
      remove_column     -> setEnabled(editable_diagram);
      add_row           -> setEnabled(editable_diagram);
      remove_row        -> setEnabled(editable_diagram);
      
      // affiche les actions correspondant au diagram view en cours
      if (dv) {
            if (can_update_actions) {
                  undo_group.setActiveStack(&(dv -> diagram() -> undoStack()));
                  undo -> setEnabled(undo_group.canUndo());
                  redo -> setEnabled(undo_group.canRedo());
            }
      } else {
            undo -> setEnabled(false);
            redo -> setEnabled(false);
      }
      
      slot_updateFullScreenAction();
      slot_updateModeActions();
      slot_updatePasteAction();
      slot_updateComplexActions();
}


Generated by  Doxygen 1.6.0   Back to index