CHANGED: #1471 Enabled the new and save actions in the file menu. (They are not implemented yet)

This commit is contained in:
dfighter1985 2012-08-08 07:24:32 +02:00
parent 7c551870c8
commit 02a57e4bf7
5 changed files with 28 additions and 2 deletions

View file

@ -61,6 +61,10 @@ public:
virtual QUndoStack *undoStack() = 0; virtual QUndoStack *undoStack() = 0;
virtual void open() = 0; virtual void open() = 0;
virtual void save(){}
virtual void newDocument(){}
}; };
} // namespace Core } // namespace Core

View file

@ -159,10 +159,12 @@ void MainWindow::open()
void MainWindow::newFile() void MainWindow::newFile()
{ {
m_contextManager->currentContext()->newDocument();
} }
void MainWindow::save() void MainWindow::save()
{ {
m_contextManager->currentContext()->save();
} }
void MainWindow::saveAs() void MainWindow::saveAs()

View file

@ -36,7 +36,15 @@ namespace GUIEditor
{ {
m_guiEditorWindow->open(); m_guiEditorWindow->open();
} }
void GUIEditorContext::newDocument()
{
}
void GUIEditorContext::save()
{
}
QWidget *GUIEditorContext::widget() QWidget *GUIEditorContext::widget()
{ {
return m_guiEditorWindow; return m_guiEditorWindow;

View file

@ -42,7 +42,11 @@ namespace GUIEditor
virtual QIcon icon() const{ return QIcon(); } virtual QIcon icon() const{ return QIcon(); }
virtual void open(); void open();
void newDocument();
void save();
virtual QUndoStack *undoStack(); virtual QUndoStack *undoStack();

View file

@ -188,6 +188,14 @@ namespace GUIEditor
void GUIEditorWindow::createMenus() void GUIEditorWindow::createMenus()
{ {
Core::MenuManager *mm = Core::ICore::instance()->menuManager(); 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 ); QMenu *menu = mm->menu( Core::Constants::M_TOOLS );
if( menu != NULL ) if( menu != NULL )
{ {