void viewStarGeometry( const Char_t *tag="y2011", const Char_t *addons="", const Char_t *TOP="HALL", const Char_t *NODE="CAVE_1" ) { cacheGeometry(tag, addons); // Load using TEveManager TEveManager::Create(); // Get the default viewe viewer = gEve->GetDefaultGLViewer(); // Default // Register geometry gEve -> RegisterGeometryAlias("Default", Form("%s.root",tag)); gGeoManager = gEve->GetDefaultGeometry(); // Get the specified top volume and node to draw TGeoNode *CAVE = gGeoManager->FindVolumeFast(TOP)->FindNode(NODE); TEveGeoTopNode *cave = new TEveGeoTopNode( gGeoManager, CAVE ); gEve -> AddGlobalElement(cave); // Draw the scene gEve->Redraw3D(kTRUE); if ( viewall ) { addDetectorTab( "TPCE_1", "TPC" ); addDetectorTab( "CALB_1", "BEMC" ); { addDetectorTab( "CPHI_1", "BEMC module", "CHLV" ); } addDetectorTab( "ECAL_1", "EEMC" ); addDetectorTab( "FBOX_1", "FPD" ); addDetectorTab( "FBO1_3", "FMS N" ); addDetectorTab( "FBO2_4", "FMS S" ); addDetectorTab( "IDSM_1", "IDSM" ); { addDetectorTab( "FGTM_1", "FGT", "IDSM" ); } addDetectorTab( "BBCM_1", "BBC" ); addDetectorTab( "MUTD_1", "MTD" ); addDetectorTab( "BTOF_1", "TOF", "CAVE", 10 ); { addDetectorTab("BTRA_1","TOF tray", "BSEC", 10); } addDetectorTab( "FTPC_1", "FTPC" ); addDetectorTab( "FTPC_1", "FTPC", "SVTT" ); addDetectorTab( "FTRO_1", "FTPC readout" ); addDetectorTab( "SVTT_1", "SVTT" ); addDetectorTab( "SCON_1", "SCON" ); addDetectorTab( "SCON_1", "SCON", "SVTT" ); addDetectorTab( "FSCE_1", "FSCE" ); addDetectorTab( "ETTV_1", "EIDD" ); addDetectorTab( "PIPE_1", "pipe" ); addDetectorTab( "MAGP_1", "magnet" ); }//viewall const Char_t *path = ".:./StarVMC/Geometry/macros/:$STAR/StarVMC/Geometry/macros/"; Char_t *file = gSystem->Which(path,"applyColorScheme.C",kReadPermission); // gROOT->ProcessLine(".L applyColorScheme.C+"); // gROOT->ProcessLine(Form(".L %s+",file)); gSystem->CompileMacro( file, "k-", "libApplyColorScheme", "/tmp" ); applyColorScheme("CAVE"); }
void updateKdeGlobals() { Kdelibs4Migration migration; //Apply the color scheme KConfig config(migration.saveLocation("config") + "kdeglobals"); KSharedConfig::Ptr kf5Config = KSharedConfig::openConfig("kdeglobals"); KConfigGroup kf5Group(kf5Config, "General"); KConfigGroup kf52Group(kf5Config, "KDE"); const QString looknfeel = kf52Group.readEntry("LookAndFeelPackage", defaultLookAndFeelPackage); KSharedConfigPtr lnfConfig; KSharedConfigPtr defaultLnfConfig = KSharedConfig::openConfig(QStandardPaths::locate(QStandardPaths::GenericDataLocation, "plasma/look-and-feel/" + defaultLookAndFeelPackage + "/contents/defaults")); if (looknfeel != defaultLookAndFeelPackage) { lnfConfig = KSharedConfig::openConfig(QStandardPaths::locate(QStandardPaths::GenericDataLocation, "plasma/look-and-feel/" + looknfeel + "/contents/defaults")); } const QString widgetStyle = readConfigValue(lnfConfig, defaultLnfConfig, "KDE", "widgetStyle", "Menda").toString(); const QString colorScheme = readConfigValue(lnfConfig, defaultLnfConfig, "General", "ColorScheme", "Menda").toString(); const QString icons = readConfigValue(lnfConfig, defaultLnfConfig, "Icons", "Theme", "menda").toString(); cloneColorScheme(colorScheme); //use only if the style from the look and feel package is installed const bool hasWidgetStyle = QStyleFactory::keys().contains(widgetStyle); KConfigGroup group(&config, "General"); group.writeEntry("ColorScheme", colorScheme); qDebug() << "setting widget style:" << widgetStyle << hasWidgetStyle; if (hasWidgetStyle) { group.writeEntry("widgetStyle", widgetStyle); //for some reason this seems necessary group.sync(); } applyColorScheme(colorScheme, &config); group.sync(); KConfigGroup iconGroup(&config, "Icons"); iconGroup.writeEntry("Theme", icons); applyColorScheme(colorScheme, &config); iconGroup.sync(); kf5Group.writeEntry("ColorScheme", colorScheme); kf5Group.sync(); if (hasWidgetStyle) { kf5Group.writeEntry("widgetStyle", widgetStyle); } applyColorScheme(colorScheme, kf5Group.config()); kf5Group.sync(); kf52Group.writeEntry("ColorScheme", colorScheme); if (hasWidgetStyle) { kf52Group.writeEntry("widgetStyle", widgetStyle); } applyColorScheme(colorScheme, kf52Group.config()); kf52Group.sync(); KConfigGroup kf5IconGroup(kf5Config, "Icons"); kf5IconGroup.writeEntry("Theme", icons); kf5IconGroup.sync(); }