void ToolConfig::switchTo(const QString & tool, bool save /* = true */) { //KILE_DEBUG() << "==ToolConfig::switchTo(const QString & tool, bool save /* = true */)====================" << endl; //save config if (save) { writeConfig(); //update the config number QString cf = m_configWidget->m_cbConfig->currentText(); KileTool::setConfigName(m_current, cf, m_config); } m_current = tool; m_map.clear(); if (!m_manager->retrieveEntryMap(m_current, m_map, false, false)) kdWarning() << "no entrymap" << endl; updateConfiglist(); updateGeneral(); updateAdvanced(); //show GUI info m_configWidget->m_cbMenu->setCurrentText(KileTool::menuFor(m_current, m_config)); m_icon=KileTool::iconFor(m_current, m_config); if ( m_icon.isEmpty() ) m_configWidget->m_pshbIcon->setPixmap(QString::null); else m_configWidget->m_pshbIcon->setPixmap(SmallIcon(m_icon)); }
void ToolConfig::switchTo(const QString & tool, bool save /* = true */) { //KILE_DEBUG_MAIN << "==ToolConfig::switchTo(const QString & tool, bool save /* = true */)===================="; //save config if(save) { writeConfig(); //update the config number QString cf = m_configWidget->m_cbConfig->currentText(); KileTool::setConfigName(m_current, cf, m_config); } m_current = tool; m_map.clear(); if (!m_manager->retrieveEntryMap(m_current, m_map, false, false)) { qWarning() << "no entrymap"; } updateConfiglist(); updateGeneral(); updateAdvanced(); //show GUI info QString menu = KileTool::menuFor(m_current, m_config); int i = m_configWidget->m_cbMenu->findData(menu); if(i >= 0) { m_configWidget->m_cbMenu->setCurrentIndex(i); } else { m_configWidget->m_cbMenu->addItem(menu, QVariant(menu)); m_configWidget->m_cbMenu->setCurrentIndex(m_configWidget->m_cbMenu->count() - 1); } m_icon = KileTool::iconFor(m_current, m_config); if(m_icon.isEmpty()) { m_configWidget->m_pshbIcon->setIcon(QIcon::fromTheme(QString())); } else { m_configWidget->m_pshbIcon->setIcon(QIcon::fromTheme(m_icon)); } }
//-------------------- protected methods ----------------------------- void ControlPanel::controlChanged( int control_enum_value ){ switch ( control_enum_value ){ case LIGHTING_CHECKBOX: if( !lighting ) glDisable( GL_LIGHT0 ); else glEnable( GL_LIGHT0 ); break; case DRAWAXES_CHECKBOX: curScene->setDrawAxes( drawAxes ); break; case PREVSCENE_BUTTON: prevScene(); break; case NEXTSCENE_BUTTON: nextScene(); break; case QUIT_BUTTON: exit( 0 ); break; case SET_PROJECTION: if( which_projection == 0 ) world->at( curSceneIndex )->setParallelStatus( true ); else world->at( curSceneIndex )->setParallelStatus( false ); case LOOKAT: updateWorldWithSlider(); break; case PERSPECTIVE: world->at( curSceneIndex )->setPerspective( viewAngle, aspectRatio, near, far ); break; case SET_LOOKAT: setLookAtSliders( ); break; case SET_ADVANCED: setAdvancedSliders( ); break; case ADVANCED: updateAdvanced( ); break; case BOX_BUTTON: world->at( curSceneIndex )->addObject( new Box() ); world->at( curSceneIndex )->redraw(); break; case CLOWN_BUTTON: world->at( curSceneIndex )->addObject( new Clown() ); world->at( curSceneIndex )->redraw(); break; case DONUT_BUTTON: world->at( curSceneIndex )->addObject( new Donut() ); world->at( curSceneIndex )->redraw(); break; case EYE_BUTTON: world->at( curSceneIndex )->addObject( new Eye() ); world->at( curSceneIndex )->redraw(); break; case HAT_BUTTON: world->at( curSceneIndex )->addObject( new Hat() ); world->at( curSceneIndex )->redraw(); break; case HEAD_BUTTON: world->at( curSceneIndex )->addObject( new Head() ); world->at( curSceneIndex )->redraw(); break; case SNOWMAN_BUTTON: world->at( curSceneIndex )->addObject( new Snowman() ); world->at( curSceneIndex )->redraw(); break; case SPHERE_BUTTON: world->at( curSceneIndex )->addObject( new Sphere() ); world->at( curSceneIndex )->redraw(); break; } }