Skip to content
Permalink
Browse files

Changes to QgsMessageBar icons and Enable macros action

  • Loading branch information
dakcarto authored and brushtyler committed Aug 31, 2012
1 parent 54275e0 commit 8be777b999997087e1aedcf31e0b2a9ca27b44fe
@@ -168,6 +168,7 @@
<file>themes/default/mActionZoomOut.png</file>
<file>themes/default/mActionZoomToLayer.png</file>
<file>themes/default/mActionZoomToSelected.png</file>
<file>themes/default/mIconClose.png</file>
<file>themes/default/mIconConnect.png</file>
<file>themes/default/mIconDbSchema.png</file>
<file>themes/default/mIconDelete.png</file>
@@ -369,6 +370,7 @@
<file>themes/gis/mActionZoomOut.png</file>
<file>themes/gis/mActionZoomToLayer.png</file>
<file>themes/gis/mActionZoomToSelected.png</file>
<file>themes/gis/mIconClose.png</file>
<file>themes/gis/mIconEditable.png</file>
<file>themes/gis/mIconLineLayer.png</file>
<file>themes/gis/mIconPointLayer.png</file>
@@ -400,6 +402,7 @@
<file>themes/gis/mIconWcs.png</file>
<file>themes/gis/mIconWms.png</file>
<file>themes/gis/mIconWfs.png</file>
<file>themes/gis/mIconWarn.png</file>
<file>themes/gis/mIconSpatialite.png</file>
<file>themes/gis/mIconRaster.png</file>
<file>themes/gis/mIconPostgis.png</file>
Binary file not shown.
BIN +439 Bytes (300%) images/themes/default/mIconWarn.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -477,22 +477,6 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
//set the focus to the map canvas
mMapCanvas->setFocus();

// a bar to warn the user with non-blocking messages
mInfoBar = new QgsMessageBar( centralWidget );
mInfoBar->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed );
centralLayout->addWidget( mInfoBar, 0, 0, 1, 1 );

mMacrosWarn = QgsMessageBar::createMessage( tr( "Security warning:" ),
tr( "macros have been disabled." ),
QgsApplication::getThemeIcon( "/mIconWarn.png" ),
mInfoBar );

QToolButton *btnEnableMacros = new QToolButton( mMacrosWarn );
btnEnableMacros->setText( tr( "Enable" ) );
connect( btnEnableMacros, SIGNAL( clicked() ), mInfoBar, SLOT( popWidget() ) );
connect( btnEnableMacros, SIGNAL( clicked() ), this, SLOT( enableProjectMacros() ) );
mMacrosWarn->layout()->addWidget( btnEnableMacros );

// "theMapLegend" used to find this canonical instance later
mMapLegend = new QgsLegend( mMapCanvas, this, "theMapLegend" );

@@ -518,6 +502,24 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
updateProjectFromTemplates();
activateDeactivateLayerRelatedActions( NULL );

// a bar to warn the user with non-blocking messages
mInfoBar = new QgsMessageBar( centralWidget );
mInfoBar->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed );
centralLayout->addWidget( mInfoBar, 0, 0, 1, 1 );

mMacrosWarn = QgsMessageBar::createMessage( tr( "Security warning:" ),
tr( "macros have been disabled." ),
QgsApplication::getThemeIcon( "/mIconWarn.png" ),
mInfoBar );

QToolButton *btnEnableMacros = new QToolButton( mMacrosWarn );
btnEnableMacros->setText( tr( "Enable" ) );
btnEnableMacros->setStyleSheet( "background-color: rgba(255, 255, 255, 0);text-decoration: underline;" );
btnEnableMacros->setCursor( Qt::PointingHandCursor );
connect( btnEnableMacros, SIGNAL( clicked() ), mInfoBar, SLOT( popWidget() ) );
connect( btnEnableMacros, SIGNAL( clicked() ), this, SLOT( enableProjectMacros() ) );
mMacrosWarn->layout()->addWidget( btnEnableMacros );

addDockWidget( Qt::LeftDockWidgetArea, mUndoWidget );
mUndoWidget->hide();

@@ -43,8 +43,10 @@ QgsMessageBar::QgsMessageBar( QWidget *parent )
mLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ), 0, 1, 1, 1 );

mCloseBtn = new QToolButton( this );
mCloseBtn->setText( tr( "Close" ) );
mCloseBtn->setIcon( QgsApplication::getThemeIcon( "mIconClose.png" ) );
mCloseBtn->setText( tr( "" ) );
mCloseBtn->setStyleSheet( "background-color: rgba(255, 255, 255, 0);" );
mCloseBtn->setCursor( Qt::PointingHandCursor );
mCloseBtn->setIcon( QgsApplication::getThemeIcon( "/mIconClose.png" ) );
connect( mCloseBtn, SIGNAL( clicked() ), this, SLOT( popWidget() ) );
mLayout->addWidget( mCloseBtn, 0, 2, 1, 1 );

0 comments on commit 8be777b

Please sign in to comment.
You can’t perform that action at this time.