33 #include <QMainWindow>
34 #include <QSplashScreen>
35 #include <QtCore/QSettings>
36 #include <boost/signals2/signal.hpp>
37 #include <boost/thread.hpp>
39 #include "WIconManager.h"
40 #include "WQtGLWidget.h"
41 #include "WQtMessageDock.h"
42 #include "WQtToolBar.h"
43 #include "WSettingAction.h"
44 #include "networkEditor/WQtNetworkEditor.h"
52 class WQtCustomDockWidget;
113 boost::signals2::signal< void( std::vector< std::string > ) >*
getLoaderSignal();
162 static void setSetting( std::string key, std::string value );
203 void reportError( QWidget* parent, QString title, QString message );
212 void reportWarning( QWidget* parent, QString title, QString message );
221 void reportInfo( QWidget* parent, QString title, QString message );
313 virtual bool projectSave(
const std::vector< std::shared_ptr< WProjectFileIO > >& writer );
503 void autoAdd( std::shared_ptr< WModule > module, std::string proto,
bool onlyOnce =
false );
527 void slotLoadFinished( boost::filesystem::path file, std::vector< std::string > errors, std::vector< std::string > warnings );
This class contains the main window and the layout of the widgets within the window.
WQtToolBar * m_permanentToolBar
The permanent toolbar of the main window.
void handleDrop(QDropEvent *event)
Handles the given drop.
void showWelcomeDialog(bool force=true)
Shows the welcome message.
WThreadedRunner::SPtr m_closeStage1Thread
The thread responsible for doing stage 1 stuff.
QAction * m_loadButton
the load button
WSettingAction * m_sliderMinMaxEditSetting
The action for allowing editing min and max of sliders.
void deregisterCustomWidget(WUIQtWidgetBase *widget)
De-register a custom widget.
WQtControlPanel * getControlPanel()
Returns a pointer to the control panel object.
void openAboutDialog()
gets called when menu entry "About OpenWalnut" is activated
QAction * m_settingsAction
the settings
std::shared_ptr< WQtNavGLWidget > m_navAxial
the axial view widget GL widget of the GUI
bool projectSaveCameraOnly()
Gets called by the save menu to only save the camera settings.
void closeCustomDockWidget(std::string title)
Close one of the custom dock widget saved in the map of customDockWidgets.
bool projectSaveAll()
Gets called whenever the user presses the project save button.
std::shared_ptr< WQtNavGLWidget > m_navCoronal
the coronal view widget GL widget of the GUI
void saveWindowState()
Saves the current window states and geometries to a file.
QAction * m_quitAction
quit OpenWalnut
QMenu * m_viewMenu
view and camera control menu
QSplashScreen * getSplash() const
Get the current splash screen.
QMenu * m_settingsMenu
the settings
WQtGLDockWidget * m_mainGLDock
the dock containing the main gl widget
void handleGLVendor()
Handles some special GL vendors and shows the user a dialog.
void openOpenWalnutHelpDialog()
Gets called when menu entry "OpenWalnut Help" is activated.
void closeStage2()
The second stage function.
void moduleSpecificCleanup(std::shared_ptr< WModule > module)
Cleanup the GUI by handling special modules.
void handleLogLevelUpdate(unsigned int logLevel)
Is able to handle updates in the log-level setting.
void setupGUI()
Set up all widgets menus an buttons in the main window.
QSplashScreen * m_splash
The splash screen object opened on startup.
static bool isDropAcceptable(const QMimeData *mimeData)
This method checks whether a given drop event is acceptable.
void moduleSpecificSetup(std::shared_ptr< WModule > module)
Setup the GUI by handling special modules.
void newRoi()
gets called when the button new ROI is pressed
QAction * m_newAction
the new project button
WQtMessageDock * m_messageDock
Message and log window.
void registerCustomWidget(WUIQtWidgetBase *widget)
Register a custom widget.
void openLoadDialog()
gets called when menu option or toolbar button load is activated
WIconManager * getIconManager()
Return icon manager.
void closeStage1Thread()
The actual thread function for m_closeStage1Thread.
WQtControlPanel * m_controlPanel
control panel
QMainWindow * m_glDock
the dock that is used for gl widgets
virtual void customEvent(QEvent *event)
Handle custom events.
QMainWindow * getDefaultCustomDockAreaWidget() const
The Widget to add custom docks.
QMenu * m_saveMenu
the menu using m_saveAction
bool projectSaveROIOnly()
Gets called by the save menu to only save the ROI settings.
void dropEvent(QDropEvent *event)
drag and drop implementation for loading files
void reportWarning(QWidget *parent, QString title, QString message)
Allows comfortable warning reporting using popups.
bool projectSaveModuleOnly()
Gets called by the save menu to only save the Module settings.
QMenu * m_helpMenu
the help menu
WSharedSequenceContainer< CustomWidgets > m_customWidgets
All registered widgets created by the core/UI api.
void dragEnterEvent(QDragEnterEvent *event)
drag and drop implementation for loading files
bool m_closeFirstStage
Used to handle the two-stage close process.
void setCompatiblesToolbar(WQtCombinerToolbar *toolbar=NULL)
This method removes the old compatibles toolbar and sets the specified one.
void addGlobalMenu(QWidget *widget)
Add the default OW menu to the given widget using addAction.
void slotLoadFinished(boost::filesystem::path file, std::vector< std::string > errors, std::vector< std::string > warnings)
Called whenever a async load has finished.
bool m_closeInProgress
Flag whether the system is shutting down now.
QDockWidget * m_dummyWidget
The dummywidget serves as spacer in the dockwidget area;.
void reportInfo(QWidget *parent, QString title, QString message)
Allows comfortable info reporting using popups.
virtual ~WMainWindow()
Destructor.
Qt::DockWidgetArea getDefaultCustomDockArea() const
The default dock area to use for adding custom docks.
void closeSplash()
Finally closes the splash screen.
void asyncProjectLoad(std::string filename)
Loads a given project asynchronously.
void reportError(QWidget *parent, QString title, QString message)
Allows comfortable error reporting using popups.
virtual bool projectSave(const std::vector< std::shared_ptr< WProjectFileIO > > &writer)
Called for each project save request.
static void setSetting(std::string key, std::string value)
Set a setting specified by a key to a given value.
WQtNetworkEditor * m_networkEditor
network editor
std::shared_ptr< WQtCustomDockWidget > getCustomDockWidget(std::string name)
Searches for a custom dock widget with a given name and returns it, if found.
boost::signals2::signal< void(std::vector< std::string >) > * getLoaderSignal()
Returns a pointer to a signal object which signals a list of filenames to load.
std::shared_ptr< WQtNavGLWidget > m_navSagittal
the sgittal view widget GL widget of the GUI
WQtGLWidget * m_mainGLWidget
the main GL widget of the GUI
std::vector< WUIQtWidgetBase * > CustomWidgets
Container for core/UI widgetd.
WQtCombinerToolbar * getCompatiblesToolbar()
This method returns the a pointer to the current compatibles toolbar.
void restoreSavedState()
Loads the window states and geometries from a file.
QAction * m_saveAction
the save menu
WQtCombinerToolbar * m_currentCompatiblesToolbar
The currently set compatibles toolbar.
virtual void closeEvent(QCloseEvent *e)
We want to react on close events.
void openNotImplementedDialog()
Gets called when a menu entry that has no functionality yet is activated.
void handleStartMessages()
Shows startup info messages.
const WQtMessageDock * getMessageDock() const
Return the message dock widget.
static QSettings & getSettings()
Returns the settings object.
QAction * m_helpAction
the help menu
boost::signals2::signal< void(std::vector< std::string >) > m_loaderSignal
boost signal for open file dialog
QMenuBar * m_menuBar
The main menu bar of the GUI.
void newProject()
Slot handling the pressed new project button.
void openAboutQtDialog()
Gets called when menu entry "About Qt" is activated.
WIconManager m_iconManager
manager to provide icons in the gui thread
void dragMoveEvent(QDragMoveEvent *event)
drag and drop implementation for loading files
WQtNetworkEditor * getNetworkEditor()
Returns a pointer to the network editor object.
void switchVisibility(QWidget *who)
Change visibility of the given widget.
void autoAdd(std::shared_ptr< WModule > module, std::string proto, bool onlyOnce=false)
Combine a module with a prototype only if the module is available.
virtual bool event(QEvent *event)
Custom event dispatcher.
WMainWindow(QSplashScreen *splash)
Constructor of the main window.
Class representing a single module of OpenWalnut.
A base class for all parts of OpenWalnut which can be serialized to a project file.
Abstract base class for all properties.
container widget for a tree widget with context menu and some control widgets
This class is a screen recorder adapter in QT.
Dock widget for showing messages and logs.
Container widget to hold the WQtNetworkScene.
Implements a property action for WPropBool.
Class to handle a certain setting with an action.
std::shared_ptr< WThreadedRunner > SPtr
Abbreviation to a shared_ptr to this type.