ATLAS Offline Software
Loading...
Searching...
No Matches
GeneralTab Class Reference

#include <VP1ExpertSettings.h>

Inheritance diagram for GeneralTab:
Collaboration diagram for GeneralTab:

Signals

void signalScreenshotDirChanged (const QString &path)

Public Member Functions

 GeneralTab (QWidget *parent=0)

Private Slots

void setExpertSetting (const QString &name)
void on_browseButton1_clicked ()
void slotScreenshotDirChanged (const QString &path)

Private Attributes

QCheckBox * m_checkboxVerbose
QCheckBox * m_checkboxDebug
QCheckBox * m_checkboxDisallowMultipleChannels
QCheckBox * m_checkboxDisplayMouseClicks
QCheckBox * m_checkboxEnableAskOnClose
QCheckBox * m_checkboxGuidesSphereInsteadOfCoordaxes
QCheckBox * m_checkboxAntiAliasing
QPushButton * m_browseButton1
QLineEdit * m_lineEdit1

Detailed Description

Definition at line 57 of file VP1ExpertSettings.h.

Constructor & Destructor Documentation

◆ GeneralTab()

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

Definition at line 170 of file VP1ExpertSettings.cxx.

171 : QWidget(parent)
172{
173
174 QGroupBox *generalGroup = new QGroupBox(tr("General settings"));
175
176 m_checkboxVerbose = new QCheckBox("&Verbose output", this);
177 m_checkboxVerbose->setToolTip( QApplication::translate(__FUNCTION__, " <html>\n"
178 " <div style=\"width: 300px;\">Enable A LOT more verbose output to stdout from VP1. It is very useful if you run with this before sending us logfiles for bug reports.</div>"
179 " </html>", 0
180 ));
181 #if defined BUILDVP1LIGHT
182 if(VP1QtUtils::expertSettingIsOn("general","ExpertSettings/VP1_VERBOSE_OUTPUT")){
183 m_checkboxVerbose->setChecked(true);
184 }
185 connect(m_checkboxVerbose, &QCheckBox::toggled, [this](){GeneralTab::setExpertSetting("general","ExpertSettings/VP1_VERBOSE_OUTPUT");});
186 #else
187 if(VP1QtUtils::environmentVariableIsOn("VP1_VERBOSE_OUTPUT")){
188 m_checkboxVerbose->setChecked(true);
189 }
190 connect(m_checkboxVerbose, &QCheckBox::toggled, [this](){GeneralTab::setExpertSetting("VP1_VERBOSE_OUTPUT");});
191 #endif
192
193 m_checkboxDebug = new QCheckBox("&Debug output", this);
194 m_checkboxDebug->setToolTip( QApplication::translate(__FUNCTION__, " <html>\n"
195 " <div style=\"width: 300px;\">Enable A LOT more debug output to stdout from VP1. It is very useful if you run with this before sending us logfiles for bug reports.</div>"
196 " </html>", 0
197 ));
198 #if defined BUILDVP1LIGHT
199 if(VP1QtUtils::expertSettingIsOn("general","ExpertSettings/VP1_DEBUG_OUTPUT")){
200 m_checkboxDebug->setChecked(true);
201 }
202 connect(m_checkboxDebug, &QCheckBox::toggled, [this](){GeneralTab::setExpertSetting("general","ExpertSettings/VP1_DEBUG_OUTPUT");});
203 #else
204 if(VP1QtUtils::environmentVariableIsOn("VP1_DEBUG_OUTPUT")){
205 m_checkboxDebug->setChecked(true);
206 }
207 connect(m_checkboxDebug, &QCheckBox::toggled, [this](){GeneralTab::setExpertSetting("VP1_DEBUG_OUTPUT");});
208 #endif
209
210 m_checkboxDisallowMultipleChannels = new QCheckBox("D&isallow multiple channels", this);
211 m_checkboxDisallowMultipleChannels->setToolTip( QApplication::translate(__FUNCTION__, " <html>\n"
212 " <div style=\"width: 300px;\">This variable exists to help users whose graphics drivers are broken in such a way as to make VP1 crash when showing multiple 3D widgets. Setting this variable will thus ensure that the user can only ever open one channel, and it will remove the little 3D preview window normally shown when editing a material.</div>"
213 " </html>", 0
214 ));
215 #if defined BUILDVP1LIGHT
216 if(VP1QtUtils::expertSettingIsOn("general","ExpertSettings/VP1_DISALLOW_MULTIPLE_CHANNELS")){
217 m_checkboxDisallowMultipleChannels->setChecked(true);
218 }
219 connect(m_checkboxDisallowMultipleChannels, &QCheckBox::toggled, [this](){GeneralTab::setExpertSetting("general","ExpertSettings/VP1_DISALLOW_MULTIPLE_CHANNELS");});
220 #else
221 if(VP1QtUtils::environmentVariableIsOn("VP1_DISALLOW_MULTIPLE_CHANNELS")){
222 m_checkboxDisallowMultipleChannels->setChecked(true);
223 }
224 connect(m_checkboxDisallowMultipleChannels, &QCheckBox::toggled, [this](){GeneralTab::setExpertSetting("VP1_DISALLOW_MULTIPLE_CHANNELS");});
225 #endif
226
227 m_checkboxDisplayMouseClicks = new QCheckBox("Dis&play mouse clicks", this);
228 m_checkboxDisplayMouseClicks->setToolTip( QApplication::translate(__FUNCTION__, " <html>\n"
229 " <div style=\"width: 300px;\">Makes a small popup window appear whenever the user clicks a mouse-button in VP1. Basically this feature exists since it is used when producing the movies (screencasts) on this webpage.</div>"
230 " </html>", 0
231 ));
232 #if defined BUILDVP1LIGHT
233 if(VP1QtUtils::expertSettingIsOn("general","ExpertSettings/VP1_DISPLAY_MOUSE_CLICKS")){
234 m_checkboxDisplayMouseClicks->setChecked(true);
235 }
236 connect(m_checkboxDisplayMouseClicks, &QCheckBox::toggled, [this](){GeneralTab::setExpertSetting("general","ExpertSettings/VP1_DISPLAY_MOUSE_CLICKS");});
237 #else
238 if(VP1QtUtils::environmentVariableIsOn("VP1_DISPLAY_MOUSE_CLICKS")){
239 m_checkboxDisplayMouseClicks->setChecked(true);
240 }
241 connect(m_checkboxDisplayMouseClicks, &QCheckBox::toggled, [this](){GeneralTab::setExpertSetting("VP1_DISPLAY_MOUSE_CLICKS");});
242 #endif
243
244 m_checkboxEnableAskOnClose = new QCheckBox("&Ask on close", this);
245 m_checkboxEnableAskOnClose->setToolTip( QApplication::translate(__FUNCTION__, " <html>\n"
246 " <div style=\"width: 300px;\">By default, closing the VP1 window immediately results in the job being finished. Setting this variable will instead make VP1 ask the user if it should really close.</div>"
247 " </html>", 0
248 ));
249 #if defined BUILDVP1LIGHT
250 if(VP1QtUtils::expertSettingIsOn("general","ExpertSettings/VP1_ENABLE_ASK_ON_CLOSE")){
251 m_checkboxEnableAskOnClose->setChecked(true);
252 }
253 connect(m_checkboxEnableAskOnClose, &QCheckBox::toggled, [this](){GeneralTab::setExpertSetting("general","ExpertSettings/VP1_ENABLE_ASK_ON_CLOSE");});
254 #else
255 if(VP1QtUtils::environmentVariableIsOn("VP1_ENABLE_ASK_ON_CLOSE")){
256 m_checkboxEnableAskOnClose->setChecked(true);
257 }
258 connect(m_checkboxEnableAskOnClose, &QCheckBox::toggled, [this](){GeneralTab::setExpertSetting("VP1_ENABLE_ASK_ON_CLOSE");});
259 #endif
260
261
262 m_checkboxGuidesSphereInsteadOfCoordaxes = new QCheckBox("G&uides sphere instead of coordinate axes", this);
263 m_checkboxGuidesSphereInsteadOfCoordaxes->setToolTip( QApplication::translate(__FUNCTION__, " <html>\n"
264 " <div style=\"width: 300px;\">Replaces the coordinate axes with a red sphere.</div>"
265 " </html>", 0
266 ));
267 #if defined BUILDVP1LIGHT
268 if(VP1QtUtils::expertSettingIsOn("general","ExpertSettings/VP1_GUIDES_SPHERE_INSTEAD_OF_COORDAXES")){
270 }
271 connect(m_checkboxGuidesSphereInsteadOfCoordaxes, &QCheckBox::toggled, [this](){GeneralTab::setExpertSetting("general","ExpertSettings/VP1_GUIDES_SPHERE_INSTEAD_OF_COORDAXES");});
272 #else
273 if(VP1QtUtils::environmentVariableIsOn("VP1_GUIDES_SPHERE_INSTEAD_OF_COORDAXES")){
275 }
276 connect(m_checkboxGuidesSphereInsteadOfCoordaxes, &QCheckBox::toggled, [this](){GeneralTab::setExpertSetting("VP1_GUIDES_SPHERE_INSTEAD_OF_COORDAXES");});
277 #endif
278
279
280 m_checkboxAntiAliasing = new QCheckBox("Advanced Anti-Aliasing", this);
281 m_checkboxAntiAliasing->setToolTip( QApplication::translate(__FUNCTION__, " <html>\n"
282 " <div style=\"width: 300px;\">Switches on advanced Anti-Aliasing. WARNING: May cause issues with certain graphics drivers.</div>"
283 " </html>", 0
284 ));
285 #if defined BUILDVP1LIGHT
286 if(VP1QtUtils::expertSettingIsOn("general","ExpertSettings/VP1_ADVANCED_ANTIALIASING")){
287 m_checkboxAntiAliasing->setChecked(true);
288 }
289 connect(m_checkboxAntiAliasing, &QCheckBox::toggled, [this](){GeneralTab::setExpertSetting("general","ExpertSettings/VP1_ADVANCED_ANTIALIASING");});
290 #else
291 if(VP1QtUtils::environmentVariableIsOn("VP1_ADVANCED_ANTIALIASING")){
292 m_checkboxAntiAliasing->setChecked(true);
293 }
294 connect(m_checkboxAntiAliasing, &QCheckBox::toggled, [this](){GeneralTab::setExpertSetting("VP1_ADVANCED_ANTIALIASING");});
295 #endif
296
297
298
299 QGroupBox *directoryGroup = new QGroupBox(tr("Directory settings"));
300
301 m_browseButton1 = new QPushButton(tr("&Browse..."), this);
302 connect(m_browseButton1, &QAbstractButton::clicked, this, &GeneralTab::on_browseButton1_clicked);
303 #if defined BUILDVP1LIGHT
304 m_lineEdit1 = new QLineEdit(VP1QtUtils::expertSettingValue("general","ExpertSettings/VP1_SCREENSHOTS_DIR"), this);
305 #else
306 m_lineEdit1 = new QLineEdit(VP1QtUtils::environmentVariableValue("VP1_SCREENSHOTS_DIR"), this);
307 #endif
308 m_lineEdit1->setToolTip( QApplication::translate(__FUNCTION__, " <html>\n"
309 " <div style=\"width: 300px;\">Turns on the automatic generation of screen-shots for all channels at every event. The value must be a valid writable directory, where all generated screenshot files will be stored.</div>"
310 " </html>", 0
311 ));
312 connect(m_lineEdit1, &QLineEdit::textChanged, this, &GeneralTab::slotScreenshotDirChanged);
313
314
315 QVBoxLayout *generalLayout = new QVBoxLayout;
316 generalLayout->addWidget(m_checkboxVerbose);
317 generalLayout->addWidget(m_checkboxDebug);
318 generalLayout->addWidget(m_checkboxDisallowMultipleChannels);
319 generalLayout->addWidget(m_checkboxDisplayMouseClicks);
320 generalLayout->addWidget(m_checkboxEnableAskOnClose);
321 generalLayout->addWidget(m_checkboxGuidesSphereInsteadOfCoordaxes);
322 generalLayout->addWidget(m_checkboxAntiAliasing);
323 generalGroup->setLayout(generalLayout);
324
325 QGridLayout *gridLayout = new QGridLayout(this);
326 gridLayout->addWidget(new QLabel(tr("Screenshots directory:")), 0, 0);
327 gridLayout->addWidget(m_lineEdit1,1,0);
328 gridLayout->addWidget(m_browseButton1,1,1);
329 directoryGroup->setLayout(gridLayout);
330
331 QVBoxLayout *mainLayout = new QVBoxLayout;
332 mainLayout->addWidget(generalGroup);
333 mainLayout->addWidget(directoryGroup);
334 mainLayout->addStretch(1);
335 setLayout(mainLayout);
336
337}
QLineEdit * m_lineEdit1
QCheckBox * m_checkboxAntiAliasing
QCheckBox * m_checkboxDisallowMultipleChannels
void on_browseButton1_clicked()
QCheckBox * m_checkboxGuidesSphereInsteadOfCoordaxes
void slotScreenshotDirChanged(const QString &path)
QCheckBox * m_checkboxEnableAskOnClose
QPushButton * m_browseButton1
void setExpertSetting(const QString &name)
QCheckBox * m_checkboxDisplayMouseClicks
QCheckBox * m_checkboxDebug
QCheckBox * m_checkboxVerbose
static bool environmentVariableIsOn(const QString &name)
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

