600 changes: 0 additions & 600 deletions src/app/qgsgraduatedsymboldialog.cpp

This file was deleted.

89 changes: 0 additions & 89 deletions src/app/qgsgraduatedsymboldialog.h

This file was deleted.

662 changes: 0 additions & 662 deletions src/app/qgssinglesymboldialog.cpp

This file was deleted.

87 changes: 0 additions & 87 deletions src/app/qgssinglesymboldialog.h

This file was deleted.

472 changes: 0 additions & 472 deletions src/app/qgsuniquevaluedialog.cpp

This file was deleted.

75 changes: 0 additions & 75 deletions src/app/qgsuniquevaluedialog.h

This file was deleted.

165 changes: 1 addition & 164 deletions src/app/qgsvectorlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@
#include "qgsattributeactiondialog.h"
#include "qgsapplydialog.h"
#include "qgscontexthelp.h"
#include "qgscontinuouscolordialog.h"
#include "qgscoordinatetransform.h"
#include "qgsdiagramproperties.h"
#include "qgsdiagramrendererv2.h"
#include "qgsfieldcalculator.h"
#include "qgsfieldsproperties.h"
#include "qgsgraduatedsymboldialog.h"
#include "qgslabeldialog.h"
#include "qgslabelinggui.h"
#include "qgslabel.h"
Expand All @@ -42,8 +40,6 @@
#include "qgspluginmetadata.h"
#include "qgspluginregistry.h"
#include "qgsproject.h"
#include "qgssinglesymboldialog.h"
#include "qgsuniquevaluedialog.h"
#include "qgsvectorlayer.h"
#include "qgsvectorlayerproperties.h"
#include "qgsconfig.h"
Expand Down Expand Up @@ -91,8 +87,6 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
connect( insertFieldButton, SIGNAL( clicked() ), this, SLOT( insertField() ) );
connect( insertExpressionButton, SIGNAL( clicked() ), this, SLOT( insertExpression() ) );

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

QVBoxLayout *layout;

if ( layer->hasGeometryType() )
Expand Down Expand Up @@ -172,8 +166,6 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
leSpatialRefSys->setText( layer->crs().authid() + " - " + layer->crs().description() );
leSpatialRefSys->setCursorPosition( 0 );

connect( sliderTransparency, SIGNAL( valueChanged( int ) ), this, SLOT( sliderTransparency_valueChanged( int ) ) );

//insert existing join info
const QList< QgsVectorJoinInfo >& joins = layer->vectorJoins();
for ( int i = 0; i < joins.size(); ++i )
Expand Down Expand Up @@ -239,49 +231,11 @@ void QgsVectorLayerProperties::toggleEditing()
}
}

void QgsVectorLayerProperties::sliderTransparency_valueChanged( int theValue )
{
//set the transparency percentage label to a suitable value
int myInt = static_cast < int >(( theValue / 255.0 ) * 100 ); //255.0 to prevent integer division
lblTransparencyPercent->setText( tr( "Transparency: %1%" ).arg( myInt ) );
}//sliderTransparency_valueChanged

void QgsVectorLayerProperties::setLabelCheckBox()
{
labelCheckBox->setCheckState( Qt::Checked );
}

void QgsVectorLayerProperties::alterLayerDialog( const QString & dialogString )
{

widgetStackRenderers->removeWidget( mRendererDialog );
delete mRendererDialog;
mRendererDialog = 0;
if ( dialogString == tr( "Single Symbol" ) )
{
mRendererDialog = new QgsSingleSymbolDialog( layer );
}
else if ( dialogString == tr( "Graduated Symbol" ) )
{
mRendererDialog = new QgsGraduatedSymbolDialog( layer );
}
else if ( dialogString == tr( "Continuous Color" ) )
{
mRendererDialog = new QgsContinuousColorDialog( layer );
}
else if ( dialogString == tr( "Unique Value" ) )
{
mRendererDialog = new QgsUniqueValueDialog( layer );
}
widgetStackRenderers->addWidget( mRendererDialog );
widgetStackRenderers->setCurrentWidget( mRendererDialog );
}

void QgsVectorLayerProperties::setLegendType( QString type )
{
legendtypecombobox->setItemText( legendtypecombobox->currentIndex(), type );
}

