Skip to content

Commit

Permalink
Editor: Don't delete on close
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-w committed Dec 8, 2014
1 parent 86f2c86 commit d8db894
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 20 deletions.
2 changes: 0 additions & 2 deletions include/AutomationEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,6 @@ class AutomationEditorWindow : public Editor

AutomationEditor* m_editor;

virtual void closeEvent( QCloseEvent * _ce );

signals:
void currentPatternChanged();

Expand Down
1 change: 1 addition & 0 deletions src/core/AutomationPattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ void AutomationPattern::openInAutomationEditor()
{
Engine::automationEditor()->setCurrentPattern( this );
Engine::automationEditor()->parentWidget()->show();
Engine::automationEditor()->show();
Engine::automationEditor()->setFocus();
}

Expand Down
16 changes: 0 additions & 16 deletions src/gui/AutomationEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2290,9 +2290,7 @@ AutomationEditorWindow::AutomationEditorWindow() :
// Add us to workspace
if( Engine::mainWindow()->workspace() )
{
Engine::mainWindow()->workspace()->addSubWindow( this );
parentWidget()->resize( INITIAL_WIDTH, INITIAL_HEIGHT );
parentWidget()->move( 5, 5 );
parentWidget()->hide();
}
else
Expand Down Expand Up @@ -2343,20 +2341,6 @@ int AutomationEditorWindow::quantization() const
return m_editor->quantization();
}

void AutomationEditorWindow::closeEvent(QCloseEvent* _ce)
{
QApplication::restoreOverrideCursor();
if( parentWidget() )
{
parentWidget()->hide();
}
else
{
hide();
}
_ce->ignore();
}

void AutomationEditorWindow::play()
{
m_editor->play();
Expand Down
7 changes: 7 additions & 0 deletions src/gui/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@

#include "Editor.h"

#include "MainWindow.h"
#include "embed.h"

#include <QMdiArea>
#include <QAction>
#include <QToolBar>

Expand Down Expand Up @@ -96,6 +98,11 @@ Editor::Editor(bool record) :
connect(m_recordAccompanyButton, SIGNAL(clicked()), this, SLOT(recordAccompany()));
}
connect(m_stopButton, SIGNAL(clicked()), this, SLOT(stop()));


// Add editor to main window
Engine::mainWindow()->workspace()->addSubWindow(this);
parentWidget()->setAttribute(Qt::WA_DeleteOnClose, false);
}

Editor::~Editor()
Expand Down
2 changes: 0 additions & 2 deletions src/gui/SongEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,8 +688,6 @@ SongEditorWindow::SongEditorWindow(Song* song) :
m_toolBar->addWidget( zoom_lbl );
m_toolBar->addWidget( m_zoomingComboBox );

Engine::mainWindow()->workspace()->addSubWindow( this );
parentWidget()->setAttribute( Qt::WA_DeleteOnClose, false );
parentWidget()->resize( 600, 300 );
parentWidget()->move( 5, 5 );
parentWidget()->show();
Expand Down

0 comments on commit d8db894

Please sign in to comment.