CustusX  15.8
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cxMainWindow.cpp
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 
33 #include "cxMainWindow.h"
34 
35 #include <QtWidgets>
36 #include "boost/bind.hpp"
37 
38 #include "cxConfig.h"
39 #include "cxDataLocations.h"
40 #include "cxLogicManager.h"
41 #include "cxSettings.h"
42 #include "cxPatientModelService.h"
43 #include "cxViewService.h"
45 #include "cxAudioImpl.h"
46 #include "cxLayoutInteractor.h"
47 #include "cxCameraControl.h"
48 
50 #include "cxStatusBar.h"
51 #include "cxSecondaryMainWindow.h"
53 #include "cxSamplerWidget.h"
54 #include "cxHelperWidgets.h"
55 #include "cxMainWindowActions.h"
56 
59 #include "cxToolManagerWidget.h"
60 #include "cxFrameTreeWidget.h"
61 #include "cxNavigationWidget.h"
63 #include "cxToolPropertiesWidget.h"
64 #include "cxPreferencesDialog.h"
66 #include "cxMeshInfoWidget.h"
67 #include "cxTrackPadWidget.h"
68 #include "cxConsoleWidget.h"
69 #include "cxMetricWidget.h"
70 #include "cxPlaybackWidget.h"
71 #include "cxEraserWidget.h"
72 #include "cxAllFiltersWidget.h"
74 
75 namespace cx
76 {
77 
79  mFullScreenAction(NULL),
80  mStandard3DViewActions(new QActionGroup(this)),
81  mControlPanel(NULL),
82  mDockWidgets(new DynamicMainWindowWidgets(this)),
83  mActions(NULL)
84 {
85  this->setObjectName("MainWindow");
86 
87  mServices = VisServices::create(logicManager()->getPluginContext());
88  mLayoutInteractor.reset(new LayoutInteractor());
89 
90  this->setCentralWidget(viewService()->getLayoutWidget(this, 0));
91 
92  mActions = new MainWindowActions(mServices, this);
93 
94  this->createActions();
95  this->createMenus();
96  this->createToolBars();
97  this->setStatusBar(new StatusBar());
98 
99  reporter()->setAudioSource(AudioPtr(new AudioImpl()));
100 
104 
105  this->updateWindowTitle();
106 
107  this->setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North);
108 
109  this->addAsDockWidget(new PlaybackWidget(this), "Browsing");
110  this->addAsDockWidget(new VideoConnectionWidget(mServices, this), "Utility");
111  this->addAsDockWidget(new EraserWidget(mServices->patientModelService, mServices->visualizationService, this), "Properties");
112  this->addAsDockWidget(new MetricWidget(mServices->visualizationService, mServices->patientModelService, this), "Utility");
113  this->addAsDockWidget(new SlicePropertiesWidget(mServices->patientModelService, mServices->visualizationService, this), "Properties");
114  this->addAsDockWidget(new VolumePropertiesWidget(mServices->patientModelService, mServices->visualizationService, this), "Properties");
115  this->addAsDockWidget(new MeshInfoWidget(mServices->patientModelService, mServices->visualizationService, this), "Properties");
116  this->addAsDockWidget(new StreamPropertiesWidget(mServices->patientModelService, mServices->visualizationService, this), "Properties");
117  this->addAsDockWidget(new TrackPadWidget(this), "Utility");
118  this->addAsDockWidget(new ToolPropertiesWidget(this), "Properties");
119  this->addAsDockWidget(new NavigationWidget(this), "Properties");
120  this->addAsDockWidget(new ConsoleWidget(this, "ConsoleWidget", "Console"), "Utility");
121  this->addAsDockWidget(new ConsoleWidget(this, "ConsoleWidget2", "Extra Console"), "Utility");
122 // this->addAsDockWidget(new ConsoleWidgetCollection(this, "ConsoleWidgets", "Consoles"), "Utility");
123  this->addAsDockWidget(new FrameTreeWidget(mServices->patientModelService, this), "Browsing");
124  this->addAsDockWidget(new ToolManagerWidget(this), "Debugging");
125  this->addAsDockWidget(new PluginFrameworkWidget(this), "Browsing");
126  this->addAsDockWidget(new AllFiltersWidget(VisServices::create(logicManager()->getPluginContext()), this), "Algorithms");
127 
129  connect(qApp, &QApplication::focusChanged, this, &MainWindow::focusChanged);
130 
131  this->setupGUIExtenders();
132 
133  // window menu must be created after all dock widgets are created
134  QMenu* popupMenu = this->createPopupMenu();
135  popupMenu->setTitle("Window");
136  this->menuBar()->insertMenu(mHelpMenuAction, popupMenu);
137 
138  // Restore saved window states
139  // Must be done after all DockWidgets are created
140  if (restoreGeometry(settings()->value("mainWindow/geometry").toByteArray()))
141  {
142  this->show();
143  }
144  else
145  {
146  this->showMaximized();
147  }
148 
149  if (settings()->value("gui/fullscreen").toBool())
150  this->setWindowState(this->windowState() | Qt::WindowFullScreen);
151 }
152 
153 void MainWindow::changeEvent(QEvent * event)
154 {
155  QMainWindow::changeEvent(event);
156 
157  if (event->type() == QEvent::WindowStateChange)
158  {
159  if (mFullScreenAction)
160  mFullScreenAction->setChecked(this->windowState() & Qt::WindowFullScreen);
161  }
162 }
163 
164 void MainWindow::setupGUIExtenders()
165 {
166  mServiceListener.reset(new ServiceTrackerListener<GUIExtenderService>(
167  LogicManager::getInstance()->getPluginContext(),
168  boost::bind(&MainWindow::onGUIExtenderServiceAdded, this, _1),
169  boost::bind(&MainWindow::onGUIExtenderServiceModified, this, _1),
170  boost::bind(&MainWindow::onGUIExtenderServiceRemoved, this, _1)
171  ));
172  mServiceListener->open();
173 }
174 
176 {
177  std::vector<GUIExtenderService::CategorizedWidget> widgets = service->createWidgets();
178  for (unsigned j = 0; j < widgets.size(); ++j)
179  {
180  mDockWidgets->addAsDockWidget(widgets[j].mWidget, widgets[j].mCategory, service);
181  }
182 
183  std::vector<QToolBar*> toolBars = service->createToolBars();
184  for(unsigned j = 0; j < toolBars.size(); ++j)
185  {
186  mDockWidgets->registerToolBar(toolBars[j]);
187  }
188 }
189 
191 {
192 }
193 
195 {
196  mDockWidgets->owningServiceRemoved(service);
197 }
198 
200 {
201  if (val)
202  this->focusInsideDockWidget(sender());
203 }
204 
205 void MainWindow::focusChanged(QWidget * old, QWidget * now)
206 {
207  this->focusInsideDockWidget(now);
208 }
209 
210 void MainWindow::focusInsideDockWidget(QObject *dockWidget)
211 {
212  if (!dockWidget)
213  return;
214 
215 // CX_LOG_CHANNEL_DEBUG("HELP_DB") << QString(" try mw::focus [%1](%2)")
216 // .arg(dockWidget->objectName())
217 // .arg(dockWidget->metaObject()->className());
218 
219  // focusing to docked widgets is required by the help system
220 
221  // Assume structure: QDockWidget->QScrollArea->QWidget,
222  // as defined in MainWindow::addAsDockWidget()
223  QDockWidget* dw = dynamic_cast<QDockWidget*>(dockWidget);
224  if (!dw)
225  return;
226  if (dw->parent()!=this) // avoid events from other mainwindows
227  return;
228  QScrollArea* sa = dynamic_cast<QScrollArea*>(dw->widget());
229  if (!sa)
230  return;
231 
232  if (!sa->widget())
233  return;
234 
235 // CX_LOG_CHANNEL_DEBUG("HELP_DB") << QString(" do mw::focus [%1](%2)")
236 // .arg(sa->widget()->objectName())
237 // .arg(sa->widget()->metaObject()->className());
238 
239  QTimer::singleShot(0, sa->widget(), SLOT(setFocus())); // avoid loops etc by send async event.
240 }
241 
243 {
244  viewService()->deactivateLayout();
245  reporter()->setAudioSource(AudioPtr()); // important! QSound::play fires a thread, causes segfault during shutdown
246  mServiceListener.reset();
247 }
248 
250 {
251  return mDockWidgets->createPopupMenu();
252 }
253 
254 void MainWindow::createActions()
255 {
256  CameraControlPtr cameraControl = viewService()->getCameraControl();
257  if (cameraControl)
258  mStandard3DViewActions = cameraControl->createStandard3DViewActions();
259 
260  mShowContextSensitiveHelpAction = new QAction(QIcon(":/icons/open_icon_library/help-contents-5.png"),
261  "Context-sensitive help", this);
262  connect(mShowContextSensitiveHelpAction, &QAction::triggered, this, &MainWindow::onShowContextSentitiveHelp);
263 
264  mShowControlPanelAction = new QAction("Show Control Panel", this);
265  connect(mShowControlPanelAction, &QAction::triggered, this, &MainWindow::showControlPanelActionSlot);
266  mSecondaryViewLayoutWindowAction = new QAction("Show Secondary View Layout Window", this);
267  connect(mSecondaryViewLayoutWindowAction, &QAction::triggered, this, &MainWindow::showSecondaryViewLayoutWindowActionSlot);
268 
269  // Application
270  mAboutAction = new QAction(tr("About"), this);
271  mAboutAction->setStatusTip(tr("Show the application's About box"));
272  mPreferencesAction = new QAction(tr("Preferences"), this);
273  mPreferencesAction->setShortcut(tr("Ctrl+,"));
274  mPreferencesAction->setStatusTip(tr("Show the preferences dialog"));
275 
276  mFullScreenAction = new QAction(tr("Fullscreen"), this);
277  mFullScreenAction->setShortcut(tr("F11"));
278  mFullScreenAction->setStatusTip(tr("Toggle full screen"));
279  mFullScreenAction->setCheckable(true);
280  mFullScreenAction->setChecked(this->windowState() & Qt::WindowFullScreen);
281  connect(mFullScreenAction, &QAction::triggered, this, &MainWindow::toggleFullScreenSlot);
282 
283  mQuitAction = new QAction(tr("&Quit"), this);
284  mQuitAction->setShortcut(tr("Ctrl+Q"));
285  mQuitAction->setStatusTip(tr("Exit the application"));
286 
287  connect(mAboutAction, &QAction::triggered, this, &MainWindow::aboutSlot);
288  connect(mPreferencesAction, &QAction::triggered, this, &MainWindow::preferencesSlot);
289  connect(mQuitAction, &QAction::triggered, qApp, &QApplication::quit);
290 
291  mSaveDesktopAction = new QAction(QIcon(":/icons/workflow_state_save.png"), tr("Save desktop"), this);
292  mSaveDesktopAction->setToolTip("Save desktop for workflow step");
293  connect(mSaveDesktopAction, &QAction::triggered, this, &MainWindow::saveDesktopSlot);
294  mResetDesktopAction = new QAction(QIcon(":/icons/workflow_state_revert.png"), tr("Reset desktop"), this);
295  mResetDesktopAction->setToolTip("Reset desktop for workflow step");
296  connect(mResetDesktopAction, &QAction::triggered, this, &MainWindow::resetDesktopSlot);
297 
298  mInteractorStyleActionGroup = viewService()->createInteractorStyleActionGroup();
299 
300  // cross-connect save patient to save session
301  connect(mServices->getSession().get(), &SessionStorageService::isSaving, this, &MainWindow::saveDesktopSlot);
302 }
303 
304 
306 {
307  this->updateWindowTitle();
308 }
309 
310 void MainWindow::updateWindowTitle()
311 {
312  QString profileName = stateService()->getApplicationStateName();
313  QString versionName = stateService()->getVersionName();
314 
315  QString activePatientFolder = patientService()->getActivePatientFolder();
316  if (activePatientFolder.endsWith('/'))
317  activePatientFolder.chop(1);
318  QString patientName;
319 
320  if (!activePatientFolder.isEmpty())
321  {
322  QFileInfo info(activePatientFolder);
323  patientName = info.completeBaseName();
324  }
325 
326  QString format("%1 %2 - %3 - %4 (not approved for medical use)");
327  QString title = format
328  .arg(qApp->applicationDisplayName())
329  .arg(versionName)
330  .arg(profileName)
331  .arg(patientName);
332  this->setWindowTitle(title);
333 }
334 
336 {
337  Desktop desktop = stateService()->getActiveDesktop();
338 
339  mDockWidgets->restoreFrom(desktop);
340  viewService()->setActiveLayout(desktop.mLayoutUid, 0);
341  viewService()->setActiveLayout(desktop.mSecondaryLayoutUid, 1);
342  patientService()->autoSave();
343 
344  // moved to help plugin:
345 // // set initial focus to mainwindow in order to view it in the documentation
346 // // this is most important when starting up.
347 // QTimer::singleShot(0, this, SLOT(setFocus())); // avoid loops etc by send async event.
348 
349 //#ifdef CX_APPLE
350 // // HACK
351 // // Toolbars are not correctly refreshed on mac 10.8,
352 // // Cause is related to QVTKWidget (removing it removes the problem)
353 // // The following "force refresh by resize" solves repaint, but
354 // // inactive toolbars are still partly clickable.
355 // QSize size = this->size();
356 // this->resize(size.width()-1, size.height());
357 // this->resize(size);
358 //#endif
359 }
360 
362 {
363  Desktop desktop;
364  desktop.mMainWindowState = this->saveState();
365  desktop.mLayoutUid = viewService()->getActiveLayout(0);
366  desktop.mSecondaryLayoutUid = viewService()->getActiveLayout(1);
367  stateService()->saveDesktop(desktop);
368 
369  // save to settings file in addition
370  settings()->setValue("mainWindow/geometry", saveGeometry());
371  settings()->setValue("mainWindow/windowState", saveState());
372  settings()->sync();
373 }
374 
376 {
377  stateService()->resetDesktop();
379 }
380 
382 {
383  mDockWidgets->showWidget("Help");
384 }
385 
387 {
388  this->setWindowState(this->windowState() ^ Qt::WindowFullScreen);
389 
390  settings()->setValue("gui/fullscreen", (this->windowState() & Qt::WindowFullScreen)!=0);
391 }
392 
394 {
395  if (!mControlPanel)
396  mControlPanel = new SecondaryMainWindow(this);
397  mControlPanel->show();
398 }
399 
401 {
402  if (!mSecondaryViewLayoutWindow)
403  mSecondaryViewLayoutWindow = new SecondaryViewLayoutWindow(this);
404  mSecondaryViewLayoutWindow->tryShowOnSecondaryScreen();
405 }
406 
408 {
409  this->updateWindowTitle();
410 }
411 
412 void MainWindow::createMenus()
413 {
414 #ifdef CX_LINUX
415  // shortcuts defined on actions in the global menubar is not reachable on Qt5+Ubuntu14.04,
416  // solve by reverting to old style.
417  // This will create a double menubar: remove by autohiding menubar or using
418  // sudo apt-get autoremove appmenu-gtk appmenu-gtk3 appmenu-qt
419  // and reboot
420  this->menuBar()->setNativeMenuBar(false);
421 #endif
422  mFileMenu = new QMenu(tr("File"), this);
423  mWorkflowMenu = new QMenu(tr("Workflow"), this);
424  mToolMenu = new QMenu(tr("Tracking"), this);
425  mLayoutMenu = new QMenu(tr("Layouts"), this);
426  mNavigationMenu = new QMenu(tr("Navigation"), this);
427  mHelpMenu = new QMenu(tr("Help"), this);
428 
429  // File
430  mFileMenu->addAction(mPreferencesAction);
431  this->menuBar()->addMenu(mFileMenu);
432  mFileMenu->addAction(mActions->getAction("NewPatient"));
433  mFileMenu->addAction(mActions->getAction("SaveFile"));
434  mFileMenu->addAction(mActions->getAction("LoadFile"));
435  mFileMenu->addAction(mActions->getAction("ClearPatient"));
436  mFileMenu->addSeparator();
437  mFileMenu->addAction(mActions->getAction("ExportPatient"));
438  mFileMenu->addAction(mActions->getAction("ImportData"));
439  mFileMenu->addAction(mActions->getAction("DeleteData"));
440  mFileMenu->addSeparator();
441  mFileMenu->addAction(mFullScreenAction);
442  mFileMenu->addAction(mActions->getAction("StartLogConsole"));
443  mFileMenu->addAction(mActions->getAction("ShootScreen"));
444  mFileMenu->addAction(mActions->getAction("ShootWindow"));
445  mFileMenu->addAction(mActions->getAction("RecordFullscreen"));
446  mFileMenu->addSeparator();
447  mFileMenu->addAction(mShowControlPanelAction);
448  mFileMenu->addAction(mSecondaryViewLayoutWindowAction);
449 
450  mFileMenu->addAction(mQuitAction);
451 
452  //workflow
453  this->menuBar()->addMenu(mWorkflowMenu);
454  QList<QAction*> actions = stateService()->getWorkflowActions()->actions();
455  for (int i=0; i<actions.size(); ++i)
456  {
457  mWorkflowMenu->addAction(actions[i]);
458  }
459 
460  mWorkflowMenu->addSeparator();
461  mWorkflowMenu->addAction(mSaveDesktopAction);
462  mWorkflowMenu->addAction(mResetDesktopAction);
463 
464  //tool
465  this->menuBar()->addMenu(mToolMenu);
466  mToolMenu->addAction(mActions->getAction("ConfigureTools"));
467  mToolMenu->addAction(mActions->getAction("InitializeTools"));
468  mToolMenu->addAction(mActions->getAction("TrackingTools"));
469  mToolMenu->addSeparator();
470  mToolMenu->addAction(mActions->getAction("StartStreaming"));
471  mToolMenu->addSeparator();
472 
473  //layout
474  this->menuBar()->addMenu(mLayoutMenu);
475  mLayoutInteractor->connectToMenu(mLayoutMenu);
476 
477  this->menuBar()->addMenu(mNavigationMenu);
478  mNavigationMenu->addAction(mActions->getAction("CenterToImageCenter"));
479  mNavigationMenu->addAction(mActions->getAction("CenterToTooltip"));
480  mNavigationMenu->addAction(mActions->getAction("ShowPointPicker"));
481  mNavigationMenu->addSeparator();
482  mNavigationMenu->addActions(mInteractorStyleActionGroup->actions());
483 
484  mHelpMenuAction = this->menuBar()->addMenu(mHelpMenu);
485  mHelpMenu->addAction(mAboutAction);
486  mHelpMenu->addAction(mActions->getAction("GotoDocumentation"));
487  mHelpMenu->addAction(mShowContextSensitiveHelpAction);
488 }
489 
490 void MainWindow::createToolBars()
491 {
492  mWorkflowToolBar = this->registerToolBar("Workflow");
493  QList<QAction*> actions = stateService()->getWorkflowActions()->actions();
494  for (int i=0; i<actions.size(); ++i)
495  mWorkflowToolBar->addAction(actions[i]);
496 
497  mDataToolBar = this->registerToolBar("Data");
498  mDataToolBar->addAction(mActions->getAction("NewPatient"));
499  mDataToolBar->addAction(mActions->getAction("LoadFile"));
500  mDataToolBar->addAction(mActions->getAction("SaveFile"));
501  mDataToolBar->addAction(mActions->getAction("ImportData"));
502 
503  mToolToolBar = this->registerToolBar("Tools");
504  mToolToolBar->addAction(mActions->getAction("TrackingTools"));
505  mToolToolBar->addAction(mActions->getAction("StartStreaming"));
506 
507  mNavigationToolBar = this->registerToolBar("Navigation");
508  mNavigationToolBar->addAction(mActions->getAction("CenterToImageCenter"));
509  mNavigationToolBar->addAction(mActions->getAction("CenterToTooltip"));
510  mNavigationToolBar->addAction(mActions->getAction("ShowPointPicker"));
511 
512  mInteractorStyleToolBar = this->registerToolBar("InteractorStyle");
513  mInteractorStyleToolBar->addActions(mInteractorStyleActionGroup->actions());
514 
515  mDesktopToolBar = this->registerToolBar("Desktop");
516  mDesktopToolBar->addAction(mSaveDesktopAction);
517  mDesktopToolBar->addAction(mResetDesktopAction);
518 
519  mScreenshotToolBar = this->registerToolBar("Screenshot");
520  mScreenshotToolBar->addAction(mActions->getAction("ShootScreen"));
521  mScreenshotToolBar->addAction(mActions->getAction("RecordFullscreen"));
522 
523  QToolBar* camera3DViewToolBar = this->registerToolBar("Camera 3D Views");
524  camera3DViewToolBar->addActions(mStandard3DViewActions->actions());
525 
526  QToolBar* samplerWidgetToolBar = this->registerToolBar("Sampler");
527  samplerWidgetToolBar->addWidget(new SamplerWidget(this));
528 
529  QToolBar* toolOffsetToolBar = this->registerToolBar("Tool Offset");
530  SpinBoxAndSliderGroupWidget* offsetWidget = new SpinBoxAndSliderGroupWidget(this, DoublePropertyActiveToolOffset::create());
531  offsetWidget->showLabel(false);
532  toolOffsetToolBar->addWidget(offsetWidget);
533 
534  QToolBar* helpToolBar = this->registerToolBar("Help");
535  helpToolBar->addAction(mShowContextSensitiveHelpAction);
536 }
537 
538 QToolBar* MainWindow::registerToolBar(QString name, QString groupname)
539 {
540  QToolBar* toolbar = new QToolBar(name);
541  toolbar->setObjectName(QString(name).remove(" ")+"ToolBar");
542  mDockWidgets->registerToolBar(toolbar, groupname);
543  return toolbar;
544 }
545 
547 {
548  QString doc_path = DataLocations::getDocPath();
549  QString appName = qApp->applicationDisplayName();
550  QString url_website = DataLocations::getWebsiteURL();
551  QString url_license = QString("file://%1/license.txt").arg(doc_path);
552  QString url_config = QString("file://%1/cxConfigDescription.txt").arg(doc_path);
553 
554  QString text(""
555  "<h2>%1</h2>"
556  "<h4>%2</h4>"
557  "<p>A Research Platform for Image-Guided Therapy<p>"
558  "<p>%1 is NOT approved for medical use.<p>"
559  ""
560  "<p><a href=%3> website </a><p>"
561  "<p><a href=%4> license </a><p>"
562  "<p><a href=%5> configuration </a><p>");
563 
564  QMessageBox::about(this, tr("About %1").arg(appName), text
565  .arg(appName)
566  .arg(CustusX_VERSION_STRING)
567  .arg(url_website)
568  .arg(url_license)
569  .arg(url_config)
570  );
571 }
572 
574 {
575  PreferencesDialog prefDialog(mServices->visualizationService, mServices->patientModelService, this);
576  prefDialog.exec();
577 }
578 
579 void MainWindow::closeEvent(QCloseEvent *event)
580 {
581  QMainWindow::closeEvent(event);
582  qApp->quit();
583 }
584 
585 QDockWidget* MainWindow::addAsDockWidget(QWidget* widget, QString groupname)
586 {
587  QDockWidget* dw = mDockWidgets->addAsDockWidget(widget, groupname);
588  return dw;
589 
590 }
591 
592 }//namespace cx
Widget for controlling camera follow style.
void registerToolBar(QToolBar *toolbar, QString groupname="Toolbars")
void dockWidgetVisibilityChanged(bool val)
virtual QMenu * createPopupMenu()
ReporterPtr reporter()
Definition: cxReporter.cpp:59
void changeEvent(QEvent *event)
Statusbar with extended functionality.
Definition: cxStatusBar.h:92
void applicationStateChanged()
void showSecondaryViewLayoutWindowActionSlot()
void focusChanged(QWidget *old, QWidget *now)
void restoreFrom(const Desktop &desktop)
void patientChangedSlot()
static VisServicesPtr create(ctkPluginContext *context)
cxLogicManager_EXPORT StateServicePtr stateService()
Experimental class for IPad usage.This detached main window can be moved onto a secondary screen...
Widget for displaying status messages.
Widget for displaying and manipulating various 3D Volume properties.
void onApplicationStateChangedSlot()
void resetDesktopSlot()
void setValue(const QString &key, const QVariant &value)
Definition: cxSettings.cpp:79
GUI for setting up a connection to a video stream.
Widget for controlling the camera in the 3D view.This widget is designed for use on a touchpad device...
Experimental class for IPad usage.
void workflowStateAboutToChange()
void onGUIExtenderServiceAdded(GUIExtenderService *service)
void toggleFullScreenSlot()
void onGUIExtenderServiceRemoved(GUIExtenderService *service)
void preferencesSlot()
void saveDesktopSlot()
static QString getWebsiteURL()
QByteArray mMainWindowState
static LogicManager * getInstance()
Widget interface to PlaybackTime.
void onGUIExtenderServiceModified(GUIExtenderService *service)
void onShowContextSentitiveHelp()
Settings * settings()
Shortcut for accessing the settings instance.
Definition: cxSettings.cpp:42
Widget for displaying the FrameForest object.
Widget for displaying and manipulating TrackedStream properties.
static boost::shared_ptr< DoublePropertyActiveToolOffset > create()
Helper class for listening to services being added, modified and removed.
LogicManager * logicManager()
void workflowStateChanged()
Data class for CustusX desktop.
void showControlPanelActionSlot()
QAction * getAction(QString uid)
boost::shared_ptr< class CameraControl > CameraControlPtr
Definition: cxMainWindow.h:58
QString mLayoutUid
cxLogicManager_EXPORT ViewServicePtr viewService()
virtual ~MainWindow()
virtual std::vector< QToolBar * > createToolBars() const
cxLogicManager_EXPORT PatientModelServicePtr patientService()
QString mSecondaryLayoutUid
Designed as a debugging widget for the cxToolManager.
virtual std::vector< CategorizedWidget > createWidgets() const =0
QDockWidget * addAsDockWidget(QWidget *widget, QString groupname, QObject *owningPlugin=NULL)
void onWorkflowStateChangedSlot()
static QString getDocPath()
return path to folder containing documentation files
Widget for displaying information about meshes.
Set application preferences.
boost::shared_ptr< Audio > AudioPtr
Definition: cxAudio.h:68
void isSaving(QDomElement &root)
xml storage is available
Widget for erasing parts of images/meshes.