Skip to content

Commit

Permalink
Add python bindings message bar
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Sep 4, 2012
1 parent 9e9d1ce commit ac2fcb2
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/gui/gui.sip
Expand Up @@ -26,6 +26,7 @@
%Include qgsmaptoolzoom.sip
%Include qgsmapoverviewcanvas.sip
%Include qgsmessageviewer.sip
%Include qgsmessagebar.sip
%Include qgsprojectbadlayerguihandler.sip
%Include qgsprojectionselector.sip
%Include qgsquickprint.sip
Expand Down
3 changes: 3 additions & 0 deletions python/gui/qgisinterface.sip
Expand Up @@ -109,6 +109,9 @@ class QgisInterface : QObject
/** Return a pointer to the main window (instance of QgisApp in case of QGIS) */
virtual QWidget * mainWindow()=0;

/** Return the message bar of the main app */
virtual QgsMessageBar * messageBar() = 0;

/** Return pointers to the composer views of the running instance (currently only one)*/
//virtual QList<QgsComposerView*> composerViews()=0;

Expand Down
6 changes: 6 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -1943,6 +1943,12 @@ QgsPalLabeling *QgisApp::palLabeling()
return mLBL;
}

QgsMessageBar* QgisApp::messageBar()
{
Q_ASSERT( mInfoBar );
return mInfoBar;
}

void QgisApp::initLegend()
{
mMapLegend->setWhatsThis( tr( "Map legend that displays all the layers currently on the map canvas. Click on the check box to turn a layer on or off. Double click on a layer in the legend to customize its appearance and set other properties." ) );
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgisapp.h
Expand Up @@ -166,6 +166,8 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
/** Get the mapcanvas object from the app */
QgsMapCanvas *mapCanvas();

QgsMessageBar* messageBar();

/** Get the mapcanvas object from the app */
QgsPalLabeling *palLabeling();

Expand Down
5 changes: 5 additions & 0 deletions src/app/qgisappinterface.cpp
Expand Up @@ -262,6 +262,11 @@ QWidget * QgisAppInterface::mainWindow()
return qgis;
}

QgsMessageBar * QgisAppInterface::messageBar()
{
return qgis->messageBar();
}

QList<QgsComposerView*> QgisAppInterface::activeComposers()
{
QList<QgsComposerView*> composerViewList;
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgisappinterface.h
Expand Up @@ -120,6 +120,8 @@ class QgisAppInterface : public QgisInterface
*/
QWidget * mainWindow();

QgsMessageBar * messageBar();

QList<QgsComposerView*> activeComposers();

/** Add action to the plugins menu */
Expand Down
4 changes: 4 additions & 0 deletions src/gui/qgisinterface.h
Expand Up @@ -32,6 +32,7 @@ class QgsRasterLayer;
class QgsVectorLayer;
class QgsLegendInterface;
class QgsFeature;
class QgsMessageBar;

#include <QObject>
#include <QPair>
Expand Down Expand Up @@ -157,6 +158,9 @@ class GUI_EXPORT QgisInterface : public QObject
/** Return a pointer to the main window (instance of QgisApp in case of QGIS) */
virtual QWidget * mainWindow() = 0;

/** Return the message bar of the main app */
virtual QgsMessageBar * messageBar() = 0;

/**Return mainwindows / composer views of running composer instances (currently only one)*/
virtual QList<QgsComposerView*> activeComposers() = 0;

Expand Down

0 comments on commit ac2fcb2

Please sign in to comment.