ATLAS Offline Software
Loading...
Searching...
No Matches
VP1ExpertSettings.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6// //
7// Source file for class VP1ExpertSettings //
8// //
9// Description: Additional VP1 settings //
10// //
11// Author: Sebastian Andreas Merkt (sebastian.andreas.merkt@cern.ch) //
12// Initial version: August 2017 //
13// //
15
17#include "VP1Base/VP1QtUtils.h"
18#include "VP1Base/VP1Msg.h"
19
20#include <QPushButton>
21#include <QGridLayout>
22#include <QLabel>
23#include <QComboBox>
24#include <QCheckBox>
25#include <QDir>
26#include <QKeyEvent>
27
28#if __GNUC__ >= 14
29// suppress warning seen in qfutureinterface.h
30# pragma GCC diagnostic push
31# pragma GCC diagnostic ignored "-Wtemplate-id-cdtor"
32#endif
33#include <QtWidgets>
34#if __GNUC__ >= 14
35# pragma GCC diagnostic pop
36#endif
37
38
39template <typename... Args> inline void unused(Args&&...) {} // to declare variables as 'unused'
40
41
42
43VP1ExpertSettings::VP1ExpertSettings(QWidget *parent) : 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}
91
92void VP1ExpertSettings::closeEvent(QCloseEvent *event)
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}
140
141void VP1ExpertSettings::keyPressEvent(QKeyEvent *event){
142 if(event->key() == Qt::Key_Escape)
143 VP1ExpertSettings::close();
144}
145
146void VP1ExpertSettings::setPluginPath(const QString &path){
147 m_pluginPath = path;
148}
149
150void VP1ExpertSettings::setFileSelectDir(const QString &path){
151 m_fileSelectDir = path;
152}
153
154void VP1ExpertSettings::setScreenshotDir(const QString &path){
155 m_screenshotDir = path;
156}
157
158void VP1ExpertSettings::setAuthLog(const QString &path){
159 m_authLog = path;
160}
161
162void VP1ExpertSettings::setExpertSetting(const QString &type, const QString &name){
165 } else {
167 }
168}
169
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}
338
339#if defined BUILDVP1LIGHT
340void GeneralTab::setExpertSetting(const QString &type, const QString &name){
343 } else {
344 VP1QtUtils::setExpertSetting(type, name, "");
345 }
346}
347#else
348void GeneralTab::setExpertSetting(const QString &name){
351 } else {
353 }
354}
355#endif
356
358 QString fileName = QFileDialog::getExistingDirectory(this,
359 tr("Select screenshot directory"), QDir::currentPath(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
360
361 m_lineEdit1->setText(fileName);
362}
363
364void GeneralTab::slotScreenshotDirChanged(const QString &path){
366}
367
368
370 : QWidget(parent)
371{
372 QGroupBox *checkBoxGroup = new QGroupBox(tr("Advanced settings"));
373
374 m_checkboxEnableInformOnEndOfJob = new QCheckBox("&Enable inform on end of job", this);
375 m_checkboxEnableInformOnEndOfJob->setToolTip( QApplication::translate(__FUNCTION__, " <html>\n"
376 " <div style=\"width: 300px;\">By default, VP1 simply exits at the end of the ATHENA job, which might be confusing to some. When this variable is set, VP1 will show an dialog, letting the user know that the end of the job has been reached.</div>"
377 " </html>", 0
378 ));
379 #if defined BUILDVP1LIGHT
380 if(VP1QtUtils::expertSettingIsOn("expert","ExpertSettings/VP1_ENABLE_INFORM_ON_END_OF_JOB")){
381 m_checkboxEnableInformOnEndOfJob->setChecked(true);
382 }
383 connect(m_checkboxEnableInformOnEndOfJob, &QCheckBox::toggled, [this](){AdvancedTab::setExpertSetting("expert","ExpertSettings/VP1_ENABLE_INFORM_ON_END_OF_JOB");});
384 #else
385 if(VP1QtUtils::environmentVariableIsOn("VP1_ENABLE_INFORM_ON_END_OF_JOB")){
386 m_checkboxEnableInformOnEndOfJob->setChecked(true);
387 }
388 connect(m_checkboxEnableInformOnEndOfJob, &QCheckBox::toggled, [this](){AdvancedTab::setExpertSetting("VP1_ENABLE_INFORM_ON_END_OF_JOB");});
389 #endif
390
391 m_checkboxHardExitAtEnd = new QCheckBox("&Hard exit at end", this);
392 m_checkboxHardExitAtEnd->setToolTip( QApplication::translate(__FUNCTION__, " <html>\n"
393 " <div style=\"width: 300px;\">By default, the VP1 algorithm simply tells ATHENA to end the job when VP1 is being closed. This means that ATHENA will shut down with its usual procedure, calling finalise on algorithms, generating summaries, etc. If this variable is set, then VP1 will make the process end immediately and abrubtly instead - saving the user some time.</div>"
394 " </html>", 0
395 ));
396 #if defined BUILDVP1LIGHT
397 if(VP1QtUtils::expertSettingIsOn("expert","ExpertSettings/VP1_HARD_EXIT_AT_END")){
398 m_checkboxHardExitAtEnd->setChecked(true);
399 }
400 connect(m_checkboxHardExitAtEnd, &QCheckBox::toggled, [this](){AdvancedTab::setExpertSetting("expert","ExpertSettings/VP1_HARD_EXIT_AT_END");});
401 #else
402 if(VP1QtUtils::environmentVariableIsOn("VP1_HARD_EXIT_AT_END")){
403 m_checkboxHardExitAtEnd->setChecked(true);
404 }
405 connect(m_checkboxHardExitAtEnd, &QCheckBox::toggled, [this](){AdvancedTab::setExpertSetting("VP1_HARD_EXIT_AT_END");});
406 #endif
407
408 m_checkboxDevelShowAllCruiseAndEventControls = new QCheckBox("&Show all cruise and event controls", this);
409 m_checkboxDevelShowAllCruiseAndEventControls->setToolTip( QApplication::translate(__FUNCTION__, " <html>\n"
410 " <div style=\"width: 300px;\">Use to enable a few controls related to VP1 cruise-mode, which have presently been disabled.</div>"
411 " </html>", 0
412 ));
413 #if defined BUILDVP1LIGHT
414 if(VP1QtUtils::expertSettingIsOn("expert","ExpertSettings/VP1_DEVEL_SHOW_ALL_CRUISE_AND_EVENT_CONTROLS")){
416 }
417 connect(m_checkboxDevelShowAllCruiseAndEventControls, &QCheckBox::toggled, [this](){AdvancedTab::setExpertSetting("expert","ExpertSettings/VP1_DEVEL_SHOW_ALL_CRUISE_AND_EVENT_CONTROLS");});
418 #else
419 if(VP1QtUtils::environmentVariableIsOn("VP1_DEVEL_SHOW_ALL_CRUISE_AND_EVENT_CONTROLS")){
421 }
422 connect(m_checkboxDevelShowAllCruiseAndEventControls, &QCheckBox::toggled, [this](){AdvancedTab::setExpertSetting("VP1_DEVEL_SHOW_ALL_CRUISE_AND_EVENT_CONTROLS");});
423 #endif
424
425
426 QGroupBox *directoryGroup = new QGroupBox(tr("Directory settings"));
427
428 m_browseButton1 = new QPushButton(tr("&Browse..."), this);
429 connect(m_browseButton1, &QAbstractButton::clicked, this, &AdvancedTab::on_browseButton1_clicked);
430 m_lineEdit1 = new QLineEdit("", this);
431
432 #if defined BUILDVP1LIGHT
433 if(VP1QtUtils::expertSettingValue("expert","ExpertSettings/VP1PLUGINPATH")==""){
434 #ifdef MACBUNDLE
435 m_lineEdit1->setText(QCoreApplication::applicationDirPath()+"/../Frameworks");
436 #else
437 m_lineEdit1->setText(QCoreApplication::applicationDirPath()+"/../lib");
438 #endif
439 } else {
440 m_lineEdit1->setText(VP1QtUtils::expertSettingValue("expert","ExpertSettings/VP1PLUGINPATH"));
441 }
442 #else
443 if(VP1QtUtils::environmentVariableValue("VP1PLUGINPATH")==""){
444 m_lineEdit1->setText(QCoreApplication::applicationDirPath()+"/../lib");
445 } else {
446 m_lineEdit1->setText(VP1QtUtils::environmentVariableValue("VP1PLUGINPATH"));
447 }
448 #endif
449 m_lineEdit1->setToolTip( QApplication::translate(__FUNCTION__, " <html>\n"
450 " <div style=\"width: 300px;\">Select the directory that contains the plugin libraries.</div>"
451 " </html>", 0
452 ));
453 connect(m_lineEdit1, &QLineEdit::textChanged, this, &AdvancedTab::slotPluginPathChanged);
454
455 m_browseButton2 = new QPushButton(tr("B&rowse..."), this);
456 connect(m_browseButton2, &QAbstractButton::clicked, this, &AdvancedTab::on_browseButton2_clicked);
457 #if defined BUILDVP1LIGHT
458 m_lineEdit2 = new QLineEdit(VP1QtUtils::expertSettingValue("expert","ExpertSettings/VP1_FILESELECTDIR"), this);
459 #else
460 m_lineEdit2 = new QLineEdit(VP1QtUtils::environmentVariableValue("VP1_FILESELECTDIR"), this);
461 #endif
462 m_lineEdit2->setToolTip( QApplication::translate(__FUNCTION__, " <html>\n"
463 " <div style=\"width: 300px;\">By default, the various VP1 file selectors starts in the job run-directory. Setting this variable to a directory ensures that that directory is used by default instead.</div>"
464 " </html>", 0
465 ));
466 connect(m_lineEdit2, &QLineEdit::textChanged, this, &AdvancedTab::slotFileSelectDirChanged);
467
468 m_browseButton3 = new QPushButton(tr("Br&owse..."), this);
469 connect(m_browseButton3, &QAbstractButton::clicked, this, &AdvancedTab::on_browseButton3_clicked);
470 #if defined BUILDVP1LIGHT
471 m_lineEdit3 = new QLineEdit(VP1QtUtils::expertSettingValue("expert","ExpertSettings/VP1_AUTH_ENABLELOG"), this);
472 #else
473 m_lineEdit3 = new QLineEdit(VP1QtUtils::environmentVariableValue("VP1_AUTH_ENABLELOG"), this);
474 #endif
475 m_lineEdit3->setToolTip( QApplication::translate(__FUNCTION__, " <html>\n"
476 " <div style=\"width: 300px;\">Enables creation of an authentication log file for VP1 live.</div>"
477 " </html>", 0
478 ));
479 connect(m_lineEdit3, &QLineEdit::textChanged, this, &AdvancedTab::slotAuthLogChanged);
480
481
482 QVBoxLayout *checkBoxLayout = new QVBoxLayout;
483 checkBoxLayout->addWidget(m_checkboxEnableInformOnEndOfJob);
484 checkBoxLayout->addWidget(m_checkboxHardExitAtEnd);
485 checkBoxLayout->addWidget(m_checkboxDevelShowAllCruiseAndEventControls);
486 checkBoxGroup->setLayout(checkBoxLayout);
487
488 QGridLayout *gridLayout = new QGridLayout(this);
489 gridLayout->addWidget(new QLabel(tr("Plugin path:")), 0, 0);
490 gridLayout->addWidget(m_lineEdit1,1,0);
491 gridLayout->addWidget(m_browseButton1,1,1);
492 gridLayout->addWidget(new QLabel(tr("File selection directory:")), 2, 0);
493 gridLayout->addWidget(m_lineEdit2,3,0);
494 gridLayout->addWidget(m_browseButton2,3,1);
495 gridLayout->addWidget(new QLabel(tr("Authentication log directory:")), 4, 0);
496 gridLayout->addWidget(m_lineEdit3,5,0);
497 gridLayout->addWidget(m_browseButton3,5,1);
498 directoryGroup->setLayout(gridLayout);
499
500 QVBoxLayout *mainLayout = new QVBoxLayout;
501 mainLayout->addWidget(checkBoxGroup);
502 mainLayout->addWidget(directoryGroup);
503 mainLayout->addStretch(1);
504 setLayout(mainLayout);
505}
506
508{
509 QString fileName = QFileDialog::getExistingDirectory(this,
510 tr("Select Plugin Path"), QDir::currentPath(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
511
512 m_lineEdit1->setText(fileName);
513}
514
516{
517 QString fileName = QFileDialog::getExistingDirectory(this,
518 tr("Select file directory"), QDir::currentPath(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
519
520 m_lineEdit2->setText(fileName);
521}
522
524{
525 QString fileName = QFileDialog::getExistingDirectory(this,
526 tr("Select authentication directory"), QDir::currentPath(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
527
528 m_lineEdit3->setText(fileName);
529}
530
531void AdvancedTab::slotPluginPathChanged(const QString &path){
532 emit signalPluginPathChanged(path);
533}
534
537}
538
539void AdvancedTab::slotAuthLogChanged(const QString &path){
540 emit signalAuthLogChanged(path);
541}
542
543#if defined BUILDVP1LIGHT
544void AdvancedTab::setExpertSetting(const QString &type, const QString &name){
547 } else {
548 VP1QtUtils::setExpertSetting(type, name, "");
549 }
550}
551#else
552void AdvancedTab::setExpertSetting(const QString &name){
555 } else {
557 }
558}
559#endif
void unused(Args &&...)
QCheckBox * m_checkboxDevelShowAllCruiseAndEventControls
void slotAuthLogChanged(const QString &path)
QCheckBox * m_checkboxEnableInformOnEndOfJob
void on_browseButton1_clicked()
void slotPluginPathChanged(const QString &path)
QLineEdit * m_lineEdit3
QCheckBox * m_checkboxHardExitAtEnd
QPushButton * m_browseButton2
void slotFileSelectDirChanged(const QString &path)
void setExpertSetting(const QString &name)
void signalPluginPathChanged(const QString &path)
QLineEdit * m_lineEdit2
AdvancedTab(QWidget *parent=0)
void on_browseButton3_clicked()
QPushButton * m_browseButton3
QLineEdit * m_lineEdit1
void on_browseButton2_clicked()
void signalAuthLogChanged(const QString &path)
void signalFileSelectDirChanged(const QString &path)
QPushButton * m_browseButton1
QLineEdit * m_lineEdit1
QCheckBox * m_checkboxAntiAliasing
QCheckBox * m_checkboxDisallowMultipleChannels
void on_browseButton1_clicked()
QCheckBox * m_checkboxGuidesSphereInsteadOfCoordaxes
void slotScreenshotDirChanged(const QString &path)
void signalScreenshotDirChanged(const QString &path)
QCheckBox * m_checkboxEnableAskOnClose
QPushButton * m_browseButton1
void setExpertSetting(const QString &name)
QCheckBox * m_checkboxDisplayMouseClicks
GeneralTab(QWidget *parent=0)
QCheckBox * m_checkboxDebug
QCheckBox * m_checkboxVerbose
void keyPressEvent(QKeyEvent *event)
void setExpertSetting(const QString &type, const QString &name)
VP1ExpertSettings(QWidget *parent=0)
QDialogButtonBox * m_buttonBox
void setScreenshotDir(const QString &path)
void setFileSelectDir(const QString &path)
QTabWidget * m_tabWidget
void setAuthLog(const QString &path)
void closeEvent(QCloseEvent *event)
void setPluginPath(const QString &path)
static void enableMsg(const QString &)
Definition VP1Msg.cxx:198
static bool environmentVariableIsOn(const QString &name)
static void setExpertSetting(const QString &type, const QString &name, const QString &content)
static QString expertSettingValue(const QString &type, const QString &name)
static QString environmentVariableValue(const QString &name)
static void unsetEnvironmentVariable(const QString &name)
static bool expertSettingIsOn(const QString &type, const QString &name)
static void setEnvironmentVariable(const QString &name, const QString &content)