NorMIT-nav  16.5
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 "cxFiltersWidget.h"
74 #include "cxManageClippersWidget.h"
75 #include "cxBrowserWidget.h"
76 #include "cxActiveToolProxy.h"
77 
78 namespace cx
79 {
80 
82  mFullScreenAction(NULL),
83  mStandard3DViewActions(new QActionGroup(this)),
84  mControlPanel(NULL),
85  mDockWidgets(new DynamicMainWindowWidgets(this)),
86  mActions(NULL)
87 {
88  this->setObjectName("MainWindow");
89 
90  mServices = VisServices::create(logicManager()->getPluginContext());
91  mLayoutInteractor.reset(new LayoutInteractor());
92 
93  this->setCentralWidget(viewService()->createLayoutWidget(this, 0));
94 
95  mActions = new MainWindowActions(mServices, this);
96 
97  this->createActions();
98  this->createMenus();
99  this->createToolBars();
100  this->setStatusBar(new StatusBar());
101 
102  reporter()->setAudioSource(AudioPtr(new AudioImpl()));
103 
107 
108  this->updateWindowTitle();
109 
110  this->setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North);
111 
112  this->addAsDockWidget(new PlaybackWidget(this), "Browsing");
113  this->addAsDockWidget(new VideoConnectionWidget(mServices, this), "Utility");
114  this->addAsDockWidget(new EraserWidget(mServices->patient(), mServices->view(), this), "Properties");
115  this->addAsDockWidget(new MetricWidget(mServices->view(), mServices->patient(), this), "Utility");
116  this->addAsDockWidget(new SlicePropertiesWidget(mServices->patient(), mServices->view(), this), "Properties");
117  this->addAsDockWidget(new VolumePropertiesWidget(mServices, this), "Properties");
118  this->addAsDockWidget(new ActiveMeshPropertiesWidget(mServices, this), "Properties");
119  this->addAsDockWidget(new StreamPropertiesWidget(mServices->patient(), mServices->view(), this), "Properties");
120  this->addAsDockWidget(new TrackPadWidget(this), "Utility");
121  this->addAsDockWidget(new ActiveToolPropertiesWidget(mServices->tracking(), mServices->spaceProvider(), this), "Properties");
122  this->addAsDockWidget(new NavigationWidget(this), "Properties");
123  this->addAsDockWidget(new ConsoleWidget(this, "ConsoleWidget", "Console"), "Utility");
124  this->addAsDockWidget(new ConsoleWidget(this, "ConsoleWidget2", "Extra Console"), "Utility");
125 // this->addAsDockWidget(new ConsoleWidgetCollection(this, "ConsoleWidgets", "Consoles"), "Utility");
126  this->addAsDockWidget(new FrameTreeWidget(mServices->patient(), this), "Browsing");
127  this->addAsDockWidget(new ToolManagerWidget(this), "Debugging");
128  this->addAsDockWidget(new PluginFrameworkWidget(this), "Browsing");
129  this->addAsDockWidget(new FiltersWidget(VisServices::create(logicManager()->getPluginContext()), this), "Algorithms");
130  this->addAsDockWidget(new ClippingPropertiesWidget(mServices, this), "Properties");
131 
132  this->addAsDockWidget(new BrowserWidget(this, mServices), "Browsing");
133 
135  connect(qApp, &QApplication::focusChanged, this, &MainWindow::focusChanged);
136 
137  this->setupGUIExtenders();
138 
139  // window menu must be created after all dock widgets are created
140  QMenu* popupMenu = this->createPopupMenu();
141  popupMenu->setTitle("Window");
142  this->menuBar()->insertMenu(mHelpMenuAction, popupMenu);
143 
144  // show after window has been initialized
145  QTimer::singleShot(0, this, SLOT(delayedShow()));
146 }
147 
149 {
150  // Restore saved window states
151  // Must be done after all DockWidgets are created
152  if (restoreGeometry(settings()->value("mainWindow/geometry").toByteArray()))
153  {
154  this->show();
155  }
156  else
157  {
158  this->showMaximized();
159  }
160 
161  if (settings()->value("gui/fullscreen").toBool())
162  {
163  this->setWindowState(this->windowState() | Qt::WindowFullScreen);
164  }
165 }
166 
167 void MainWindow::changeEvent(QEvent * event)
168 {
169  QMainWindow::changeEvent(event);
170 
171  if (event->type() == QEvent::WindowStateChange)
172  {
173  if (mFullScreenAction)
174  mFullScreenAction->setChecked(this->windowState() & Qt::WindowFullScreen);
175  }
176 }
177 
178 void MainWindow::setupGUIExtenders()
179 {
180  mServiceListener.reset(new ServiceTrackerListener<GUIExtenderService>(
181  LogicManager::getInstance()->getPluginContext(),
182  boost::bind(&MainWindow::onGUIExtenderServiceAdded, this, _1),
183  boost::bind(&MainWindow::onGUIExtenderServiceModified, this, _1),
184  boost::bind(&MainWindow::onGUIExtenderServiceRemoved, this, _1)
185  ));
186  mServiceListener->open();
187 }
188 
190 {
191  std::vector<GUIExtenderService::CategorizedWidget> widgets = service->createWidgets();
192  for (unsigned j = 0; j < widgets.size(); ++j)
193  {
194  mDockWidgets->addAsDockWidget(widgets[j].mWidget, widgets[j].mCategory, service);
195  }
196 
197  std::vector<QToolBar*> toolBars = service->createToolBars();
198  for(unsigned j = 0; j < toolBars.size(); ++j)
199  {
200  mDockWidgets->registerToolBar(toolBars[j]);
201  }
202 }
203 
205 {
206 }
207 
209 {
210  mDockWidgets->owningServiceRemoved(service);
211 }
212 
214 {
215  if (val)
216  this->focusInsideDockWidget(sender());
217 }
218 
219 void MainWindow::focusChanged(QWidget * old, QWidget * now)
220 {
221  this->focusInsideDockWidget(now);
222 }
223 
224 void MainWindow::focusInsideDockWidget(QObject *dockWidget)
225 {
226  if (!dockWidget)
227  return;
228 
229 // CX_LOG_CHANNEL_DEBUG("HELP_DB") << QString(" try mw::focus [%1](%2)")
230 // .arg(dockWidget->objectName())
231 // .arg(dockWidget->metaObject()->className());
232 
233  // focusing to docked widgets is required by the help system
234 
235  // Assume structure: QDockWidget->QScrollArea->QWidget,
236  // as defined in MainWindow::addAsDockWidget()
237  QDockWidget* dw = dynamic_cast<QDockWidget*>(dockWidget);
238  if (!dw)
239  return;
240  if (dw->parent()!=this) // avoid events from other mainwindows
241  return;
242  QScrollArea* sa = dynamic_cast<QScrollArea*>(dw->widget());
243  if (!sa)
244  return;
245 
246  if (!sa->widget())
247  return;
248 
249 // CX_LOG_CHANNEL_DEBUG("HELP_DB") << QString(" do mw::focus [%1](%2)")
250 // .arg(sa->widget()->objectName())
251 // .arg(sa->widget()->metaObject()->className());
252 
253  QTimer::singleShot(0, sa->widget(), SLOT(setFocus())); // avoid loops etc by send async event.
254 }
255 
257 {
258  viewService()->deactivateLayout();
259  reporter()->setAudioSource(AudioPtr()); // important! QSound::play fires a thread, causes segfault during shutdown
260  mServiceListener.reset();
261 }
262 
264 {
265  return mDockWidgets->createPopupMenu();
266 }
267 
268 void MainWindow::createActions()
269 {
270  CameraControlPtr cameraControl = viewService()->getCameraControl();
271  if (cameraControl)
272  mStandard3DViewActions = cameraControl->createStandard3DViewActions();
273 
274  mShowContextSensitiveHelpAction = new QAction(QIcon(":/icons/open_icon_library/help-contents-5.png"),
275  "Context-sensitive help", this);
276  connect(mShowContextSensitiveHelpAction, &QAction::triggered, this, &MainWindow::onShowContextSentitiveHelp);
277 
278  mShowControlPanelAction = new QAction("Show Control Panel", this);
279  connect(mShowControlPanelAction, &QAction::triggered, this, &MainWindow::showControlPanelActionSlot);
280  mSecondaryViewLayoutWindowAction = new QAction("Show Secondary View Layout Window", this);
281  connect(mSecondaryViewLayoutWindowAction, &QAction::triggered, this, &MainWindow::showSecondaryViewLayoutWindowActionSlot);
282 
283  // Application
284  mAboutAction = new QAction(tr("About"), this);
285  mAboutAction->setStatusTip(tr("Show the application's About box"));
286  mPreferencesAction = new QAction(tr("Preferences"), this);
287  mPreferencesAction->setShortcut(tr("Ctrl+,"));
288  mPreferencesAction->setStatusTip(tr("Show the preferences dialog"));
289 
290  mFullScreenAction = new QAction(tr("Fullscreen"), this);
291  mFullScreenAction->setShortcut(tr("F11"));
292  mFullScreenAction->setStatusTip(tr("Toggle full screen"));
293  mFullScreenAction->setCheckable(true);
294  mFullScreenAction->setChecked(this->windowState() & Qt::WindowFullScreen);
295  connect(mFullScreenAction, &QAction::triggered, this, &MainWindow::toggleFullScreenSlot);
296 
297  mQuitAction = new QAction(tr("&Quit"), this);
298  mQuitAction->setShortcut(tr("Ctrl+Q"));
299  mQuitAction->setStatusTip(tr("Exit the application"));
300 
301  connect(mAboutAction, &QAction::triggered, this, &MainWindow::aboutSlot);
302  connect(mPreferencesAction, &QAction::triggered, this, &MainWindow::preferencesSlot);
303  connect(mQuitAction, &QAction::triggered, qApp, &QApplication::quit);
304 
305  mSaveDesktopAction = new QAction(QIcon(":/icons/workflow_state_save.png"), tr("Save desktop"), this);
306  mSaveDesktopAction->setToolTip("Save desktop for workflow step");
307  connect(mSaveDesktopAction, &QAction::triggered, this, &MainWindow::saveDesktopSlot);
308  mResetDesktopAction = new QAction(QIcon(":/icons/workflow_state_revert.png"), tr("Reset desktop"), this);
309  mResetDesktopAction->setToolTip("Reset desktop for workflow step");
310  connect(mResetDesktopAction, &QAction::triggered, this, &MainWindow::resetDesktopSlot);
311 
312  mInteractorStyleActionGroup = viewService()->getInteractorStyleActionGroup();
313 
314  // cross-connect save patient to save session
315  connect(mServices->session().get(), &SessionStorageService::isSaving, this, &MainWindow::saveDesktopSlot);
316 }
317 
318 
320 {
321  this->updateWindowTitle();
322 }
323 
324 void MainWindow::updateWindowTitle()
325 {
326  QString profileName = stateService()->getApplicationStateName();
327  QString versionName = stateService()->getVersionName();
328 
329  QString activePatientFolder = patientService()->getActivePatientFolder();
330  if (activePatientFolder.endsWith('/'))
331  activePatientFolder.chop(1);
332  QString patientName;
333 
334  if (!activePatientFolder.isEmpty())
335  {
336  QFileInfo info(activePatientFolder);
337  patientName = info.completeBaseName();
338  }
339 
340  QString format("%1 %2 - %3 - %4 (not approved for medical use)");
341  QString title = format
342  .arg(qApp->applicationDisplayName())
343  .arg(versionName)
344  .arg(profileName)
345  .arg(patientName);
346  this->setWindowTitle(title);
347 }
348 
350 {
351  Desktop desktop = stateService()->getActiveDesktop();
352 
353  mDockWidgets->restoreFrom(desktop);
354  viewService()->setActiveLayout(desktop.mLayoutUid, 0);
355  viewService()->setActiveLayout(desktop.mSecondaryLayoutUid, 1);
356  patientService()->autoSave();
357 
358  // moved to help plugin:
359 // // set initial focus to mainwindow in order to view it in the documentation
360 // // this is most important when starting up.
361 // QTimer::singleShot(0, this, SLOT(setFocus())); // avoid loops etc by send async event.
362 
363 //#ifdef CX_APPLE
364 // // HACK
365 // // Toolbars are not correctly refreshed on mac 10.8,
366 // // Cause is related to QVTKWidget (removing it removes the problem)
367 // // The following "force refresh by resize" solves repaint, but
368 // // inactive toolbars are still partly clickable.
369 // QSize size = this->size();
370 // this->resize(size.width()-1, size.height());
371 // this->resize(size);
372 //#endif
373 }
374 
376 {
377  Desktop desktop;
378  desktop.mMainWindowState = this->saveState();
379  desktop.mLayoutUid = viewService()->getActiveLayout(0);
380  desktop.mSecondaryLayoutUid = viewService()->getActiveLayout(1);
381  stateService()->saveDesktop(desktop);
382 
383  // save to settings file in addition
384  settings()->setValue("mainWindow/geometry", saveGeometry());
385  settings()->setValue("mainWindow/windowState", saveState());
386  settings()->sync();
387 }
388 
390 {
391  stateService()->resetDesktop();
393 }
394 
396 {
397  mDockWidgets->showWidget("Help");
398 }
399 
401 {
402  this->setWindowState(this->windowState() ^ Qt::WindowFullScreen);
403 
404  settings()->setValue("gui/fullscreen", (this->windowState() & Qt::WindowFullScreen)!=0);
405 }
406 
408 {
409  if (!mControlPanel)
410  mControlPanel = new SecondaryMainWindow(this);
411  mControlPanel->show();
412 }
413 
415 {
416  if (!mSecondaryViewLayoutWindow)
417  mSecondaryViewLayoutWindow = new SecondaryViewLayoutWindow(this);
418  mSecondaryViewLayoutWindow->tryShowOnSecondaryScreen();
419 }
420 
422 {
423  this->updateWindowTitle();
424 }
425 
426 void MainWindow::createMenus()
427 {
428 #ifdef CX_LINUX
429  // shortcuts defined on actions in the global menubar is not reachable on Qt5+Ubuntu14.04,
430  // solve by reverting to old style.
431  // This will create a double menubar: remove by autohiding menubar or using
432  // sudo apt-get autoremove appmenu-gtk appmenu-gtk3 appmenu-qt
433  // and reboot
434  this->menuBar()->setNativeMenuBar(false);
435 #endif
436  mFileMenu = new QMenu(tr("File"), this);
437  mWorkflowMenu = new QMenu(tr("Workflow"), this);
438  mToolMenu = new QMenu(tr("Tracking"), this);
439  mLayoutMenu = new QMenu(tr("Layouts"), this);
440  mNavigationMenu = new QMenu(tr("Navigation"), this);
441  mHelpMenu = new QMenu(tr("Help"), this);
442 
443  // File
444  mFileMenu->addAction(mPreferencesAction);
445  this->menuBar()->addMenu(mFileMenu);
446  mFileMenu->addAction(mActions->getAction("NewPatient"));
447  mFileMenu->addAction(mActions->getAction("SaveFile"));
448  mFileMenu->addAction(mActions->getAction("LoadFile"));
449  mFileMenu->addAction(mActions->getAction("ClearPatient"));
450  mFileMenu->addSeparator();
451  mFileMenu->addAction(mActions->getAction("ExportPatient"));
452  mFileMenu->addAction(mActions->getAction("ImportData"));
453  mFileMenu->addSeparator();
454  mFileMenu->addAction(mFullScreenAction);
455  mFileMenu->addAction(mActions->getAction("StartLogConsole"));
456  mFileMenu->addAction(mActions->getAction("ShootScreen"));
457  mFileMenu->addAction(mActions->getAction("ShootWindow"));
458  mFileMenu->addAction(mActions->getAction("RecordFullscreen"));
459  mFileMenu->addSeparator();
460  mFileMenu->addAction(mShowControlPanelAction);
461  mFileMenu->addAction(mSecondaryViewLayoutWindowAction);
462 
463  mFileMenu->addAction(mQuitAction);
464 
465  //workflow
466  this->menuBar()->addMenu(mWorkflowMenu);
467  QList<QAction*> actions = stateService()->getWorkflowActions()->actions();
468  for (int i=0; i<actions.size(); ++i)
469  {
470  mWorkflowMenu->addAction(actions[i]);
471  }
472 
473  mWorkflowMenu->addSeparator();
474  mWorkflowMenu->addAction(mSaveDesktopAction);
475  mWorkflowMenu->addAction(mResetDesktopAction);
476 
477  //tool
478  this->menuBar()->addMenu(mToolMenu);
479  mToolMenu->addAction(mActions->getAction("ConfigureTools"));
480  mToolMenu->addAction(mActions->getAction("InitializeTools"));
481  mToolMenu->addAction(mActions->getAction("TrackingTools"));
482  mToolMenu->addSeparator();
483  mToolMenu->addAction(mActions->getAction("StartStreaming"));
484  mToolMenu->addSeparator();
485 
486  //layout
487  this->menuBar()->addMenu(mLayoutMenu);
488  mLayoutInteractor->connectToMenu(mLayoutMenu);
489 
490  this->menuBar()->addMenu(mNavigationMenu);
491  mNavigationMenu->addAction(mActions->getAction("CenterToImageCenter"));
492  mNavigationMenu->addAction(mActions->getAction("CenterToTooltip"));
493  mNavigationMenu->addAction(mActions->getAction("ShowPointPicker"));
494  mNavigationMenu->addSeparator();
495  mNavigationMenu->addActions(mInteractorStyleActionGroup->actions());
496 
497  mHelpMenuAction = this->menuBar()->addMenu(mHelpMenu);
498  mHelpMenu->addAction(mAboutAction);
499  mHelpMenu->addAction(mActions->getAction("GotoDocumentation"));
500  mHelpMenu->addAction(mShowContextSensitiveHelpAction);
501 }
502 
503 void MainWindow::createToolBars()
504 {
505  mWorkflowToolBar = this->registerToolBar("Workflow");
506  QList<QAction*> actions = stateService()->getWorkflowActions()->actions();
507  for (int i=0; i<actions.size(); ++i)
508  mWorkflowToolBar->addAction(actions[i]);
509 
510  mDataToolBar = this->registerToolBar("Data");
511  mDataToolBar->addAction(mActions->getAction("NewPatient"));
512  mDataToolBar->addAction(mActions->getAction("LoadFile"));
513  mDataToolBar->addAction(mActions->getAction("SaveFile"));
514  mDataToolBar->addAction(mActions->getAction("ImportData"));
515 
516  mToolToolBar = this->registerToolBar("Tools");
517  mToolToolBar->addAction(mActions->getAction("TrackingTools"));
518  mToolToolBar->addAction(mActions->getAction("StartStreaming"));
519 
520  mNavigationToolBar = this->registerToolBar("Navigation");
521  mNavigationToolBar->addAction(mActions->getAction("CenterToImageCenter"));
522  mNavigationToolBar->addAction(mActions->getAction("CenterToTooltip"));
523  mNavigationToolBar->addAction(mActions->getAction("ShowPointPicker"));
524 
525  mInteractorStyleToolBar = this->registerToolBar("InteractorStyle");
526  mInteractorStyleToolBar->addActions(mInteractorStyleActionGroup->actions());
527 
528  mDesktopToolBar = this->registerToolBar("Desktop");
529  mDesktopToolBar->addAction(mSaveDesktopAction);
530  mDesktopToolBar->addAction(mResetDesktopAction);
531 
532  mScreenshotToolBar = this->registerToolBar("Screenshot");
533  mScreenshotToolBar->addAction(mActions->getAction("ShootScreen"));
534  mScreenshotToolBar->addAction(mActions->getAction("RecordFullscreen"));
535 
536  QToolBar* camera3DViewToolBar = this->registerToolBar("Camera 3D Views");
537  camera3DViewToolBar->addActions(mStandard3DViewActions->actions());
538 
539  QToolBar* samplerWidgetToolBar = this->registerToolBar("Sampler");
540  samplerWidgetToolBar->addWidget(new SamplerWidget(this));
541 
542  QToolBar* toolOffsetToolBar = this->registerToolBar("Tool Offset");
544  SpinBoxAndSliderGroupWidget* offsetWidget = new SpinBoxAndSliderGroupWidget(this, offset);
545  offsetWidget->showLabel(false);
546  toolOffsetToolBar->addWidget(offsetWidget);
547 
548  QToolBar* helpToolBar = this->registerToolBar("Help");
549  helpToolBar->addAction(mShowContextSensitiveHelpAction);
550 }
551 
552 QToolBar* MainWindow::registerToolBar(QString name, QString groupname)
553 {
554  QToolBar* toolbar = new QToolBar(name);
555  toolbar->setObjectName(QString(name).remove(" ")+"ToolBar");
556  mDockWidgets->registerToolBar(toolbar, groupname);
557  return toolbar;
558 }
559 
561 {
562  QString doc_path = DataLocations::getDocPath();
563  QString appName = qApp->applicationDisplayName();
564  QString url_website = DataLocations::getWebsiteURL();
565  QString url_license = QString("file://%1/License.txt").arg(doc_path);
566  QString url_config = QString("file://%1/cxConfigDescription.txt").arg(doc_path);
567 
568  QString text(""
569  "<h2>%1</h2>"
570  "<h4>%2</h4>"
571  "<p>A Research Platform for Image-Guided Therapy<p>"
572  "<p>%1 is NOT approved for medical use.<p>"
573  ""
574  "<p><a href=%3> website </a><p>"
575  "<p><a href=%4> license </a><p>"
576  "<p><a href=%5> configuration </a><p>");
577 
578  QMessageBox::about(this, tr("About %1").arg(appName), text
579  .arg(appName)
580  .arg(CustusX_VERSION_STRING)
581  .arg(url_website)
582  .arg(url_license)
583  .arg(url_config)
584  );
585 }
586 
588 {
589  PreferencesDialog prefDialog(mServices->view(), mServices->patient(), this);
590  prefDialog.exec();
591 }
592 
593 void MainWindow::closeEvent(QCloseEvent *event)
594 {
595  QMainWindow::closeEvent(event);
596  qApp->quit();
597 }
598 
599 QDockWidget* MainWindow::addAsDockWidget(QWidget* widget, QString groupname)
600 {
601  QDockWidget* dw = mDockWidgets->addAsDockWidget(widget, groupname);
602  return dw;
603 
604 }
605 
606 }//namespace cx
Widget for controlling camera follow style.
void registerToolBar(QToolBar *toolbar, QString groupname="Toolbars")
void dockWidgetVisibilityChanged(bool val)
Widget for displaying and changing clipper properties.
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()
Shows a treestructure containing the loaded images, meshes and tools.
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()
static ActiveToolProxyPtr New(TrackingServicePtr trackingService)
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)
boost::shared_ptr< class DoublePropertyBase > DoublePropertyBasePtr
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.
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.
static boost::shared_ptr< DoublePropertyActiveToolOffset > create(ActiveToolProxyPtr activeTool)
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
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.