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

void QC_ApplicationWindow::initActions (  ) 

Initializes all QActions of the application.

Definition at line 283 of file qc_applicationwindow.cpp.

References actionHandler, QG_ActionFactory::createAction(), fileToolBar, optionWidget, slotFocusCommandLine(), slotHelpAbout(), slotHelpManual(), slotTestDrawFreehand(), slotTestDumpEntities(), slotTestInsertBlock(), slotTestInsertEllipse(), slotTestInsertImage(), slotTestInsertText(), slotTestMath01(), slotTestResize1024(), slotTestResize640(), slotTestResize800(), slotTestUnicode(), and slotTestUpdateInserts().

Referenced by QC_ApplicationWindow().

                                       {
    RS_DEBUG->print("QC_ApplicationWindow::initActions()");

    QG_ActionFactory actionFactory(actionHandler, this);
    QAction* action;
    QPopupMenu* menu;
    QToolBar* tb;
    QPopupMenu* subMenu;


    // File actions:
    //
    menu = new QPopupMenu(this);
    tb = fileToolBar;
    tb->setCaption("File");
#if QT_VERSION>=0x030000

    tb->setCloseMode(QDockWindow::Undocked);
#endif

    action = actionFactory.createAction(RS2::ActionFileNew, this);
    action->addTo(menu);
    action->addTo(tb);
    action = actionFactory.createAction(RS2::ActionFileOpen, this);
    action->addTo(menu);
    action->addTo(tb);
    action = actionFactory.createAction(RS2::ActionFileSave, this);
    action->addTo(menu);
    action->addTo(tb);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionFileSaveAs, this);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionFileExport, this);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menu->insertSeparator();
    action = actionFactory.createAction(RS2::ActionFileClose, this);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menu->insertSeparator();
    action = actionFactory.createAction(RS2::ActionFilePrint, this);
    action->addTo(menu);
    action->addTo(tb);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionFilePrintPreview, this);
    action->addTo(menu);
    action->addTo(tb);
    connect(this, SIGNAL(printPreviewChanged(bool)), action, SLOT(setOn(bool)));
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menu->insertSeparator();
    action = actionFactory.createAction(RS2::ActionFileQuit, this);
    action->addTo(menu);
    menu->insertSeparator();
    menuBar()->insertItem(tr("&File"), menu);
    //addToolBar(tb, tr("File"));
    addDockWindow(tb, tr("File"), DockTop);
    fileMenu = menu;

    // Editing actions:
    //
    menu=new QPopupMenu(this);
    tb = editToolBar;
    tb->setCaption("Edit");
#if QT_VERSION>=0x030000

    tb->setCloseMode(QDockWindow::Undocked);
#endif

    action = actionFactory.createAction(RS2::ActionEditUndo, actionHandler);
    action->addTo(menu);
    action->addTo(tb);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionEditRedo, actionHandler);
    action->addTo(menu);
    action->addTo(tb);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));

    tb->addSeparator();
    menu->insertSeparator();

    action = actionFactory.createAction(RS2::ActionEditCut, actionHandler);
    action->addTo(menu);
    action->addTo(tb);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionEditCopy, actionHandler);
    action->addTo(menu);
    action->addTo(tb);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionEditPaste, actionHandler);
    action->addTo(menu);
    action->addTo(tb);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));

    menu->insertSeparator();

    action = actionFactory.createAction(RS2::ActionOptionsGeneral, this);
    action->addTo(menu);
    action = actionFactory.createAction(RS2::ActionOptionsDrawing, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));

    menuBar()->insertItem(tr("&Edit"), menu);
    //addToolBar(tb, tr("Edit"));
    addDockWindow(tb, tr("Edit"), DockTop);

    // Options menu:
    //
    //menu = new QPopupMenu(this);
    //menuBar()->insertItem(tr("&Options"), menu);

    // Viewing / Zooming actions:
    //
    menu = new QPopupMenu(this);
    menu->setCheckable(true);
    tb = zoomToolBar;
    tb->setCaption("View");
#if QT_VERSION>=0x030000

    tb->setCloseMode(QDockWindow::Undocked);