void QgsVectorLayerProperties::insertField()
{
// Convert the selected field to an expression and
Expand Down Expand Up @@ -383,18 +337,6 @@ void QgsVectorLayerProperties::reset( void )
cbMinimumScale->setScale( 1.0 / layer->minimumScale() );
cbMaximumScale->setScale( 1.0 / layer->maximumScale() );

// symbology initialization
if ( legendtypecombobox->count() == 0 )
{
legendtypecombobox->addItem( tr( "Single Symbol" ) );
if ( myFields.size() > 0 )
{
legendtypecombobox->addItem( tr( "Graduated Symbol" ) );
legendtypecombobox->addItem( tr( "Continuous Color" ) );
legendtypecombobox->addItem( tr( "Unique Value" ) );
}
}

// load appropriate symbology page (V1 or V2)
updateSymbologyPage();

Expand All @@ -412,11 +354,6 @@ void QgsVectorLayerProperties::reset( void )

mFieldsPropertiesDialog->init();

//set the transparency slider
sliderTransparency->setValue( 255 - layer->getTransparency() );
//update the transparency percentage label
sliderTransparency_valueChanged( 255 - layer->getTransparency() );

QObject::connect( labelCheckBox, SIGNAL( clicked( bool ) ), this, SLOT( enableLabelOptions( bool ) ) );
} // reset()

Expand Down Expand Up @@ -473,8 +410,6 @@ void QgsVectorLayerProperties::apply()
layer->enableLabels( labelCheckBox->isChecked() );
layer->setLayerName( mLayerOrigNameLineEdit->text() );

QSet<QString> excludeAttributesWMS, excludeAttributesWFS;

// Apply fields settings
mFieldsPropertiesDialog->apply();

Expand All @@ -484,36 +419,6 @@ void QgsVectorLayerProperties::apply()
static_cast<QgsRendererV2PropertiesDialog*>( widgetStackRenderers->currentWidget() );
dlg->apply();
}
else
{
QgsSingleSymbolDialog *sdialog =
qobject_cast < QgsSingleSymbolDialog * >( widgetStackRenderers->currentWidget() );
QgsGraduatedSymbolDialog *gdialog =
qobject_cast < QgsGraduatedSymbolDialog * >( widgetStackRenderers->currentWidget() );
QgsContinuousColorDialog *cdialog =
qobject_cast < QgsContinuousColorDialog * >( widgetStackRenderers->currentWidget() );
QgsUniqueValueDialog* udialog =
qobject_cast< QgsUniqueValueDialog * >( widgetStackRenderers->currentWidget() );

if ( sdialog )
{
sdialog->apply();
}
else if ( gdialog )
{
gdialog->apply();
}
else if ( cdialog )
{
cdialog->apply();
}
else if ( udialog )
{
udialog->apply();
}
layer->setTransparency( static_cast < unsigned int >( 255 - sliderTransparency->value() ) );

}

//apply diagram settings
diagramPropertiesDialog->apply();
Expand Down Expand Up @@ -794,20 +699,6 @@ QList<QgsVectorOverlayPlugin*> QgsVectorLayerProperties::overlayPlugins() const
return pluginList;
}

void QgsVectorLayerProperties::setUsingNewSymbology( bool useNewSymbology )
{
if ( useNewSymbology )
{
QgsSymbologyV2Conversion::rendererV1toV2( layer );
}
else
{
QgsSymbologyV2Conversion::rendererV2toV1( layer );
}

// update GUI!
updateSymbologyPage();
}

void QgsVectorLayerProperties::on_mButtonAddJoin_clicked()
{
Expand Down Expand Up @@ -880,76 +771,22 @@ void QgsVectorLayerProperties::on_mButtonRemoveJoin_clicked()
}


void QgsVectorLayerProperties::useNewSymbology()
{
int res = QMessageBox::question( this, tr( "Symbology" ),
tr( "Do you wish to use the new symbology implementation for this layer?" ),
QMessageBox::Yes | QMessageBox::No );

if ( res != QMessageBox::Yes )
return;

setUsingNewSymbology( true );
}

