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

void QETDiagramEditor::slot_updateWindowsMenu (  )  [slot]

met a jour le menu "Fenetres"

Definition at line 1281 of file qetdiagrameditor.cpp.

References actions(), cascade_window, close_file, currentProject(), next_window, openedProjects(), prev_window, and tile_window.

Referenced by addProjectView(), menus(), QETDiagramEditor(), setTabbedMode(), and setWindowedMode().

                                              {
      // nettoyage du menu
      foreach(QAction *a, windows_menu -> actions()) windows_menu -> removeAction(a);
      
      // actions de fermeture
      windows_menu -> addAction(close_file);
      //windows_menu -> addAction(closeAllAct);
      
      // actions de reorganisation des fenetres
      windows_menu -> addSeparator();
      windows_menu -> addAction(tile_window);
      windows_menu -> addAction(cascade_window);
      
      // actions de deplacement entre les fenetres
      windows_menu -> addSeparator();
      windows_menu -> addAction(next_window);
      windows_menu -> addAction(prev_window);
      
      // liste des fenetres
      QList<ProjectView *> windows = openedProjects();
      
      tile_window    -> setEnabled(!windows.isEmpty() && workspace.viewMode() == QMdiArea::SubWindowView);
      cascade_window -> setEnabled(!windows.isEmpty() && workspace.viewMode() == QMdiArea::SubWindowView);
      next_window    -> setEnabled(windows.count() > 1);
      prev_window    -> setEnabled(windows.count() > 1);
      
      if (!windows.isEmpty()) windows_menu -> addSeparator();
      QActionGroup *windows_actions = new QActionGroup(this);
      foreach(ProjectView *project_view, windows) {
            QString pv_title = project_view -> windowTitle();
            QAction *action  = windows_menu -> addAction(pv_title);
            windows_actions -> addAction(action);
            action -> setStatusTip(QString(tr("Active le projet \253\240%1\240\273")).arg(pv_title));
            action -> setCheckable(true);
            action -> setChecked(project_view == currentProject());
            connect(action, SIGNAL(triggered()), &windowMapper, SLOT(map()));
            windowMapper.setMapping(action, project_view);
      }
}


Generated by  Doxygen 1.6.0   Back to index