ATLAS Offline Software
Public Slots | Public Member Functions | Private Member Functions | Private Attributes | List of all members
VP1ExpertSettings Class Reference

#include <VP1ExpertSettings.h>

Inheritance diagram for VP1ExpertSettings:
Collaboration diagram for VP1ExpertSettings:

Public Slots

void setPluginPath (const QString &path)
 
void setFileSelectDir (const QString &path)
 
void setScreenshotDir (const QString &path)
 
void setAuthLog (const QString &path)
 

Public Member Functions

 VP1ExpertSettings (QWidget *parent=0)
 

Private Member Functions

bool checkBoxState ()
 
void closeEvent (QCloseEvent *event)
 
void keyPressEvent (QKeyEvent *event)
 
void setExpertSetting (const QString &type, const QString &name)
 

Private Attributes

QString m_pluginPath
 
QString m_fileSelectDir
 
QString m_screenshotDir
 
QString m_authLog
 
QDialogButtonBox * m_buttonBox
 
QTabWidget * m_tabWidget
 
QPushButton * m_okButton
 

Detailed Description

Definition at line 25 of file VP1ExpertSettings.h.

Constructor & Destructor Documentation

◆ VP1ExpertSettings()

VP1ExpertSettings::VP1ExpertSettings ( QWidget *  parent = 0)
explicit

Definition at line 43 of file VP1ExpertSettings.cxx.

43  : QDialog(parent)
44 {
45 
46  m_tabWidget = new QTabWidget;
47  GeneralTab *generalTab = new GeneralTab();
48  AdvancedTab *advancedTab = new AdvancedTab();
49  m_tabWidget->addTab(generalTab, tr("Settings"));
51 
52  #if defined BUILDVP1LIGHT
53  QString pluginPath=VP1QtUtils::expertSettingValue("expert","ExpertSettings/VP1PLUGINPATH");
54  QString fileSelectDir=VP1QtUtils::expertSettingValue("expert","ExpertSettings/VP1_FILESELECTDIR");
55  QString screenshotDir=VP1QtUtils::expertSettingValue("general","ExpertSettings/VP1_SCREENSHOTS_DIR");
56  QString authLog=VP1QtUtils::expertSettingValue("expert","ExpertSettings/VP1_AUTH_ENABLELOG");
57 
58  if(VP1QtUtils::expertSettingIsOn("general", "ExpertSettings/enableExpertSettings")){
59  m_tabWidget->addTab(advancedTab, tr("Advanced"));
63  }
64  #else
65  QString pluginPath=VP1QtUtils::environmentVariableValue("VP1PLUGINPATH");
66  QString fileSelectDir=VP1QtUtils::environmentVariableValue("VP1_FILESELECTDIR");
67  QString screenshotDir=VP1QtUtils::environmentVariableValue("VP1_SCREENSHOTS_DIR");
68  QString authLog=VP1QtUtils::environmentVariableValue("VP1_AUTH_ENABLELOG");
69 
70  // Always enable Advanced settings for VP1
71  m_tabWidget->addTab(advancedTab, tr("Advanced"));
75  #endif
76 
77  m_buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
78 
79  connect(m_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::close);
80  // connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
81 
82  QVBoxLayout *mainLayout = new QVBoxLayout;
83  mainLayout->addWidget(m_tabWidget);
84  mainLayout->addWidget(m_buttonBox);
85  setLayout(mainLayout);
86 
87  this->setWindowTitle(tr("VP1 Settings"));
88 
89 
90 }

Member Function Documentation

◆ checkBoxState()

bool VP1ExpertSettings::checkBoxState ( )
private

◆ closeEvent()

void VP1ExpertSettings::closeEvent ( QCloseEvent *  event)
private

Definition at line 92 of file VP1ExpertSettings.cxx.