void QgsVectorLayerProperties::updateSymbologyPage()
{

//find out the type of renderer in the vectorlayer, create a dialog with these settings and add it to the form
delete mRendererDialog;
mRendererDialog = 0;

bool v2 = layer->isUsingRendererV2();

// hide unused widgets
legendtypecombobox->setVisible( !v2 );
legendtypelabel->setVisible( !v2 );
lblTransparencyPercent->setVisible( !v2 );
sliderTransparency->setVisible( !v2 );
btnUseNewSymbology->setVisible( !v2 );

if ( v2 )
if ( layer->isUsingRendererV2() )
{
mRendererDialog = new QgsRendererV2PropertiesDialog( layer, QgsStyleV2::defaultStyle(), true );

connect( mRendererDialog, SIGNAL( useNewSymbology( bool ) ), this, SLOT( setUsingNewSymbology( bool ) ) );

// display the menu to choose the output format (fix #5136)
pbnSaveStyleAs->setText( tr( "Save Style" ) );
pbnSaveStyleAs->setMenu( mSaveAsMenu );
QObject::disconnect( pbnSaveStyleAs, SIGNAL( clicked() ), this, SLOT( on_pbnSaveStyleAs_clicked() ) );
}
else if ( layer->renderer() )
{
QString rtype = layer->renderer()->name();
if ( rtype == "Single Symbol" )
{
mRendererDialog = new QgsSingleSymbolDialog( layer );
legendtypecombobox->setCurrentIndex( 0 );
}
else if ( rtype == "Graduated Symbol" )
{
mRendererDialog = new QgsGraduatedSymbolDialog( layer );
legendtypecombobox->setCurrentIndex( 1 );
}
else if ( rtype == "Continuous Color" )
{
mRendererDialog = new QgsContinuousColorDialog( layer );
legendtypecombobox->setCurrentIndex( 2 );
}
else if ( rtype == "Unique Value" )
{
mRendererDialog = new QgsUniqueValueDialog( layer );
legendtypecombobox->setCurrentIndex( 3 );
}

QObject::connect( legendtypecombobox, SIGNAL( activated( const QString & ) ), this,
SLOT( alterLayerDialog( const QString & ) ) );

pbnSaveStyleAs->setText( tr( "Save Style..." ) );
pbnSaveStyleAs->setMenu( NULL );
QObject::connect( pbnSaveStyleAs, SIGNAL( clicked() ), this, SLOT( on_pbnSaveStyleAs_clicked() ) );
}
else
{
tabWidget->setTabEnabled( 0, false ); // hide symbology item
Expand Down
10 changes: 0 additions & 10 deletions src/app/qgsvectorlayerproperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ class QgsVectorLayerProperties : public QDialog, private Ui::QgsVectorLayerPrope

QgsVectorLayerProperties( QgsVectorLayer *lyr = 0, QWidget *parent = 0, Qt::WFlags fl = QgisGui::ModalDialogFlags );
~QgsVectorLayerProperties();
/**Sets the legend type to "single symbol", "graduated symbol" or "continuous color"*/
void setLegendType( QString type );
/**Returns the display name entered in the dialog*/
QString displayName();
void setRendererDirty( bool ) {}
Expand All @@ -81,8 +79,6 @@ class QgsVectorLayerProperties : public QDialog, private Ui::QgsVectorLayerPrope

void insertExpression();

void alterLayerDialog( const QString& string );

/** Reset to original (vector layer) values */
void reset();

Expand All @@ -94,9 +90,6 @@ class QgsVectorLayerProperties : public QDialog, private Ui::QgsVectorLayerPrope
*/
void on_mLayerOrigNameLineEdit_textEdited( const QString& text );

/** Set transparency based on slider position */
void sliderTransparency_valueChanged( int theValue );

/** Toggles on the label check box */
void setLabelCheckBox();

Expand All @@ -120,9 +113,6 @@ class QgsVectorLayerProperties : public QDialog, private Ui::QgsVectorLayerPrope

void enableLabelOptions( bool theFlag );

void useNewSymbology();
void setUsingNewSymbology( bool useNewSymbology );

void on_mButtonAddJoin_clicked();
void on_mButtonRemoveJoin_clicked();

Expand Down
16 changes: 0 additions & 16 deletions src/gui/symbology-ng/qgsrendererv2propertiesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ QgsRendererV2PropertiesDialog::QgsRendererV2PropertiesDialog( QgsVectorLayer* la
}

connect( buttonBox, SIGNAL( accepted() ), this, SLOT( onOK() ) );
connect( btnOldSymbology, SIGNAL( clicked() ), this, SLOT( useOldSymbology() ) );

// initialize registry's widget functions
_initRendererWidgetFunctions();
Expand Down Expand Up @@ -204,18 +203,3 @@ void QgsRendererV2PropertiesDialog::keyPressEvent( QKeyEvent * e )
QDialog::keyPressEvent( e );
}
}