#endif

    action = actionFactory.createAction(RS2::ActionViewGrid, this);
    action->addTo(menu);
    action->addTo(tb);
    action->setOn(true);
    connect(this, SIGNAL(gridChanged(bool)), action, SLOT(setOn(bool)));
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));

    RS_SETTINGS->beginGroup("/Appearance");
    bool draftMode = (bool)RS_SETTINGS->readNumEntry("/DraftMode", 0);
    RS_SETTINGS->endGroup();

    action = actionFactory.createAction(RS2::ActionViewDraft, this);
    action->addTo(menu);
    action->addTo(tb);
    action->setOn(draftMode);
    connect(this, SIGNAL(draftChanged(bool)), action, SLOT(setOn(bool)));
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));

    /*
       action = actionFactory.createAction(RS2::ActionViewLayerList, this);
       action->addTo(menu);
       action->setOn(true);
       action = actionFactory.createAction(RS2::ActionViewBlockList, this);
       action->addTo(menu);
       action->setOn(true);
       action = actionFactory.createAction(RS2::ActionViewOptionToolbar, this);
       action->addTo(menu);
       action->setOn(true);
       action = actionFactory.createAction(RS2::ActionViewCommandLine, this);
       action->addTo(menu);
       action->setOn(true);*/

    /*
    action = new QAction(tr("Back"),
                        tr("&Back"), Key_Escape, this);
       connect(action, SIGNAL(activated()),
               this, SLOT(slotBack()));
       action->addTo(menu);
    */


    action = actionFactory.createAction(RS2::ActionZoomRedraw, actionHandler);
    action->addTo(menu);
    action->addTo(tb);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionZoomIn, actionHandler);
    action->addTo(menu);
    action->addTo(tb);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionZoomOut, actionHandler);
    action->addTo(menu);
    action->addTo(tb);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionZoomAuto, actionHandler);
    action->addTo(menu);
    action->addTo(tb);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionZoomPrevious, actionHandler);
    action->addTo(menu);
    action->addTo(tb);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionZoomWindow, actionHandler);
    action->addTo(menu);
    action->addTo(tb);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionZoomPan, actionHandler);
    action->addTo(menu);
    action->addTo(tb);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));

    menu->insertSeparator();

    action = actionFactory.createAction(RS2::ActionViewStatusBar, this);
    action->addTo(menu);
    action->setOn(true);

    menu->insertItem(tr("Vie&ws"), createDockWindowMenu(NoToolBars));
    menu->insertItem(tr("Tool&bars"), createDockWindowMenu(OnlyToolBars));

    action = new QAction(tr("Focus on Command Line"), QPixmap::fromMimeSource("editclear.png"),
                         tr("Focus on &Command Line"), Key_Space, this);
    connect(action, SIGNAL(activated()),
            this, SLOT(slotFocusCommandLine()));
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menuBar()->insertItem(tr("&View"), menu);
    //addToolBar(tb, tr("View"));
    addDockWindow(tb, tr("View"), DockTop);

    // Selecting actions:
    //
    menu=new QPopupMenu(this);
    action = actionFactory.createAction(RS2::ActionDeselectAll, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionSelectAll, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionSelectSingle, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionSelectContour, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDeselectWindow, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionSelectWindow, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionSelectInvert, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionSelectIntersected,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDeselectIntersected,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionSelectLayer, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menuBar()->insertItem(tr("&Select"), menu);

    // Drawing actions:
    //
    menu=new QPopupMenu(this);

    // Points:
    subMenu=new QPopupMenu(this);
    action = actionFactory.createAction(RS2::ActionDrawPoint, actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menu->insertItem(tr("&Point"), subMenu);

    // Lines:
    subMenu=new QPopupMenu(this);
    action = actionFactory.createAction(RS2::ActionDrawLine,
                                        actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawLineAngle,
                                        actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawLineHorizontal,
                                        actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawLineVertical,
                                        actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawLineRectangle,
                                        actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawLineParallel,
                                        actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawLineParallelThrough,
                                        actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawLineBisector,
                                        actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawLineTangent1,
                                        actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawLineTangent2,
                                        actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawLineOrthogonal,
                                        actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawLineRelAngle,
                                        actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawLineFree,
                                        actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    //action = actionFactory.createAction(RS2::ActionDrawLineHorVert,
    //                                    actionHandler);
    //action->addTo(subMenu);
    action = actionFactory.createAction(RS2::ActionDrawLinePolygon,
                                        actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawLinePolygon2,
                                        actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawLinePolyline,
                                        actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menu->insertItem(tr("&Line"), subMenu);

    // Arcs:
    subMenu=new QPopupMenu(this);
    action = actionFactory.createAction(RS2::ActionDrawArc, actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawArc3P, actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawArcParallel, actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menu->insertItem(tr("&Arc"), subMenu);
    // Circles:
    subMenu=new QPopupMenu(this);
    action = actionFactory.createAction(RS2::ActionDrawCircle, actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawCircleCR, actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawCircle2P, actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawCircle3P, actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawCircleParallel, actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menu->insertItem(tr("&Circle"), subMenu);
      
    // Ellipses:
    subMenu=new QPopupMenu(this);
    action = actionFactory.createAction(RS2::ActionDrawEllipseAxis,
                                        actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDrawEllipseArcAxis,
                                        actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menu->insertItem(tr("&Ellipse"), subMenu);

    // Splines:
    subMenu=new QPopupMenu(this);
    action = actionFactory.createAction(RS2::ActionDrawSpline, actionHandler);
    action->addTo(subMenu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menu->insertItem(tr("&Spline"), subMenu);
      
    // Text:
    action = actionFactory.createAction(RS2::ActionDrawText,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    // Hatch:
    action = actionFactory.createAction(RS2::ActionDrawHatch,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    // Image:
    action = actionFactory.createAction(RS2::ActionDrawImage,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menuBar()->insertItem(tr("&Draw"), menu);

    // Dimensioning actions:
    //
#ifdef __APPLE__

    QPopupMenu* m = menu;
#endif

    menu=new QPopupMenu(this);
    action = actionFactory.createAction(RS2::ActionDimAligned, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDimLinear, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDimLinearHor, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDimLinearVer, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDimRadial, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDimDiametric, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDimAngular, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionDimLeader, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
#ifdef __APPLE__

    m->insertItem(tr("&Dimension"), menu);
#else

    menuBar()->insertItem(tr("&Dimension"), menu);
#endif

    // Modifying actions:
    //
    menu=new QPopupMenu(this);
    action = actionFactory.createAction(RS2::ActionModifyMove,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionModifyRotate,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionModifyScale,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionModifyMirror,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionModifyMoveRotate,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionModifyRotate2,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionModifyTrim,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionModifyTrim2,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionModifyTrimAmount,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionModifyBevel,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionModifyRound,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionModifyCut,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionModifyStretch,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionModifyEntity,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionModifyAttributes,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionModifyDelete,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionModifyDeleteQuick,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionModifyExplodeText,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    //action = actionFactory.createAction(RS2::ActionModifyDeleteFree,
    //                                    actionHandler);
    //action->addTo(menu);
    action = actionFactory.createAction(RS2::ActionBlocksExplode, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menuBar()->insertItem(tr("&Modify"), menu);

    // Snapping actions:
    //
    menu=new QPopupMenu(this);
    action = actionFactory.createAction(RS2::ActionSnapFree, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action->setOn(true);
    action = actionFactory.createAction(RS2::ActionSnapGrid, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionSnapEndpoint,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionSnapOnEntity,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionSnapCenter, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionSnapMiddle, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionSnapDist, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionSnapIntersection,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionSnapIntersectionManual,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menu->insertSeparator();
    action = actionFactory.createAction(RS2::ActionRestrictNothing,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionRestrictOrthogonal,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionRestrictHorizontal,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionRestrictVertical,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menu->insertSeparator();
    action = actionFactory.createAction(RS2::ActionSetRelativeZero,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionLockRelativeZero,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menuBar()->insertItem(tr("&Snap"), menu);

    // Info actions:
    //
    menu=new QPopupMenu(this);
    //action = actionFactory.createAction(RS2::ActionInfoInside,
    //                                    actionHandler);
    //action->addTo(menu);
    action = actionFactory.createAction(RS2::ActionInfoDist,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionInfoDist2,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionInfoAngle,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionInfoTotalLength,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menuBar()->insertItem(tr("&Info"), menu);

    // Layer actions:
    //
    menu=new QPopupMenu(this);
    action = actionFactory.createAction(RS2::ActionLayersDefreezeAll,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionLayersFreezeAll,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionLayersAdd, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionLayersRemove,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionLayersEdit, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionLayersToggleView,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menuBar()->insertItem(tr("&Layer"), menu);

    // Block actions:
    //
    menu=new QPopupMenu(this);
    action = actionFactory.createAction(RS2::ActionBlocksDefreezeAll,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionBlocksFreezeAll,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionBlocksAdd, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionBlocksRemove, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionBlocksAttributes,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionBlocksInsert,
                                        actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionBlocksEdit, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionBlocksCreate, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionBlocksExplode, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menuBar()->insertItem(tr("&Block"), menu);


    addDockWindow(penToolBar, tr("Pen"), DockTop);
    addDockWindow(optionWidget, tr("Tool Options"), DockTop, true);

#ifdef RS_QSA_SCRIPTING
    // Scripts menu:
    //
    scriptMenu = new QPopupMenu(this);
    scriptOpenIDE = actionFactory.createAction(RS2::ActionScriptOpenIDE, this);
    scriptOpenIDE->addTo(scriptMenu);
    scriptRun = actionFactory.createAction(RS2::ActionScriptRun, this);
    scriptRun->addTo(scriptMenu);
#else
    scriptMenu = 0;
    scriptOpenIDE = 0;
    scriptRun = 0;
#endif

    // CAM menu:
#ifdef RS_CAM

    menu=new QPopupMenu(this);
    action = actionFactory.createAction(RS2::ActionCamExportAuto, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    action = actionFactory.createAction(RS2::ActionCamReorder, actionHandler);
    action->addTo(menu);
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
    menuBar()->insertItem(tr("&CAM"), menu);
#endif

    // Help menu:
    //
    helpAboutApp = new QAction(tr("About"), 
        QPixmap::fromMimeSource(QC_APP_ICON16), 
      tr("&About %1").arg(QC_APPNAME), 0, this);
    helpAboutApp->setStatusTip(tr("About the application"));
    //helpAboutApp->setWhatsThis(tr("About\n\nAbout the application"));
    connect(helpAboutApp, SIGNAL(activated()),
            this, SLOT(slotHelpAbout()));

    helpManual = new QAction(QPixmap::fromMimeSource("contents.png"), tr("&Manual"), Key_F1, this);
    helpManual->setStatusTip(tr("Launch the online manual"));
    connect(helpManual, SIGNAL(activated()),
            this, SLOT(slotHelpManual()));

    testDumpEntities = new QAction("Dump Entities",
                                   "Dump &Entities", 0, this);
    connect(testDumpEntities, SIGNAL(activated()),
            this, SLOT(slotTestDumpEntities()));

    testUpdateInserts = new QAction("Update Inserts",
                                    "&Update Inserts", 0, this);
    connect(testUpdateInserts, SIGNAL(activated()),
            this, SLOT(slotTestUpdateInserts()));

    testDrawFreehand = new QAction("Draw Freehand",
                                   "Draw Freehand", 0, this);
    connect(testDrawFreehand, SIGNAL(activated()),
            this, SLOT(slotTestDrawFreehand()));

    testInsertBlock = new QAction("Insert Block",
                                  "Insert Block", 0, this);
    connect(testInsertBlock, SIGNAL(activated()),
            this, SLOT(slotTestInsertBlock()));

    testInsertText = new QAction("Insert Text",
                                 "Insert Text", 0, this);
    connect(testInsertText, SIGNAL(activated()),
            this, SLOT(slotTestInsertText()));

    testInsertImage = new QAction("Insert Image",
                                  "Insert Image", 0, this);
    connect(testInsertImage, SIGNAL(activated()),
            this, SLOT(slotTestInsertImage()));

    testUnicode = new QAction("Unicode",
                              "Unicode", 0, this);
    connect(testUnicode, SIGNAL(activated()),
            this, SLOT(slotTestUnicode()));

    testInsertEllipse = new QAction("Insert Ellipse",
                                    "Insert Ellipse", 0, this);
    connect(testInsertEllipse, SIGNAL(activated()),
            this, SLOT(slotTestInsertEllipse()));

    testMath01 = new QAction("Math01",
                             "Math01", 0, this);
    connect(testMath01, SIGNAL(activated()),
            this, SLOT(slotTestMath01()));

    testResize640 = new QAction("Resize to 640x480",
                                "Resize 1", 0, this);
    connect(testResize640, SIGNAL(activated()),
            this, SLOT(slotTestResize640()));

    testResize800 = new QAction("Resize to 800x600",
                                "Resize 2", 0, this);
    connect(testResize800, SIGNAL(activated()),
            this, SLOT(slotTestResize800()));

    testResize1024 = new QAction("Resize to 1024x768",
                                 "Resize 3", 0, this);
    connect(testResize1024, SIGNAL(activated()),
            this, SLOT(slotTestResize1024()));

}


Generated by  Doxygen 1.6.0   Back to index