Skip to content
Permalink
Browse files

Added apply button for label dialog for the lazy

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14659 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux
timlinux committed Nov 14, 2010
1 parent 177a510 commit 6b4ee2d12246a96a753551919338dd72316b709d
Showing with 22 additions and 5 deletions.
  1. +1 −1 src/app/qgisapp.cpp
  2. +16 −2 src/app/qgslabelinggui.cpp
  3. +4 −1 src/app/qgslabelinggui.h
  4. +1 −1 src/ui/qgslabelingguibase.ui
@@ -3893,7 +3893,7 @@ void QgisApp::labeling()
}
QgsVectorLayer* vlayer = dynamic_cast<QgsVectorLayer*>( layer );

QgsLabelingGui labelGui( mLBL, vlayer, this );
QgsLabelingGui labelGui( mLBL, vlayer, mMapCanvas, this );

if ( labelGui.exec() )
{
@@ -17,6 +17,7 @@

#include "qgslabelinggui.h"

#include <qgsmapcanvas.h>
#include <qgsvectorlayer.h>
#include <qgsvectordataprovider.h>
#include <qgsmaplayerregistry.h>
@@ -32,8 +33,8 @@



QgsLabelingGui::QgsLabelingGui( QgsPalLabeling* lbl, QgsVectorLayer* layer, QWidget* parent )
: QDialog( parent ), mLBL( lbl ), mLayer( layer )
QgsLabelingGui::QgsLabelingGui( QgsPalLabeling* lbl, QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, QWidget* parent )
: QDialog( parent ), mLBL( lbl ), mLayer( layer ), mMapCanvas( mapCanvas )
{
setupUi( this );

@@ -168,13 +169,26 @@ QgsLabelingGui::QgsLabelingGui( QgsPalLabeling* lbl, QgsVectorLayer* layer, QWid
radAroundCentroid, radPolygonHorizontal, radPolygonFree, radPolygonPerimeter // polygon
};
for ( unsigned int i = 0; i < sizeof( placementRadios ) / sizeof( QRadioButton* ); i++ )
{
connect( placementRadios[i], SIGNAL( toggled( bool ) ), this, SLOT( updateOptions() ) );
}
connect( buttonBox->button( QDialogButtonBox::Apply ), SIGNAL( clicked() ), this, SLOT( apply() ) );
}

QgsLabelingGui::~QgsLabelingGui()
{
}

void QgsLabelingGui::apply()
{
layerSettings().writeToLayer( mLayer );
// trigger refresh
if ( mMapCanvas )
{
mMapCanvas->refresh();
}
}

QgsPalLayerSettings QgsLabelingGui::layerSettings()
{
QgsPalLayerSettings lyr;
@@ -22,6 +22,7 @@
#include <ui_qgslabelingguibase.h>

class QgsVectorLayer;
class QgsMapCanvas;

#include "qgspallabeling.h"

@@ -30,12 +31,13 @@ class QgsLabelingGui : public QDialog, private Ui::QgsLabelingGuiBase
Q_OBJECT

public:
QgsLabelingGui( QgsPalLabeling* lbl, QgsVectorLayer* layer, QWidget* parent );
QgsLabelingGui( QgsPalLabeling* lbl, QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, QWidget* parent );
~QgsLabelingGui();

QgsPalLayerSettings layerSettings();

public slots:
void apply();
void changeTextColor();
void changeTextFont();
void showEngineConfigDialog();
@@ -62,6 +64,7 @@ class QgsLabelingGui : public QDialog, private Ui::QgsLabelingGuiBase
private:
QgsPalLabeling* mLBL;
QgsVectorLayer* mLayer;
QgsMapCanvas* mMapCanvas;

void disableDataDefinedAlignment();
void enableDataDefinedAlignment();
@@ -1017,7 +1017,7 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>

0 comments on commit 6b4ee2d

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