void QgsRendererV2PropertiesDialog::useOldSymbology()
{
int res = QMessageBox::question( this, tr( "Symbology" ),
tr( "Do you wish to use the original symbology implementation for this layer?" ),
QMessageBox::Yes | QMessageBox::No );

if ( res != QMessageBox::Yes )
return;

emit useNewSymbology( false );
}
5 changes: 0 additions & 5 deletions src/gui/symbology-ng/qgsrendererv2propertiesdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ class GUI_EXPORT QgsRendererV2PropertiesDialog : public QDialog, private Ui::Qgs
void apply();
void onOK();

void useOldSymbology();

signals:
void useNewSymbology( bool );

protected:

//! Reimplements dialog keyPress event so we can ignore it
Expand Down
1 change: 1 addition & 0 deletions src/gui/symbology-ng/qgssinglesymbolrendererv2widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ QgsSingleSymbolRendererV2Widget::QgsSingleSymbolRendererV2Widget( QgsVectorLayer
connect( mSelector, SIGNAL( symbolModified() ), this, SLOT( changeSingleSymbol() ) );

QVBoxLayout* layout = new QVBoxLayout;
layout->setContentsMargins( 0, 0, 0, 0 );
layout->addWidget( mSelector );
setLayout( layout );

Expand Down
7 changes: 5 additions & 2 deletions src/ui/qgscategorizedsymbolrendererv2widget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>599</width>
<height>298</height>
<width>597</width>
<height>296</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
Expand Down
152 changes: 0 additions & 152 deletions src/ui/qgscontinuouscolordialogbase.ui

This file was deleted.

241 changes: 0 additions & 241 deletions src/ui/qgsgraduatedsymboldialogbase.ui

This file was deleted.

7 changes: 5 additions & 2 deletions src/ui/qgsgraduatedsymbolrendererv2widget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>507</width>
<height>341</height>
<width>505</width>
<height>339</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QGridLayout">
<item row="0" column="0">
Expand Down
7 changes: 5 additions & 2 deletions src/ui/qgspointdisplacementrendererwidgetbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
<rect>
<x>0</x>
<y>0</y>
<width>383</width>
<height>532</height>
<width>381</width>
<height>530</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
Expand Down
14 changes: 5 additions & 9 deletions src/ui/qgsrendererv2propsdialogbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>529</width>
<height>324</height>
<width>525</width>
<height>320</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -42,13 +42,6 @@
<item>
<widget class="QgsBlendModeComboBox" name="mBlendModeComboBox"/>
</item>
<item>
<widget class="QPushButton" name="btnOldSymbology">
<property name="text">
<string>Old symbology</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
Expand All @@ -67,6 +60,9 @@
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label">
<property name="text">
Expand Down
437 changes: 0 additions & 437 deletions src/ui/qgssinglesymboldialogbase.ui

This file was deleted.

191 changes: 0 additions & 191 deletions src/ui/qgsuniquevaluedialogbase.ui

This file was deleted.

99 changes: 9 additions & 90 deletions src/ui/qgsvectorlayerpropertiesbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>936</width>
<height>860</height>
<width>932</width>
<height>856</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -83,80 +83,7 @@
<string>Style</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="legendtypelabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>32767</width>
<height>22</height>
</size>
</property>
<property name="text">
<string>Legend type</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="legendtypecombobox">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>26</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>32767</width>
<height>22</height>
</size>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="lblTransparencyPercent">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Transparency</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QSlider" name="sliderTransparency">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximum">
<number>255</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="1" column="0" colspan="5">
<item row="0" column="0" colspan="2">
<widget class="QStackedWidget" name="widgetStackRenderers">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
Expand All @@ -175,13 +102,6 @@
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="btnUseNewSymbology">
<property name="text">
<string>New symbology</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="labelingTab">
Expand Down Expand Up @@ -300,8 +220,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>914</width>
<height>746</height>
<width>680</width>
<height>393</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_3">
Expand Down Expand Up @@ -799,8 +719,8 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>896</width>
<height>728</height>
<width>94</width>
<height>211</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
Expand Down Expand Up @@ -911,8 +831,8 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>896</width>
<height>728</height>
<width>96</width>
<height>112</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_17">
Expand Down Expand Up @@ -1020,7 +940,6 @@ p, li { white-space: pre-wrap; }
</tabstops>
<resources>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
</resources>
<connections>
<connection>
Expand Down