From dca5394f4e7bc53b2c5aae793a54cfc11b52c010 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Wed, 8 Aug 2012 07:24:32 +0200 Subject: [PATCH] CHANGED: #1471 Enabled the new and save actions in the file menu. (They are not implemented yet) --HG-- branch : gsoc2012-gui-editor --- .../3d/object_viewer_qt/src/plugins/core/icontext.h | 4 ++++ .../object_viewer_qt/src/plugins/core/main_window.cpp | 2 ++ .../src/plugins/gui_editor/gui_editor_context.cpp | 10 +++++++++- .../src/plugins/gui_editor/gui_editor_context.h | 6 +++++- .../src/plugins/gui_editor/gui_editor_window.cpp | 8 ++++++++ 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icontext.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icontext.h index 8af601418..b0c4d0426 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icontext.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icontext.h @@ -61,6 +61,10 @@ public: virtual QUndoStack *undoStack() = 0; virtual void open() = 0; + + virtual void save(){} + + virtual void newDocument(){} }; } // namespace Core diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp index 6e409e75d..bf0380637 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp @@ -159,10 +159,12 @@ void MainWindow::open() void MainWindow::newFile() { + m_contextManager->currentContext()->newDocument(); } void MainWindow::save() { + m_contextManager->currentContext()->save(); } void MainWindow::saveAs() diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_context.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_context.cpp index 32dba0e25..248090261 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_context.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_context.cpp @@ -36,7 +36,15 @@ namespace GUIEditor { m_guiEditorWindow->open(); } - + + void GUIEditorContext::newDocument() + { + } + + void GUIEditorContext::save() + { + } + QWidget *GUIEditorContext::widget() { return m_guiEditorWindow; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_context.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_context.h index 39c521cdf..c6fdd7e7b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_context.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_context.h @@ -42,7 +42,11 @@ namespace GUIEditor virtual QIcon icon() const{ return QIcon(); } - virtual void open(); + void open(); + + void newDocument(); + + void save(); virtual QUndoStack *undoStack(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.cpp index ff41878ed..8b40abe34 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.cpp @@ -188,6 +188,14 @@ namespace GUIEditor void GUIEditorWindow::createMenus() { Core::MenuManager *mm = Core::ICore::instance()->menuManager(); + //QAction *newAction = mm->action( Core::Constants::NEW ); + QAction *saveAction = mm->action( Core::Constants::SAVE ); + + //if( newAction != NULL ) + // newAction->setEnabled( true ); + if( saveAction != NULL ) + saveAction->setEnabled( true ); + QMenu *menu = mm->menu( Core::Constants::M_TOOLS ); if( menu != NULL ) {