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

void DCGuiApp::windowMenuAboutToShow (  )  [private, slot]

gets called when the window menu is activated; recreates the window menu with all opened window titles.

Definition at line 1699 of file dcgui.cpp.

References pWindowMenu, pWorkspace, windowAction, windowCascade, windowCloseChats, windowCloseHubs, windowMenuActivated(), windowMinimize, windowTile, and windowTileHor.

Referenced by initMenuBar().

{
      int c;

      pWindowMenu->clear();
      windowCascade->addTo(pWindowMenu);
      windowTile->addTo(pWindowMenu);
      windowTileHor->addTo(pWindowMenu);
      windowMinimize->addTo(pWindowMenu);
      windowCloseChats->addTo(pWindowMenu);
      windowCloseHubs->addTo(pWindowMenu);

      if ( pWorkspace->windowList().isEmpty() )
      {
            windowAction->setEnabled(false);
      }
      else
      {
            windowAction->setEnabled(true);
      }

      pWindowMenu->insertSeparator();

      QWidgetList windows = pWorkspace->windowList();

      c = 0;

      for ( int i = 0; i < int(windows.count()); ++i )
      {
            if ( windows.at(i)->isEnabled() )
            {
                  int id = pWindowMenu->insertItem(QString("&%1 ").arg(c+1)+windows.at(i)->caption(), this, SLOT( windowMenuActivated( int ) ) );
                  pWindowMenu->setItemParameter( id, i );
                  pWindowMenu->setItemChecked( id, pWorkspace->activeWindow() == windows.at(i) );
                  c++;
            }
      }

      if ( c == 0 )
      {
            windowAction->setEnabled(false);
      }
}


Generated by  Doxygen 1.6.0   Back to index