Skip to content

Commit

Permalink
Fix 'enable macros' button does not run open macro (fix #9523)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 31, 2016
1 parent a3186f8 commit fa36639
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4970,8 +4970,6 @@ bool QgisApp::addProject( const QString& projectFile )
btnEnableMacros->setStyleSheet( QStringLiteral( "background-color: rgba(255, 255, 255, 0); color: black; text-decoration: underline;" ) );
btnEnableMacros->setCursor( Qt::PointingHandCursor );
btnEnableMacros->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred );
connect( btnEnableMacros, SIGNAL( clicked() ), mInfoBar, SLOT( popWidget() ) );
connect( btnEnableMacros, SIGNAL( clicked() ), this, SLOT( enableProjectMacros() ) );

QgsMessageBarItem *macroMsg = new QgsMessageBarItem(
tr( "Security warning" ),
Expand All @@ -4980,6 +4978,13 @@ bool QgisApp::addProject( const QString& projectFile )
QgsMessageBar::WARNING,
0,
mInfoBar );

connect( btnEnableMacros, &QToolButton::clicked, [this,macroMsg]
{
enableProjectMacros();
mInfoBar->popWidget( macroMsg );
} );

// display the macros notification widget
mInfoBar->pushItem( macroMsg );
}
Expand Down

1 comment on commit fa36639

@nyalldawson
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Wheee lambdas! Sorry 2.14, ain't no chance of backporting this one :P

Please sign in to comment.