Skip to content

Commit

Permalink
Fix opening automation patterns per context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-w committed Jan 12, 2015
1 parent 854f1d1 commit 30bc86e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
4 changes: 3 additions & 1 deletion include/AutomationPatternView.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class AutomationPatternView : public TrackContentObjectView
virtual ~AutomationPatternView();

public slots:
/// Opens this view's pattern in the global automation editor
void openInAutomationEditor();
virtual void update();


Expand All @@ -56,7 +58,7 @@ protected slots:

protected:
virtual void constructContextMenu( QMenu * );
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
virtual void mouseDoubleClickEvent(QMouseEvent * me );
virtual void paintEvent( QPaintEvent * _pe );
virtual void resizeEvent( QResizeEvent * _re )
{
Expand Down
19 changes: 13 additions & 6 deletions src/gui/AutomationPatternView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ AutomationPatternView::~AutomationPatternView()



void AutomationPatternView::openInAutomationEditor()
{
if(gui) gui->automationEditor()->open(m_pat);
}





void AutomationPatternView::update()
{
Expand Down Expand Up @@ -170,8 +178,7 @@ void AutomationPatternView::constructContextMenu( QMenu * _cm )
QAction * a = new QAction( embed::getIconPixmap( "automation" ),
tr( "Open in Automation editor" ), _cm );
_cm->insertAction( _cm->actions()[0], a );
connect( a, SIGNAL( triggered( bool ) ),
m_pat, SLOT( openInAutomationEditor() ) );
connect(a, SIGNAL(triggered()), this, SLOT(openInAutomationEditor()));
_cm->insertSeparator( _cm->actions()[1] );

_cm->addSeparator();
Expand Down Expand Up @@ -222,14 +229,14 @@ void AutomationPatternView::constructContextMenu( QMenu * _cm )



void AutomationPatternView::mouseDoubleClickEvent( QMouseEvent * _me )
void AutomationPatternView::mouseDoubleClickEvent( QMouseEvent * me )
{
if( _me->button() != Qt::LeftButton )
if(me->button() != Qt::LeftButton)
{
_me->ignore();
me->ignore();
return;
}
gui->automationEditor()->open(m_pat);
openInAutomationEditor();
}


Expand Down

10 comments on commit 30bc86e

@diizy
Copy link
Contributor

@diizy diizy commented on 30bc86e Jan 12, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope... still getting blank window. The title of the window is correct, indicating the correct pattern gets opened, but there's nothing in the window - no automation graph, just the blue-grey background.

@lukas-w
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh. Again, how are you opening the pattern exactly? This may have something to do with #1495.

@diizy
Copy link
Contributor

@diizy diizy commented on 30bc86e Jan 12, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukas-w
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I am. Could you try doing a clean build? (First try re-running cmake so you don't have to do the full 10-minute build if that does it)

@diizy
Copy link
Contributor

@diizy diizy commented on 30bc86e Jan 12, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh,btw: this doesn't seem to happen in a new project. Only when I open an existing project or start a new one from a template.

I see AutomationEditor wasn't touched in #1495, maybe it needs the same fix as the other windows?

@diizy
Copy link
Contributor

@diizy diizy commented on 30bc86e Jan 12, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you still can't reproduce, try different project files, it may have to do with whether the window is open/closed in the project file...

@diizy
Copy link
Contributor

@diizy diizy commented on 30bc86e Jan 12, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukas-w
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm working on it and I think I got it.

@lukas-w
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please test if a94ccb8 fixes this for you.

@diizy
Copy link
Contributor

@diizy diizy commented on 30bc86e Jan 12, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.