Skip to content

Commit

Permalink
Project macros: do not display the warning bar when there are no macr…
Browse files Browse the repository at this point in the history
…os in the project, decrease warning bar message level for macros
  • Loading branch information
brushtyler committed Aug 31, 2012
1 parent c7fcef4 commit 54275e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
QWidget *centralWidget = this->centralWidget();
QGridLayout *centralLayout = new QGridLayout( centralWidget );
centralWidget->setLayout( centralLayout );
centralLayout->setContentsMargins( 0, 0, 0, 0 );

// "theMapCanvas" used to find this canonical instance later
mMapCanvas = new QgsMapCanvas( centralWidget, "theMapCanvas" );
Expand Down Expand Up @@ -3240,9 +3241,9 @@ void QgisApp::fileOpen()
{
enableProjectMacros();
}
else
else if ( !QgsProject::instance()->readEntry( "Macros", "/pythonCode", QString::null ).isEmpty() )
{
mInfoBar->pushWidget( mMacrosWarn, 2 );
mInfoBar->pushWidget( mMacrosWarn, 1 );
}
}

Expand Down
8 changes: 2 additions & 6 deletions src/app/qgsprojectproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,12 +578,8 @@ void QgsProjectProperties::apply()
QgsProject::instance()->writeEntry( "DefaultStyles", "/RandomColors", cbxStyleRandomColors->isChecked() );

// store project macros
QString pythonMacros;
if ( grpPythonMacros->isChecked() )
{
pythonMacros = ptePythonMacros->toPlainText();
}
else
QString pythonMacros = ptePythonMacros->toPlainText();
if ( !grpPythonMacros->isChecked() || pythonMacros.isEmpty() )
{
pythonMacros = QString::null;
resetPythonMacros();
Expand Down

0 comments on commit 54275e0

Please sign in to comment.