1 change: 0 additions & 1 deletion cmake/FindSPATIALITE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ FIND_PATH(SPATIALITE_INCLUDE_DIR spatialite.h
"$ENV{LIB_DIR}/include/spatialite"
)

MESSAGE(STATUS "LIB:${LIB} LIB_DIR:${LIB_DIR}")
FIND_LIBRARY(SPATIALITE_LIBRARY NAMES spatialite spatialite_i PATHS
$ENV{LIB}
$ENV{LIB_DIR}/lib
Expand Down
3 changes: 1 addition & 2 deletions ms-windows/osgeo4w/package-nightly.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ cmake -G "Visual Studio 9 2008" ^
-D WITH_ASTYLE=TRUE ^
-D WITH_GLOBE=TRUE ^
-D WITH_TOUCH=TRUE ^
-D CMAKE_BUILD_TYPE=%BUILDCONF% ^
-D CMAKE_CONFIGURATION_TYPES=%BUILDCONF% ^
-D GEOS_LIBRARY=%O4W_ROOT%/lib/geos_c_i.lib ^
-D SQLITE3_LIBRARY=%O4W_ROOT%/lib/sqlite3_i.lib ^
Expand All @@ -115,7 +114,7 @@ cmake -G "Visual Studio 9 2008" ^
-D QWT_INCLUDE_DIR=%O4W_ROOT%/include/qwt ^
-D QWT_LIBRARY=%O4W_ROOT%/lib/qwt5.lib ^
-D CMAKE_INSTALL_PREFIX=%O4W_ROOT%/apps/%PACKAGENAME% ^
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MD /ZI /Od /D NDEBUG" ^
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MD /ZI /Od /D NDEBUG /D QGISDEBUG" ^
-D FCGI_INCLUDE_DIR=%O4W_ROOT%/include ^
-D FCGI_LIBRARY=%O4W_ROOT%/lib/libfcgi.lib ^
%SRCDIR%>>%LOG% 2>&1
Expand Down
4 changes: 2 additions & 2 deletions scripts/astyle.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

for ASTYLE in $(dirname $0)/astyle $(dirname $0)/RelWithDebInfo/astyle
for ASTYLE in $(dirname $0)/qgisstyle $(dirname $0)/RelWithDebInfo/qgisstyle
do
if type -p $ASTYLE >/dev/null; then
break
Expand All @@ -9,7 +9,7 @@ do
done

if [ -z "$ASTYLE" ]; then
echo "astyle not found - please enable WITH_ASTYLE in cmake and build it" >&2
echo "qgisstyle not found - please enable WITH_ASTYLE in cmake and build it" >&2
exit 1
fi

Expand Down
36 changes: 33 additions & 3 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1884,6 +1884,12 @@ QgsMapCanvas *QgisApp::mapCanvas()
return mMapCanvas;
}

QgsPalLabeling *QgisApp::palLabeling()
{
Q_ASSERT( mLBL );
return mLBL;
}

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 Expand Up @@ -3842,14 +3848,36 @@ void QgisApp::labeling()
QMessageBox::warning( this, tr( "Labeling" ), tr( "Please select a vector layer first." ) );
return;
}

QgsVectorLayer* vlayer = dynamic_cast<QgsVectorLayer*>( layer );

QgsLabelingGui labelGui( mLBL, vlayer, mMapCanvas, this );
QDialog *dlg = new QDialog( this );
dlg->setWindowTitle( tr( "Layer labeling settings" ) );
QgsLabelingGui *labelingGui = new QgsLabelingGui( mLBL, vlayer, mMapCanvas, dlg );

QVBoxLayout *layout = new QVBoxLayout( dlg );
layout->addWidget( labelingGui );

QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Apply, Qt::Horizontal, dlg );
layout->addWidget( buttonBox );

dlg->setLayout( layout );

if ( labelGui.exec() )
QSettings settings;
dlg->restoreGeometry( settings.value( "/Windows/Labeling/geometry" ).toByteArray() );