◆ on_browseButton1_clicked

void GeneralTab::on_browseButton1_clicked ( )
privateslot

Definition at line 357 of file VP1ExpertSettings.cxx.

357 {
358 QString fileName = QFileDialog::getExistingDirectory(this,
359 tr("Select screenshot directory"), QDir::currentPath(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
360
361 m_lineEdit1->setText(fileName);
362}

◆ setExpertSetting

void GeneralTab::setExpertSetting ( const QString & name)
privateslot

Definition at line 348 of file VP1ExpertSettings.cxx.

348 {
351 } else {
353 }
354}
static void unsetEnvironmentVariable(const QString &name)
static void setEnvironmentVariable(const QString &name, const QString &content)

◆ signalScreenshotDirChanged

void GeneralTab::signalScreenshotDirChanged ( const QString & path)
signal

◆ slotScreenshotDirChanged

void GeneralTab::slotScreenshotDirChanged ( const QString & path)
privateslot

Definition at line 364 of file VP1ExpertSettings.cxx.

364 {
366}
void signalScreenshotDirChanged(const QString &path)

Member Data Documentation

◆ m_browseButton1

QPushButton* GeneralTab::m_browseButton1
private

Definition at line 84 of file VP1ExpertSettings.h.

◆ m_checkboxAntiAliasing

QCheckBox* GeneralTab::m_checkboxAntiAliasing
private

Definition at line 83 of file VP1ExpertSettings.h.

◆ m_checkboxDebug

QCheckBox* GeneralTab::m_checkboxDebug
private

Definition at line 78 of file VP1ExpertSettings.h.

◆ m_checkboxDisallowMultipleChannels

QCheckBox* GeneralTab::m_checkboxDisallowMultipleChannels
private

Definition at line 79 of file VP1ExpertSettings.h.

◆ m_checkboxDisplayMouseClicks

QCheckBox* GeneralTab::m_checkboxDisplayMouseClicks
private

Definition at line 80 of file VP1ExpertSettings.h.

◆ m_checkboxEnableAskOnClose

QCheckBox* GeneralTab::m_checkboxEnableAskOnClose
private

Definition at line 81 of file VP1ExpertSettings.h.

◆ m_checkboxGuidesSphereInsteadOfCoordaxes

QCheckBox* GeneralTab::m_checkboxGuidesSphereInsteadOfCoordaxes
private

Definition at line 82 of file VP1ExpertSettings.h.

◆ m_checkboxVerbose

QCheckBox* GeneralTab::m_checkboxVerbose
private

Definition at line 77 of file VP1ExpertSettings.h.

◆ m_lineEdit1

QLineEdit* GeneralTab::m_lineEdit1
private

Definition at line 85 of file VP1ExpertSettings.h.


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