ATLAS Offline Software
Loading...
Searching...
No Matches
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}
void signalPluginPathChanged(const QString &path)
void signalAuthLogChanged(const QString &path)
void signalFileSelectDirChanged(const QString &path)
void signalScreenshotDirChanged(const QString &path)
QDialogButtonBox * m_buttonBox
void setScreenshotDir(const QString &path)
void setFileSelectDir(const QString &path)
QTabWidget * m_tabWidget
void setAuthLog(const QString &path)
void setPluginPath(const QString &path)
static QString expertSettingValue(const QString &type, const QString &name)
static QString environmentVariableValue(const QString &name)
static bool expertSettingIsOn(const QString &type, const QString &name)

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);
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}
void unused(Args &&...)
void setExpertSetting(const QString &type, const QString &name)
static void enableMsg(const QString &)
Definition VP1Msg.cxx:198
static void setExpertSetting(const QString &type, const QString &name, const QString &content)
static void setEnvironmentVariable(const QString &name, const QString &content)

◆ 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}
path
python interpreter configuration --------------------------------------—
Definition athena.py:128

◆ setExpertSetting()

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

Definition at line 162 of file VP1ExpertSettings.cxx.

162 {
163 if(!VP1QtUtils::expertSettingIsOn(type, name)){
164 VP1QtUtils::setExpertSetting(type, name, "1");
165 } else {
166 VP1QtUtils::setExpertSetting(type, name, "");
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 {
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.

42{};

◆ 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.

44{};

◆ 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.

43{};

The documentation for this class was generated from the following files: