Skip to content

Commit

Permalink
Moved scale bar plugin to app
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Aug 21, 2011
1 parent 5ca2c32 commit d386c66
Show file tree
Hide file tree
Showing 16 changed files with 178 additions and 591 deletions.
1 change: 1 addition & 0 deletions images/images.qrc
Expand Up @@ -352,6 +352,7 @@
<file>themes/default/unlocked.png</file>
<file>themes/default/plugins/copyright_label.png</file>
<file>themes/default/plugins/north_arrow.png</file>
<file>themes/default/plugins/scale_bar.png</file>
</qresource>
<qresource prefix="/images/tips">
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
Expand Down
File renamed without changes
4 changes: 4 additions & 0 deletions src/app/CMakeLists.txt
Expand Up @@ -25,6 +25,8 @@ SET(QGIS_APP_SRCS
qgsdecorationcopyrightdialog.cpp
qgsdecorationnortharrow.cpp
qgsdecorationnortharrowdialog.cpp
qgsdecorationscalebar.cpp
qgsdecorationscalebardialog.cpp
qgsembedlayerdialog.cpp
qgsformannotationdialog.cpp
qgsdelattrdialog.cpp
Expand Down Expand Up @@ -161,6 +163,8 @@ SET (QGIS_APP_MOC_HDRS
qgsdecorationcopyrightdialog.h
qgsdecorationnortharrow.h
qgsdecorationnortharrowdialog.h
qgsdecorationscalebar.h
qgsdecorationscalebardialog.h
qgsdelattrdialog.h
qgsdisplayangle.h
qgsembedlayerdialog.h
Expand Down
7 changes: 7 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -116,6 +116,7 @@
#include "qgsdatasourceuri.h"
#include "qgsdecorationcopyright.h"
#include "qgsdecorationnortharrow.h"
#include "qgsdecorationscalebar.h"
#include "qgsembedlayerdialog.h"
#include "qgsencodingfiledialog.h"
#include "qgsexception.h"
Expand Down Expand Up @@ -1475,6 +1476,7 @@ void QgisApp::setTheme( QString theThemeName )
mActionChangeLabelProperties->setIcon( getThemeIcon( "/mActionChangeLabelProperties.png" ) );
mActionDecorationCopyright->setIcon( getThemeIcon( "/plugins/copyright_label.png" ) );
mActionDecorationNorthArrow->setIcon( getThemeIcon( "/plugins/north_arrow.png" ) );
mActionDecorationScaleBar->setIcon( getThemeIcon( "/plugins/scale_bar.png" ) );

//change themes of all composers
QSet<QgsComposer*>::iterator composerIt = mPrintComposers.begin();
Expand Down Expand Up @@ -1819,6 +1821,11 @@ void QgisApp::createDecorations()
connect( mActionDecorationNorthArrow, SIGNAL( triggered() ), mDecorationNorthArrow, SLOT( run() ) );
connect( mMapCanvas, SIGNAL( renderComplete( QPainter * ) ), mDecorationNorthArrow, SLOT( renderNorthArrow( QPainter * ) ) );
connect( this, SIGNAL( projectRead() ), mDecorationNorthArrow, SLOT( projectRead() ) );

mDecorationScaleBar = new QgsDecorationScaleBar( this );
connect( mActionDecorationScaleBar, SIGNAL( triggered() ), mDecorationScaleBar, SLOT( run() ) );
connect( mMapCanvas, SIGNAL( renderComplete( QPainter * ) ), mDecorationScaleBar, SLOT( renderScaleBar( QPainter * ) ) );
connect( this, SIGNAL( projectRead() ), mDecorationScaleBar, SLOT( projectRead() ) );
}

// Update file menu with the current list of recently accessed projects
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgisapp.h
Expand Up @@ -71,6 +71,7 @@ class QgsGPSInformationWidget;

class QgsDecorationCopyright;
class QgsDecorationNorthArrow;
class QgsDecorationScaleBar;

#include <QMainWindow>
#include <QToolBar>
Expand Down Expand Up @@ -1057,6 +1058,7 @@ class QgisApp : public QMainWindow, private Ui::MainWindow

QgsDecorationCopyright* mDecorationCopyright;
QgsDecorationNorthArrow* mDecorationNorthArrow;
QgsDecorationScaleBar* mDecorationScaleBar;

int mLastComposerId;

Expand Down

0 comments on commit d386c66

Please sign in to comment.