connect( buttonBox->button( QDialogButtonBox::Ok ), SIGNAL( clicked() ), dlg, SLOT( accept() ) );
connect( buttonBox->button( QDialogButtonBox::Cancel ), SIGNAL( clicked() ), dlg, SLOT( reject() ) );
connect( buttonBox->button( QDialogButtonBox::Apply ), SIGNAL( clicked() ), labelingGui, SLOT( apply() ) );

if ( dlg->exec() )
{
labelingGui->apply();

settings.setValue( "/Windows/Labeling/geometry", dlg->saveGeometry() );

// alter labeling - save the changes
labelGui.layerSettings().writeToLayer( vlayer );
labelingGui->layerSettings().writeToLayer( vlayer );

// trigger refresh
if ( mMapCanvas )
Expand All @@ -3858,6 +3886,8 @@ void QgisApp::labeling()
}
}

delete dlg;

activateDeactivateLayerRelatedActions( layer );
}

Expand Down
6 changes: 5 additions & 1 deletion src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,12 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
void openFile( const QString & fileName );
//!Overloaded version of the private function with same name that takes the imagename as a parameter
void saveMapAsImage( QString, QPixmap * );

/** Get the mapcanvas object from the app */
QgsMapCanvas *mapCanvas();

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

//! Set theme (icons)
void setTheme( QString themeName = "default" );
Expand Down
11 changes: 3 additions & 8 deletions src/app/qgslabelinggui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
#include <qgsvectordataprovider.h>
#include <qgsmaplayerregistry.h>

#include "qgspallabeling.h"
#include "qgslabelengineconfigdialog.h"
#include "qgsexpressionbuilderdialog.h"
#include "qgsexpression.h"
#include "qgsmapcanvas.h"

#include <QColorDialog>
#include <QFontDialog>
Expand All @@ -34,16 +34,14 @@
#include <QMessageBox>
#include <QSettings>


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

setupUi( this );

QSettings settings;
restoreGeometry( settings.value( "/Windows/Labeling/geometry" ).toByteArray() );

connect( btnTextColor, SIGNAL( clicked() ), this, SLOT( changeTextColor() ) );
connect( btnChangeFont, SIGNAL( clicked() ), this, SLOT( changeTextFont() ) );
connect( chkBuffer, SIGNAL( toggled( bool ) ), this, SLOT( updatePreview() ) );
Expand Down Expand Up @@ -206,13 +204,10 @@ QgsLabelingGui::QgsLabelingGui( QgsPalLabeling* lbl, QgsVectorLayer* layer, QgsM
{
connect( placementRadios[i], SIGNAL( toggled( bool ) ), this, SLOT( updateOptions() ) );
}
connect( buttonBox->button( QDialogButtonBox::Apply ), SIGNAL( clicked() ), this, SLOT( apply() ) );
}

QgsLabelingGui::~QgsLabelingGui()
{
QSettings settings;
settings.setValue( "/Windows/Labeling/geometry", saveGeometry() );
}

void QgsLabelingGui::apply()
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgslabelinggui.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ class QgsMapCanvas;

#include "qgspallabeling.h"