93 {
94  //Update settings
95  #if defined BUILDVP1LIGHT
96  VP1Msg::enableMsg("general", "ExpertSettings/VP1_VERBOSE_OUTPUT");
97  VP1Msg::enableMsg("general", "ExpertSettings/VP1_DEBUG_OUTPUT");
98  #else
99  VP1Msg::enableMsg("VP1_VERBOSE_OUTPUT");
100  VP1Msg::enableMsg("VP1_DEBUG_OUTPUT");
101  #endif
102 
103  // if(QDir(pluginPath).exists()||pluginPath==""){
104  #if defined BUILDVP1LIGHT
105  VP1QtUtils::setExpertSetting("expert","ExpertSettings/VP1PLUGINPATH", m_pluginPath);
106  VP1QtUtils::setExpertSetting("expert","ExpertSettings/VP1_FILESELECTDIR", m_fileSelectDir);
107  VP1QtUtils::setExpertSetting("expert","ExpertSettings/VP1_AUTH_ENABLELOG", m_authLog);
108  VP1QtUtils::setExpertSetting("general","ExpertSettings/VP1_SCREENSHOTS_DIR", m_screenshotDir);
109  #else
112  VP1QtUtils::setEnvironmentVariable("VP1_AUTH_ENABLELOG", m_authLog);
113  VP1QtUtils::setEnvironmentVariable("VP1_SCREENSHOTS_DIR", m_screenshotDir);
114  #endif
115 
116  #if defined BUILDVP1LIGHT
117  QMessageBox msgBox;
118  QCheckBox *cb = new QCheckBox("Don't ask again.");
119  msgBox.setWindowTitle("Settings");
120  msgBox.setText("Some settings may require a restart of VP1.");
121  msgBox.setIcon(QMessageBox::Icon::Information);
122  msgBox.setCheckBox(cb);
123 
124  if(VP1QtUtils::expertSettingIsOn("general","Configuration/enableCloseSettingsReminder")){
125  cb->setChecked(true);
126  }
127  connect(cb, &QCheckBox::toggled, [this](){VP1ExpertSettings::setExpertSetting("general","Configuration/enableCloseSettingsReminder");});
128 
129  if(cb->checkState()==Qt::Unchecked){
130  msgBox.exec();
131  }
132 
133  event->accept();
134  #else
135  unused(event);
136  #endif
137 
138 
139 }

◆ keyPressEvent()

void VP1ExpertSettings::keyPressEvent ( QKeyEvent *  event)
private

Definition at line 141 of file VP1ExpertSettings.cxx.

141  {
142  if(event->key() == Qt::Key_Escape)
143  VP1ExpertSettings::close();
144 }

◆ setAuthLog

void VP1ExpertSettings::setAuthLog ( const QString &  path)
slot

Definition at line 158 of file VP1ExpertSettings.cxx.

158  {
159  m_authLog = path;
160 }

◆ setExpertSetting()

void VP1ExpertSettings::setExpertSetting ( const QString &  type,
const QString &  name 
)
private

Definition at line 162 of file VP1ExpertSettings.cxx.

162  {
165  } else {
167  }
168 }

◆ setFileSelectDir

void VP1ExpertSettings::setFileSelectDir ( const QString &  path)
slot

Definition at line 150 of file VP1ExpertSettings.cxx.

150  {
152 }

◆ setPluginPath

void VP1ExpertSettings::setPluginPath ( const QString &  path)
slot

Definition at line 146 of file VP1ExpertSettings.cxx.

146  {
147  m_pluginPath = path;
148 }

◆ setScreenshotDir

void VP1ExpertSettings::setScreenshotDir ( const QString &  path)
slot

Definition at line 154 of file VP1ExpertSettings.cxx.

154  {
156 }

Member Data Documentation

◆ m_authLog

QString VP1ExpertSettings::m_authLog
private

Definition at line 41 of file VP1ExpertSettings.h.

◆ m_buttonBox

QDialogButtonBox* VP1ExpertSettings::m_buttonBox
private

Definition at line 42 of file VP1ExpertSettings.h.

◆ m_fileSelectDir

QString VP1ExpertSettings::m_fileSelectDir
private

Definition at line 39 of file VP1ExpertSettings.h.

◆ m_okButton

QPushButton* VP1ExpertSettings::m_okButton
private

Definition at line 44 of file VP1ExpertSettings.h.

◆ m_pluginPath

QString VP1ExpertSettings::m_pluginPath
private

Definition at line 38 of file VP1ExpertSettings.h.

◆ m_screenshotDir

QString VP1ExpertSettings::m_screenshotDir
private

Definition at line 40 of file VP1ExpertSettings.h.

◆ m_tabWidget

QTabWidget* VP1ExpertSettings::m_tabWidget
private

Definition at line 43 of file VP1ExpertSettings.h.


The documentation for this class was generated from the following files:
VP1QtUtils::setEnvironmentVariable
static void setEnvironmentVariable(const QString &name, const QString &content)
Definition: VP1QtUtils.cxx:146
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
AdvancedTab::signalAuthLogChanged
void signalAuthLogChanged(const QString &path)
VP1ExpertSettings::m_authLog
QString m_authLog
Definition: VP1ExpertSettings.h:41
fillPileUpNoiseLumi.connect
string connect
Definition: fillPileUpNoiseLumi.py:70
VP1ExpertSettings::setScreenshotDir
void setScreenshotDir(const QString &path)
Definition: VP1ExpertSettings.cxx:154
VP1ExpertSettings::setFileSelectDir
void setFileSelectDir(const QString &path)
Definition: VP1ExpertSettings.cxx:150
VP1ExpertSettings::setExpertSetting
void setExpertSetting(const QString &type, const QString &name)
Definition: VP1ExpertSettings.cxx:162
VP1QtUtils::expertSettingValue
static QString expertSettingValue(const QString &type, const QString &name)
Definition: VP1QtUtils.cxx:43
VP1ExpertSettings::m_screenshotDir
QString m_screenshotDir
Definition: VP1ExpertSettings.h:40
VP1QtUtils::environmentVariableValue
static QString environmentVariableValue(const QString &name)
Definition: VP1QtUtils.cxx:117
VP1Msg::enableMsg
static void enableMsg(const QString &)
Definition: VP1Msg.cxx:198
VP1QtUtils::setExpertSetting
static void setExpertSetting(const QString &type, const QString &name, const QString &content)
Definition: VP1QtUtils.cxx:86
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
VP1ExpertSettings::m_tabWidget
QTabWidget * m_tabWidget
Definition: VP1ExpertSettings.h:43
test_pyathena.parent
parent
Definition: test_pyathena.py:15
VP1ExpertSettings::setAuthLog
void setAuthLog(const QString &path)
Definition: VP1ExpertSettings.cxx:158
AdvancedTab
Definition: VP1ExpertSettings.h:94
VP1ExpertSettings::m_pluginPath
QString m_pluginPath
Definition: VP1ExpertSettings.h:38
VP1QtUtils::expertSettingIsOn
static bool expertSettingIsOn(const QString &type, const QString &name)
Definition: VP1QtUtils.cxx:60
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
VP1ExpertSettings::m_buttonBox
QDialogButtonBox * m_buttonBox
Definition: VP1ExpertSettings.h:42
VP1ExpertSettings::setPluginPath
void setPluginPath(const QString &path)
Definition: VP1ExpertSettings.cxx:146
unused
void unused(Args &&...)
Definition: VP1ExpertSettings.cxx:39
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
GeneralTab
Definition: VP1ExpertSettings.h:58
VP1ExpertSettings::m_fileSelectDir
QString m_fileSelectDir
Definition: VP1ExpertSettings.h:39
GeneralTab::signalScreenshotDirChanged
void signalScreenshotDirChanged(const QString &path)
AdvancedTab::signalPluginPathChanged
void signalPluginPathChanged(const QString &path)
AdvancedTab::signalFileSelectDirChanged
void signalFileSelectDirChanged(const QString &path)