bool getArgName(Tree t, Tree& id) { //return getDefNameProperty(t, id) || autoName(t, id) ; return autoName(t, id) ; }
//////////////////////////////////////////////////////////////////////////////// /// CChanceTreeView::setupToolBar /// /// @description This function initializes the toolbar that is used for the /// tree view. /// @pre None /// @post The tree view toolbar is initialized. /// /// @limitations None /// //////////////////////////////////////////////////////////////////////////////// void CChanceTreeView::setupToolBar() { QAction *tempAction; QLabel *tempLabel; QToolButton *tempButton; // Create toolbar. m_toolBar = new QToolBar( "Puzzle View", this ); tempAction = m_toolBar->addAction( QIcon(":/toggleminmaxheuristics.png"), "Toggle min/max heuristic values" ); tempAction->setCheckable( true ); tempAction->setChecked( true ); connect( tempAction, SIGNAL(toggled(bool)), m_graphView, SLOT(toggleMinMaxHeuristics(bool)) ); tempAction = m_toolBar->addAction( QIcon(":/togglechanceheuristics.png"), "Toggle chance heuristic values" ); tempAction->setCheckable( true ); tempAction->setChecked( true ); connect( tempAction, SIGNAL(toggled(bool)), m_graphView, SLOT(toggleChanceHeuristics(bool)) ); // "Reorient View" button tempAction = m_toolBar->addAction( QIcon(":/orient.png"), "Reorient view" ); connect( tempAction, SIGNAL(activated()), this, SLOT(switchOrientation()) ); // "Show Graph" toggle button tempAction = m_toolBar->addAction( QIcon(":/graph.png"), "Show Graph" ); tempAction->setCheckable( true ); tempAction->setChecked( true ); connect( tempAction, SIGNAL(toggled(bool)), m_graphView, SLOT(setShown(bool)) ); // "Show Trace" toggle button tempAction = m_toolBar->addAction(QIcon(":/trace.png"), "Show Trace" ); tempAction->setCheckable( true ); tempAction->setChecked( true ); connect( tempAction, SIGNAL(toggled(bool)), m_traceView, SLOT(setShown(bool)) ); m_toolBar->addSeparator(); // "Quick Edit Mode" toggle button m_quickEditAction = m_toolBar->addAction(QIcon(":/quickedit.png"), "Toggle Quick Edit Mode" ); m_quickEditAction->setCheckable( true ); m_quickEditAction->setChecked( false ); connect( m_quickEditAction, SIGNAL(toggled(bool)), m_graphView, SLOT(setQuickEdit(bool)) ); // "Generate Tree" button tempAction = m_toolBar->addAction(QIcon(":/graph.png"), "Generate Tree" ); connect( tempAction, SIGNAL(activated()), m_graphView, SLOT(generateTree()) ); // "Auto Name" button tempAction = m_toolBar->addAction(QIcon(":/autoname.png"), "Auto Name" ); connect( tempAction, SIGNAL(activated()), m_graphView, SLOT(autoName()) ); // "Auto Number" button tempAction = m_toolBar->addAction(QIcon(":/autonumber.png"), "Auto Number" ); connect( tempAction, SIGNAL(activated()), m_graphView, SLOT(autoNumber()) ); // "Auto Layout" button tempAction = m_toolBar->addAction(QIcon(":/autolayout.png"), "Auto Layout"); connect( tempAction, SIGNAL(activated()), m_graphView, SLOT(autoLayout()) ); m_toolBar->addSeparator(); m_toolBar->addSeparator(); // "AI Config Menu" button m_toolBar->addWidget(m_traceView->getAIConfigButton()); // AI Label tempLabel = m_traceView->getAILabel(); m_toolBar->addWidget( tempLabel ); // Depth spinbox tempLabel = new QLabel( m_toolBar ); tempLabel->setTextFormat(Qt::AutoText); tempLabel->setText( " Depth" ); m_toolBar->addWidget( tempLabel ); m_toolBar->addWidget( m_traceView->getDepthSelector() ); // QS Depth spinbox tempLabel = new QLabel( m_toolBar ); tempLabel->setText( " QS Depth" ); m_toolBar->addWidget( tempLabel ); m_toolBar->addWidget( m_traceView->getQSDepthSelector() ); // Lower Bound spinbox tempLabel = new QLabel( m_toolBar ); tempLabel->setText( " Lower Bound" ); m_toolBar->addWidget( tempLabel ); m_toolBar->addWidget( m_traceView->getLowerBoundSelector() ); // Upper Bound spinbox tempLabel = new QLabel( m_toolBar ); tempLabel->setText( " Upper Bound" ); m_toolBar->addWidget( tempLabel ); m_toolBar->addWidget( m_traceView->getUpperBoundSelector() ); // "Save Trace" button tempAction = m_toolBar->addAction(QIcon(":/latex.png"), "Save Trace"); connect( tempAction, SIGNAL(activated()), m_traceView, SLOT(saveTrace()) ); }