class QgsLabelingGui : public QDialog, private Ui::QgsLabelingGuiBase
class QgsLabelingGui : public QWidget, private Ui::QgsLabelingGuiBase
{
Q_OBJECT

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

QgsPalLayerSettings layerSettings();
Expand Down
12 changes: 10 additions & 2 deletions src/app/qgsvectorlayerproperties.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "qgsfieldcalculator.h"
#include "qgsgraduatedsymboldialog.h"
#include "qgslabeldialog.h"
#include "qgslabelinggui.h"
#include "qgslabel.h"
#include "qgsgenericprojectionselector.h"
#include "qgslogger.h"
Expand Down Expand Up @@ -98,16 +99,21 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
connect( insertFieldButton, SIGNAL( clicked() ), this, SLOT( insertField() ) );
connect( insertExpressionButton, SIGNAL( clicked() ), this, SLOT( insertExpression() ) );


mAddAttributeButton->setIcon( QgsApplication::getThemeIcon( "/mActionNewAttribute.png" ) );
mDeleteAttributeButton->setIcon( QgsApplication::getThemeIcon( "/mActionDeleteAttribute.png" ) );
mToggleEditingButton->setIcon( QgsApplication::getThemeIcon( "/mActionToggleEditing.png" ) );
mCalculateFieldButton->setIcon( QgsApplication::getThemeIcon( "/mActionCalculateField.png" ) );

connect( btnUseNewSymbology, SIGNAL( clicked() ), this, SLOT( useNewSymbology() ) );

QVBoxLayout *layout = new QVBoxLayout( labelingFrame );
layout->setMargin( 0 );
labelingDialog = new QgsLabelingGui( QgisApp::instance()->palLabeling(), layer, QgisApp::instance()->mapCanvas(), labelingFrame );
layout->addWidget( labelingDialog );
labelingFrame->setLayout( layout );

// Create the Label dialog tab
QVBoxLayout *layout = new QVBoxLayout( labelOptionsFrame );
layout = new QVBoxLayout( labelOptionsFrame );
layout->setMargin( 0 );
labelDialog = new QgsLabelDialog( layer->label(), labelOptionsFrame );
layout->addWidget( labelDialog );
Expand Down Expand Up @@ -657,6 +663,8 @@ QgsVectorLayer::EditType QgsVectorLayerProperties::editTypeFromButtonText( QStri

void QgsVectorLayerProperties::apply()
{
labelingDialog->apply();

//
// Set up sql subset query if applicable
//
Expand Down
3 changes: 3 additions & 0 deletions src/app/qgsvectorlayerproperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class QgsApplyDialog;
class QgsLabelDialog;
class QgsVectorLayer;
class QgsVectorOverlayPlugin;
class QgsLabelingGui;

class QgsVectorLayerProperties : public QDialog, private Ui::QgsVectorLayerPropertiesBase
{
Expand Down Expand Up @@ -185,6 +186,8 @@ class QgsVectorLayerProperties : public QDialog, private Ui::QgsVectorLayerPrope
QDialog* mRendererDialog;
/**Buffer renderer, which is assigned to the vector layer when apply is pressed*/
//QgsRenderer* bufferRenderer;
/**Labeling dialog. If apply is pressed, options are applied to vector's QgsLabel */
QgsLabelingGui *labelingDialog;
/**Label dialog. If apply is pressed, options are applied to vector's QgsLabel */
QgsLabelDialog* labelDialog;
/**Actions dialog. If apply is pressed, the actions are stored for later use */
Expand Down
4 changes: 2 additions & 2 deletions src/astyle/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
SET(ASTYLE_SRCS astyle_main.cpp ASBeautifier.cpp ASFormatter.cpp ASEnhancer.cpp ASResource.cpp)
ADD_EXECUTABLE(astyle ${ASTYLE_SRCS})
SET_TARGET_PROPERTIES(astyle PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/scripts)
ADD_EXECUTABLE(qgisstyle ${ASTYLE_SRCS})
SET_TARGET_PROPERTIES(qgisstyle PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/scripts)
55 changes: 5 additions & 50 deletions src/ui/qgslabelingguibase.ui
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QgsLabelingGuiBase</class>
<widget class="QDialog" name="QgsLabelingGuiBase">
<widget class="QWidget" name="QgsLabelingGuiBase">
<property name="geometry">
<rect>
<x>0</x>
Expand Down Expand Up @@ -63,16 +63,6 @@
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
Expand Down Expand Up @@ -473,8 +463,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>658</width>
<height>451</height>
<width>647</width>
<height>435</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_13">
Expand Down Expand Up @@ -935,8 +925,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>658</width>
<height>567</height>
<width>647</width>
<height>507</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_11">
Expand Down Expand Up @@ -1146,45 +1136,10 @@
<header>qgslabelpreview.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
<include location="../../images/images.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>QgsLabelingGuiBase</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>353</x>
<y>459</y>
</hint>
<hint type="destinationlabel">
<x>309</x>
<y>430</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>QgsLabelingGuiBase</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>353</x>
<y>459</y>
</hint>
<hint type="destinationlabel">
<x>353</x>
<y>430</y>
</hint>
</hints>
</connection>
<connection>
<sender>chkEnableLabeling</sender>
<signal>clicked(bool)</signal>
Expand Down
Loading