141: QMainWindow(parent),
154{
155 setupUi(this);
156
158
159 #if defined BUILDVP1LIGHT
161 #else
163 #endif
164
165 if (!checkShowAllCruiseAndEventControls) {
166 pushButton_eventseek->setVisible(false);
167 groupBox_cruise->setVisible(false);
168 }
169
173 }
174
175
180 menubar->addAction(
menu_file->menuAction());
182
184 }
185
186 #ifndef BUILDVP1LIGHT
187 pushButton_previousevent->setVisible(false);
188 pushButton_eventselect->setVisible(false);
189 #else
190 pushButton_eventselect->setVisible(true);
191 pushButton_eventselect->setText("Event: 0/0");
192 pushButton_eventselect->setEnabled(false);
193 pushButton_previousevent->setEnabled(false);
194
195
196
197 pushButton_quicksetup_trackingstudies->setEnabled(false);
198 pushButton_quicksetup_trackingstudies->setToolTip("Not available in VP1Light");
199 pushButton_quicksetup_calostudies->setEnabled(false);
200 pushButton_quicksetup_calostudies->setToolTip("Not available in VP1Light");
201 action_quicklaunch_Tracking_studies->setEnabled(false);
202 action_quicklaunch_Tracking_studies->setToolTip("Not available in VP1Light");
203 action_quicklaunch_Calo_studies->setEnabled(false);
204 action_quicklaunch_Calo_studies->setToolTip("Not available in VP1Light");
205 action_quicklaunch_Storegate_browser->setEnabled(false);
206 action_quicklaunch_Storegate_browser->setToolTip("Not available in VP1Light");
207 action_quicklaunch_trackcalo_commis->setEnabled(false);
208 action_quicklaunch_trackcalo_commis->setToolTip("Not available in VP1Light");
210 #endif
211
213
214
215 VP1AvailEvtsLocalDir* availLocal =
dynamic_cast<VP1AvailEvtsLocalDir*
>(
m_availEvents);
216
217 QStringList inputdirs;
218 if (availLocal)
220
221 if (availLocal&&!inputdirs.isEmpty()) {
222
224 if (currentdir.endsWith("/"))
225 currentdir.chop(1);
227 QMenu * menu_inputdir = new QMenu(menubar);
228 menu_inputdir->setObjectName("menu_inputdir");
229 menu_inputdir->setTitle("&Stream");
230
231 menubar->addAction(menu_inputdir->menuAction());
232
233 QActionGroup * inputdir_actiongroup = new QActionGroup(menu_inputdir);
234 QAction*action_inputdir_current(0);
235 for (QString inputdir : inputdirs) {
238 QString
dirname = QDir(inputdir).dirName();
239 QAction * action_inputdir = new QAction(this);
240 action_inputdir->setObjectName(
"action_inputdir_"+
dirname);
241 action_inputdir->setData(inputdir);
242 action_inputdir->setStatusTip("Get input files from: "+inputdir);
243 action_inputdir->setCheckable(true);
244
245 if (currentdir==inputdir)
246 action_inputdir_current = action_inputdir;
247 menu_inputdir->addAction(action_inputdir);
248 inputdir_actiongroup->addAction(action_inputdir);
251 }
252 if (action_inputdir_current) {
253 action_inputdir_current->blockSignals(true);
254 action_inputdir_current->setChecked(true);
255 action_inputdir_current->blockSignals(false);
256 }
257
258
261 QString(),
262 true,
263 false);
264
267
268
269 QTimer *
timer =
new QTimer(
this);
272 }
273
274
275
279
280
281
282
283
284 for (
int i=0;
i<stackedWidget_central->count();++
i)
285 stackedWidget_central->widget(i)->layout()->setContentsMargins(0,0,0,0);
286
288 frame_instructions->setFrameShape(QFrame::StyledPanel);
289
290
291 #ifndef BUILDVP1LIGHT
293 #else
295 #endif
300
301
306 else
308
309
313
314
315
318
320
321 connect(pushButton_channelfullscreen,SIGNAL(clicked()),
m_tabmanager,SLOT(showCurrentChannelFullScreen()));
326
327
328
336 connect(action_exit_VP1,SIGNAL(triggered(
bool)),
this,SLOT(close()));
337
338
342 menuConfiguration->addSeparator();
343
346
347
348
350
352 QActionGroup * styleGroup = new QActionGroup(this);
353 QAction * laststyleact(0);
354 bool foundplastique=false;
356 QString defaultstyle=
s.value(
"style/defaultstyle",
"Fusion").toString();
357 for (QString style : QStyleFactory::keys() ) {
359 act->setStatusTip("Change application style to "+style);
361 act->setCheckable(true);
362 styleGroup->addAction(act);
363 laststyleact=act;
364 if (act->text()==defaultstyle) {
365 act->setChecked(true);
366 QApplication::setStyle(QStyleFactory::create(act->text()));
367 foundplastique=true;
368 }
369 }
370 if (!foundplastique) {
371 laststyleact->setChecked(true);
372 QApplication::setStyle(QStyleFactory::create(laststyleact->text()));
373 }
374
375 int savedgoal = 0;
377 savedgoal =
s.value(
"font/pixelsize_diff", 0).toInt();
378 else
379 savedgoal =
s.value(
"font/pointsize_relativepercent", 0).toInt();
380
382 QList<int> fontoptions;
384 fontoptions <<15<<10<<+5<<+3<<+2<<+1<<0<<-1<<-2<<-3<<-5<<-10<<-20<<-30;
385 else
386 fontoptions <<150<<100<<50<<30<<20<<10<<5<<0<<-5<<-10<<-20<<-30<<-50;
387
388 QActionGroup * fontGroup = new QActionGroup(this);
389 bool foundsavedgoal(false);
390 QAction * normalfontact(0);
391 for (int fontopt : fontoptions) {
393 continue;
394 QString
text = (fontopt==0?
"normal": (fontopt>0?
"+":
"")+QString::number(fontopt)+(
m_defaultfont_pointsize < 0.0?
" pixels" :
"%"));
396 act->setStatusTip("Change overall font size of application to "+text);
397 act->setData(fontopt);
398 act->setCheckable(true);
399 fontGroup->addAction(act);
401 if (fontopt==0)
402 normalfontact=act;
403 if (savedgoal==fontopt) {
404 act->setChecked(true);
406 foundsavedgoal=true;
407 }
408 }
409 if (!foundsavedgoal) {
410 normalfontact->setChecked(true);
411 }
412
413
416 menuConfiguration->addSeparator();
421
422
423 #ifdef BUILDVP1LIGHT
424 menuConfiguration->addSeparator();
428 #endif
429
430
432 #ifdef BUILDVP1LIGHT
433 connect(pushButton_previousevent,SIGNAL(clicked()),
this,SLOT(goToPreviousEvent()));
434 connect(pushButton_eventselect,SIGNAL(clicked()),
this,SLOT(chooseEvent()));
435 #endif
436
437
440
446
447
452
453
454 QMenu* menu_help = new QMenu(menubar);
455 menu_help->setObjectName("menu_help");
456 menu_help->setTitle("&Help");
457 menubar->addAction(menu_help->menuAction());
461 menu_help->addSeparator();
463
465
466 if (qgetenv("VP1_REMOTE_MODE") == "1") {
467 QString coinPolicy = QString::fromLocal8Bit(qgetenv("VP1_COIN_INDIRECT_RENDERING_MESSAGE"));
468 if (coinPolicy.isEmpty())
469 coinPolicy = tr("Coin default policy (not initialized by the vp1 launcher).");
470 auto *modeLabel = new QLabel(tr("REMOTE MODE"), this);
471 modeLabel->setStyleSheet("QLabel { background: #ffe08a; color: #202020; font-weight: bold; padding: 4px; }");
472 modeLabel->setToolTip(tr("Remote mode enabled. Continuous rotation after mouse release is off by default. "
473 "Restart with --no-remote if detection is incorrect."));
474 modeLabel->setToolTip(modeLabel->toolTip() + QStringLiteral("\nSnapshot compatibility: ")
476 + QStringLiteral("\nCoin OpenGL policy: ") + coinPolicy);
477 statusBar()->addPermanentWidget(modeLabel);
479 QTimer::singleShot(0, this, [this, coinPolicy]() {
480 auto *notice = new QMessageBox(QMessageBox::Information, tr("VP1 remote mode"),
481 tr("VP1 has launched in remote mode.\n\nReason: %1.\n\n"
482 "In particular, a workaround to fix remote snapshot creation "
483 "is applied if needed, and 3D view rotation is limited to mouse movements "
484 "to prevent the creation of extra frames and slow response.\n\n"
485 "If auto-detection of remote running is incorrect, restart VP1 with '--no-remote' "
486 "to force full behavior.\n\n"
487 "==== Details: ====\n"
488 "To improve responsiveness, Continue rotating after mouse release is OFF by default. "
489 "Your saved remote preference takes precedence. Normal mouse dragging still works.\n\n"
490 "You can change this setting in the 3D viewer's right-click menu.\n\n"
491 "Snapshot compatibility: %2\n\n"
492 "Coin OpenGL policy: %3\n\n"
493 "If detection is incorrect, restart VP1 with --no-remote.")
494 .
arg(QString::fromLocal8Bit(qgetenv(
"VP1_REMOTE_REASON")),
496 QMessageBox::Ok, this);
497 notice->setTextFormat(Qt::PlainText);
498 notice->setAttribute(Qt::WA_DeleteOnClose);
499 notice->open();
500 });
501 }
502 }
503
506
511
512
513 #ifndef BUILDVP1LIGHT
514 menubar->setEnabled(false);
515 #endif
516}
const QString & currentSourceDir() const
const QStringList & availableSourceDirectories() const
void helperAddToMessageBox(const QString &)
void updateCentralStackWidget()
void quickSetupTriggered()
void help_openUserSupport()
int m_defaultfont_pixelsize
QMenu * m_menu_changeFontSize
VP1EventDisplayEditor * m_edEditor
VP1AvailEvents * m_availEvents
void receivedExternalRequest(VP1ExternalRequest)
void saveAllCurrentChannels()
double m_defaultfont_pointsize
void showMenu_loadPlugin()
VP1ChannelManager * m_channelmanager
VP1TabManager * m_tabmanager
QString m_currentsaveimagepath
QString m_currentloadpluginpath
VP1IncomingMessageDialog * m_currentincomingdialog
void request_saveasConfig()
QAction * m_action_openUsersSupport
QMenu * m_menu_loadPlugin
void request_cruisemodechange()
QWidget * m_dummyemptycontroller
const QString m_settingsfile
void updateEventControls()
QAction * m_actionSave_current_tabs
QAction * m_action_openUsersGuide
void changeStyleActionTriggered()
QMenu * m_menu_loadConfFile
unsigned long long m_eventnumber
void help_openUserGuide()
QAction * m_action_openVP1Site
QAction * m_actionAdd_empty_tab
QString request_saveChannelSnapshot(const QString &xLabel="")
void inputDirectoryActionTriggered()
VP1PluginDialog * m_plugindialog
VP1DirStatuses m_inputdirstatuses
void request_printChannel()
QList< QAction * > m_inputdiractions
QAction * m_actionEnableExpertSettings
VP1StreamMenuUpdater * m_streamMenuUpdater
void request_channelInformation()
VP1ExecutionScheduler * m_scheduler
void makeAllChannelsEventDisplay()
QAction * m_action_addEventFile
void changeFontSizeActionTriggered()
void selectedChannelChanged(IVP1ChannelWidget *)
void request_addEmptyTab()
void tabListChanged(const QStringList &)
QAction * m_action_openAbout
void launch3DstereoEditor()
void updateInputDirectoriesStatus()
void showMenu_loadConfFile()
void help_openVP1WebSite()
QMenu * m_menu_changeStyle
static bool environmentVariableIsOn(const QString &name)
static bool expertSettingIsSet(const QString &type, const QString &name)
static bool environmentVariableIsSet(const QString &name)
static QString defaultFileSelectDirectory()
str inputdir
define the input files
timer(name, disabled=False)
std::string dirname(std::string name)