Toolbar and menu refinements

Added Snapshot actions to a new toolbar.
Moved the snapshot file actions from debug menu to File->Export
Moved the Snapshot to Clip board to Edit menu.
Moved create new Project tree and Property editor action to Windows menu
Added a separator in the Windwsmenu after the "fixed Docks"
Set unique names on the additional Prop and Project doc windows
p4#: 21326
This commit is contained in:
Jacob Støren 2013-04-17 10:59:34 +02:00
parent ec2754ce30
commit 2280a8cbfa
4 changed files with 78 additions and 44 deletions

View File

@ -36,6 +36,7 @@
<file>draw_style_surface_24x24.png</file> <file>draw_style_surface_24x24.png</file>
<file>SnapShot.png</file> <file>SnapShot.png</file>
<file>SnapShotSave.png</file> <file>SnapShotSave.png</file>
<file>SnapShotSaveViews.png</file>
</qresource> </qresource>
<qresource prefix="/Shader/"> <qresource prefix="/Shader/">
<file>fs_CellFace.glsl</file> <file>fs_CellFace.glsl</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -176,7 +176,7 @@ void RiuMainWindow::closeEvent(QCloseEvent* event)
void RiuMainWindow::createActions() void RiuMainWindow::createActions()
{ {
// File actions // File actions
m_openAction = new QAction(QIcon(":/AppLogo48x48.png"), "&Open Eclipse Case", this); m_openEclipseCaseAction = new QAction(QIcon(":/AppLogo48x48.png"), "&Open Eclipse Case", this);
m_openInputEclipseFileAction= new QAction(QIcon(":/EclipseInput48x48.png"), "&Open Input Eclipse Case", this); m_openInputEclipseFileAction= new QAction(QIcon(":/EclipseInput48x48.png"), "&Open Input Eclipse Case", this);
m_openMultipleEclipseCasesAction = new QAction(QIcon(":/CreateGridCaseGroup16x16.png"), "&Create Grid Case Group from Files", this); m_openMultipleEclipseCasesAction = new QAction(QIcon(":/CreateGridCaseGroup16x16.png"), "&Create Grid Case Group from Files", this);
@ -188,17 +188,17 @@ void RiuMainWindow::createActions()
m_mockLargeResultsModelAction = new QAction("Large Mock Model", this); m_mockLargeResultsModelAction = new QAction("Large Mock Model", this);
m_mockInputModelAction = new QAction("Input Mock Model", this); m_mockInputModelAction = new QAction("Input Mock Model", this);
m_snapshotToFile = new QAction("Snapshot To File", this); m_snapshotToFile = new QAction(QIcon(":/SnapShotSave.png"), "Snapshot To File", this);
m_snapshotToClipboard = new QAction("Snapshot To Clipboard", this); m_snapshotToClipboard = new QAction(QIcon(":/SnapShot.png"), "Copy Snapshot To Clipboard", this);
m_snapshotAllViewsToFile = new QAction("Snapshot All Views To File", this); m_snapshotAllViewsToFile = new QAction(QIcon(":/SnapShotSaveViews.png"), "Snapshot All Views To File", this);
m_saveProjectAction = new QAction(QIcon(":/Save.png"), "&Save Project", this); m_saveProjectAction = new QAction(QIcon(":/Save.png"), "&Save Project", this);
m_saveProjectAsAction = new QAction(QIcon(":/Save.png"), "Save Project &As", this); m_saveProjectAsAction = new QAction(QIcon(":/Save.png"), "Save Project &As", this);
m_closeAction = new QAction("&Close", this); m_closeProjectAction = new QAction("&Close Project", this);
m_exitAction = new QAction("E&xit", this); m_exitAction = new QAction("E&xit", this);
connect(m_openAction, SIGNAL(triggered()), SLOT(slotOpenBinaryGridFiles())); connect(m_openEclipseCaseAction, SIGNAL(triggered()), SLOT(slotOpenBinaryGridFiles()));
connect(m_openInputEclipseFileAction,SIGNAL(triggered()), SLOT(slotOpenInputFiles())); connect(m_openInputEclipseFileAction,SIGNAL(triggered()), SLOT(slotOpenInputFiles()));
connect(m_openMultipleEclipseCasesAction,SIGNAL(triggered()), SLOT(slotOpenMultipleCases())); connect(m_openMultipleEclipseCasesAction,SIGNAL(triggered()), SLOT(slotOpenMultipleCases()));
connect(m_openProjectAction, SIGNAL(triggered()), SLOT(slotOpenProject())); connect(m_openProjectAction, SIGNAL(triggered()), SLOT(slotOpenProject()));
@ -216,7 +216,7 @@ void RiuMainWindow::createActions()
connect(m_saveProjectAction, SIGNAL(triggered()), SLOT(slotSaveProject())); connect(m_saveProjectAction, SIGNAL(triggered()), SLOT(slotSaveProject()));
connect(m_saveProjectAsAction, SIGNAL(triggered()), SLOT(slotSaveProjectAs())); connect(m_saveProjectAsAction, SIGNAL(triggered()), SLOT(slotSaveProjectAs()));
connect(m_closeAction, SIGNAL(triggered()), SLOT(slotCloseProject())); connect(m_closeProjectAction, SIGNAL(triggered()), SLOT(slotCloseProject()));
connect(m_exitAction, SIGNAL(triggered()), QApplication::instance(), SLOT(closeAllWindows())); connect(m_exitAction, SIGNAL(triggered()), QApplication::instance(), SLOT(closeAllWindows()));
@ -250,7 +250,7 @@ void RiuMainWindow::createActions()
connect(m_zoomAll, SIGNAL(triggered()), SLOT(slotZoomAll())); connect(m_zoomAll, SIGNAL(triggered()), SLOT(slotZoomAll()));
// Debug actions // Debug actions
m_newPropertyView = new QAction("New Property View", this); m_newPropertyView = new QAction("New Project and Property View", this);
connect(m_newPropertyView, SIGNAL(triggered()), SLOT(slotNewObjectPropertyView())); connect(m_newPropertyView, SIGNAL(triggered()), SLOT(slotNewObjectPropertyView()));
// Help actions // Help actions
@ -266,18 +266,26 @@ void RiuMainWindow::createMenus()
{ {
// File menu // File menu
QMenu* fileMenu = menuBar()->addMenu("&File"); QMenu* fileMenu = menuBar()->addMenu("&File");
fileMenu->addAction(m_openAction);
fileMenu->addAction(m_openInputEclipseFileAction);
fileMenu->addAction(m_openMultipleEclipseCasesAction);
fileMenu->addAction(m_openProjectAction); fileMenu->addAction(m_openProjectAction);
fileMenu->addAction(m_openLastUsedProjectAction); fileMenu->addAction(m_openLastUsedProjectAction);
fileMenu->addSeparator();
QMenu* importMenu = fileMenu->addMenu("&Import");
importMenu->addAction(m_openEclipseCaseAction);
importMenu->addAction(m_openInputEclipseFileAction);
importMenu->addAction(m_openMultipleEclipseCasesAction);
QMenu* exportMenu = fileMenu->addMenu("&Export");
exportMenu->addAction(m_snapshotToFile);
exportMenu->addAction(m_snapshotAllViewsToFile);
fileMenu->addSeparator(); fileMenu->addSeparator();
fileMenu->addAction(m_saveProjectAction); fileMenu->addAction(m_saveProjectAction);
fileMenu->addAction(m_saveProjectAsAction); fileMenu->addAction(m_saveProjectAsAction);
fileMenu->addSeparator(); fileMenu->addSeparator();
fileMenu->addAction(m_closeAction); fileMenu->addAction(m_closeProjectAction);
fileMenu->addSeparator(); fileMenu->addSeparator();
fileMenu->addAction(m_exitAction); fileMenu->addAction(m_exitAction);
@ -285,7 +293,10 @@ void RiuMainWindow::createMenus()
// Edit menu // Edit menu
QMenu* editMenu = menuBar()->addMenu("&Edit"); QMenu* editMenu = menuBar()->addMenu("&Edit");
editMenu->addAction(m_snapshotToClipboard);
editMenu->addSeparator();
editMenu->addAction(m_editPreferences); editMenu->addAction(m_editPreferences);
connect(editMenu, SIGNAL(aboutToShow()), SLOT(slotRefreshEditActions())); connect(editMenu, SIGNAL(aboutToShow()), SLOT(slotRefreshEditActions()));
@ -299,8 +310,6 @@ void RiuMainWindow::createMenus()
viewMenu->addAction(m_viewFromEast); viewMenu->addAction(m_viewFromEast);
viewMenu->addAction(m_viewFromBelow); viewMenu->addAction(m_viewFromBelow);
viewMenu->addAction(m_viewFromAbove); viewMenu->addAction(m_viewFromAbove);
viewMenu->addSeparator();
viewMenu->addAction(m_newPropertyView);
connect(viewMenu, SIGNAL(aboutToShow()), SLOT(slotRefreshViewActions())); connect(viewMenu, SIGNAL(aboutToShow()), SLOT(slotRefreshViewActions()));
@ -311,11 +320,6 @@ void RiuMainWindow::createMenus()
debugMenu->addAction(m_mockLargeResultsModelAction); debugMenu->addAction(m_mockLargeResultsModelAction);
debugMenu->addAction(m_mockInputModelAction); debugMenu->addAction(m_mockInputModelAction);
debugMenu->addSeparator();
debugMenu->addAction(m_snapshotToClipboard);
debugMenu->addAction(m_snapshotToFile);
debugMenu->addAction(m_snapshotAllViewsToFile);
connect(debugMenu, SIGNAL(aboutToShow()), SLOT(slotRefreshDebugActions())); connect(debugMenu, SIGNAL(aboutToShow()), SLOT(slotRefreshDebugActions()));
m_windowMenu = menuBar()->addMenu("&Windows"); m_windowMenu = menuBar()->addMenu("&Windows");
@ -336,16 +340,18 @@ void RiuMainWindow::createToolBars()
m_standardToolBar = addToolBar(tr("Standard")); m_standardToolBar = addToolBar(tr("Standard"));
m_standardToolBar->setObjectName(m_standardToolBar->windowTitle()); m_standardToolBar->setObjectName(m_standardToolBar->windowTitle());
m_standardToolBar->addAction(m_openAction); m_standardToolBar->addAction(m_openEclipseCaseAction);
m_standardToolBar->addAction(m_openInputEclipseFileAction); m_standardToolBar->addAction(m_openInputEclipseFileAction);
m_standardToolBar->addAction(m_openProjectAction); m_standardToolBar->addAction(m_openProjectAction);
//m_standardToolBar->addAction(m_openLastUsedProjectAction); //m_standardToolBar->addAction(m_openLastUsedProjectAction);
m_standardToolBar->addAction(m_saveProjectAction); m_standardToolBar->addAction(m_saveProjectAction);
// Create animation toolbar // Snapshots
m_animationToolBar = new caf::AnimationToolBar("Animation", this); m_snapshotToolbar = addToolBar(tr("View Snapshots"));
addToolBar(m_animationToolBar); m_snapshotToolbar->setObjectName(m_snapshotToolbar->windowTitle());
//connect(m_animationToolBar, SIGNAL(signalFrameRateChanged(double)), SLOT(slotFramerateChanged(double))); m_snapshotToolbar->addAction(m_snapshotToClipboard);
m_snapshotToolbar->addAction(m_snapshotToFile);
m_snapshotToolbar->addAction(m_snapshotAllViewsToFile);
// View toolbar // View toolbar
m_viewToolBar = addToolBar(tr("View")); m_viewToolBar = addToolBar(tr("View"));
@ -358,6 +364,11 @@ void RiuMainWindow::createToolBars()
m_viewToolBar->addAction(m_viewFromAbove); m_viewToolBar->addAction(m_viewFromAbove);
m_viewToolBar->addAction(m_viewFromBelow); m_viewToolBar->addAction(m_viewFromBelow);
// Create animation toolbar
m_animationToolBar = new caf::AnimationToolBar("Animation", this);
addToolBar(m_animationToolBar);
//connect(m_animationToolBar, SIGNAL(signalFrameRateChanged(double)), SLOT(slotFramerateChanged(double)));
refreshAnimationActions(); refreshAnimationActions();
} }
@ -369,7 +380,7 @@ void RiuMainWindow::createToolBars()
void RiuMainWindow::createDockPanels() void RiuMainWindow::createDockPanels()
{ {
{ {
QDockWidget* dockWidget = new QDockWidget("Project", this); QDockWidget* dockWidget = new QDockWidget("Project Tree", this);
dockWidget->setObjectName("dockWidget"); dockWidget->setObjectName("dockWidget");
dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
@ -388,6 +399,19 @@ void RiuMainWindow::createDockPanels()
addDockWidget(Qt::LeftDockWidgetArea, dockWidget); addDockWidget(Qt::LeftDockWidgetArea, dockWidget);
} }
{
QDockWidget* dockWidget = new QDockWidget("Property Editor", this);
dockWidget->setObjectName("dockWidget");
dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
m_pdmUiPropertyView = new caf::PdmUiPropertyView(dockWidget);
dockWidget->setWidget(m_pdmUiPropertyView);
connect(m_treeView, SIGNAL(selectedObjectChanged( caf::PdmObject* )), m_pdmUiPropertyView, SLOT(showProperties( caf::PdmObject* )));
addDockWidget(Qt::LeftDockWidgetArea, dockWidget);
}
{ {
QDockWidget* dockPanel = new QDockWidget("Result Info", this); QDockWidget* dockPanel = new QDockWidget("Result Info", this);
dockPanel->setObjectName("dockResultInfoPanel"); dockPanel->setObjectName("dockResultInfoPanel");
@ -408,18 +432,6 @@ void RiuMainWindow::createDockPanels()
addDockWidget(Qt::BottomDockWidgetArea, dockPanel); addDockWidget(Qt::BottomDockWidgetArea, dockPanel);
} }
{
QDockWidget* dockWidget = new QDockWidget("Properties", this);
dockWidget->setObjectName("dockWidget");
dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
m_pdmUiPropertyView = new caf::PdmUiPropertyView(dockWidget);
dockWidget->setWidget(m_pdmUiPropertyView);
connect(m_treeView, SIGNAL(selectedObjectChanged( caf::PdmObject* )), m_pdmUiPropertyView, SLOT(showProperties( caf::PdmObject* )));
addDockWidget(Qt::LeftDockWidgetArea, dockWidget);
}
setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea); setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea);
@ -491,7 +503,7 @@ void RiuMainWindow::slotRefreshFileActions()
bool projectExists = true; bool projectExists = true;
m_saveProjectAction->setEnabled(projectExists); m_saveProjectAction->setEnabled(projectExists);
m_saveProjectAsAction->setEnabled(projectExists); m_saveProjectAsAction->setEnabled(projectExists);
m_closeAction->setEnabled(projectExists); m_closeProjectAction->setEnabled(projectExists);
} }
@ -1132,13 +1144,19 @@ RiuProcessMonitor* RiuMainWindow::processMonitor()
void RiuMainWindow::slotBuildWindowActions() void RiuMainWindow::slotBuildWindowActions()
{ {
m_windowMenu->clear(); m_windowMenu->clear();
m_windowMenu->addAction(m_newPropertyView);
m_windowMenu->addSeparator();
QList<QDockWidget*> dockWidgets = findChildren<QDockWidget*>(); QList<QDockWidget*> dockWidgets = findChildren<QDockWidget*>();
int i = 0;
foreach (QDockWidget* dock, dockWidgets) foreach (QDockWidget* dock, dockWidgets)
{ {
if (dock) if (dock)
{ {
if (i == 4) m_windowMenu->addSeparator();
m_windowMenu->addAction(dock->toggleViewAction()); m_windowMenu->addAction(dock->toggleViewAction());
++i;
} }
} }
} }
@ -1199,14 +1217,23 @@ void RiuMainWindow::slotNewObjectPropertyView()
RimUiTreeView* treeView = NULL; RimUiTreeView* treeView = NULL;
{ {
QDockWidget* dockWidget = new QDockWidget("Project", this); QDockWidget* dockWidget = new QDockWidget("Additional Project Tree " + QString::number(additionalProjectTrees.size() + 1), this);
dockWidget->setObjectName("dockWidget"); dockWidget->setObjectName("dockWidget");
dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
treeView = new RimUiTreeView(dockWidget); treeView = new RimUiTreeView(dockWidget);
treeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
// Drag and drop configuration
m_treeView->setDragEnabled(true);
m_treeView->viewport()->setAcceptDrops(true);
m_treeView->setDropIndicatorShown(true);
m_treeView->setDragDropMode(QAbstractItemView::DragDrop);
dockWidget->setWidget(treeView); dockWidget->setWidget(treeView);
addDockWidget(Qt::RightDockWidgetArea, dockWidget); addDockWidget(Qt::RightDockWidgetArea, dockWidget);
additionalProjectTrees.push_back(dockWidget);
} }
treeView->setModel(m_treeModelPdm); treeView->setModel(m_treeModelPdm);
@ -1214,7 +1241,7 @@ void RiuMainWindow::slotNewObjectPropertyView()
{ {
QDockWidget* dockWidget = new QDockWidget("Properties", this); QDockWidget* dockWidget = new QDockWidget("Additional Property Editor " + QString::number(additionalPropertyEditors.size() + 1), this);
dockWidget->setObjectName("dockWidget"); dockWidget->setObjectName("dockWidget");
dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
@ -1224,6 +1251,7 @@ void RiuMainWindow::slotNewObjectPropertyView()
addDockWidget(Qt::RightDockWidgetArea, dockWidget); addDockWidget(Qt::RightDockWidgetArea, dockWidget);
connect(treeView, SIGNAL(selectedObjectChanged( caf::PdmObject* )), propView, SLOT(showProperties( caf::PdmObject* ))); connect(treeView, SIGNAL(selectedObjectChanged( caf::PdmObject* )), propView, SLOT(showProperties( caf::PdmObject* )));
additionalPropertyEditors.push_back(dockWidget);
} }
} }

View File

@ -104,14 +104,14 @@ private:
private: private:
// File actions // File actions
QAction* m_openAction; QAction* m_openEclipseCaseAction;
QAction* m_openInputEclipseFileAction; QAction* m_openInputEclipseFileAction;
QAction* m_openMultipleEclipseCasesAction; QAction* m_openMultipleEclipseCasesAction;
QAction* m_openProjectAction; QAction* m_openProjectAction;
QAction* m_openLastUsedProjectAction; QAction* m_openLastUsedProjectAction;
QAction* m_saveProjectAction; QAction* m_saveProjectAction;
QAction* m_saveProjectAsAction; QAction* m_saveProjectAsAction;
QAction* m_closeAction; QAction* m_closeProjectAction;
QAction* m_exitAction; QAction* m_exitAction;
// Edit actions // Edit actions
@ -146,6 +146,7 @@ private:
// Toolbars // Toolbars
QToolBar* m_viewToolBar; QToolBar* m_viewToolBar;
QToolBar* m_standardToolBar; QToolBar* m_standardToolBar;
QToolBar* m_snapshotToolbar;
QFrame* m_CentralFrame; QFrame* m_CentralFrame;
@ -224,4 +225,8 @@ private:
RimUiTreeModelPdm* m_treeModelPdm; RimUiTreeModelPdm* m_treeModelPdm;
caf::PdmObject* m_pdmRoot; caf::PdmObject* m_pdmRoot;
caf::PdmUiPropertyView* m_pdmUiPropertyView; caf::PdmUiPropertyView* m_pdmUiPropertyView;
std::vector<QPointer<QDockWidget> > additionalProjectTrees;
std::vector<QPointer<QDockWidget> > additionalPropertyEditors;
}; };