67 changes: 37 additions & 30 deletions src/app/qgsvectorlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,35 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
QWidget * parent,
Qt::WFlags fl
)
: QDialog( parent, fl )
: QgsOptionsDialogBase( "VectorLayerProperties", parent, fl )
, layer( lyr )
, mMetadataFilled( false )
, mRendererDialog( 0 )
{
setupUi( this );
// QgsOptionsDialogBase handles saving/restoring of geometry, splitter and current tab states,
// switching vertical tabs between icon/text to icon-only modes (splitter collapsed to left),
// and connecting QDialogButtonBox's accepted/rejected signals to dialog's accept/reject slots
initOptionsBase( false );

mMaximumScaleIconLabel->setPixmap( QgsApplication::getThemePixmap( "/mActionZoomIn.png" ) );
mMinimumScaleIconLabel->setPixmap( QgsApplication::getThemePixmap( "/mActionZoomOut.png" ) );

connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
connect( buttonBox->button( QDialogButtonBox::Apply ), SIGNAL( clicked() ), this, SLOT( apply() ) );
connect( this, SIGNAL( accepted() ), this, SLOT( apply() ) );

connect( mOptionsStackedWidget, SIGNAL( currentChanged( int ) ), this, SLOT( mOptionsStackedWidget_CurrentChanged( int ) ) );

connect( insertFieldButton, SIGNAL( clicked() ), this, SLOT( insertField() ) );
connect( insertExpressionButton, SIGNAL( clicked() ), this, SLOT( insertExpression() ) );

// connections for Map Tip display
connect( htmlRadio, SIGNAL( toggled( bool ) ), htmlMapTip, SLOT( setEnabled( bool ) ) );
connect( htmlRadio, SIGNAL( toggled( bool ) ), insertFieldButton, SLOT( setEnabled( bool ) ) );
connect( htmlRadio, SIGNAL( toggled( bool ) ), fieldComboBox, SLOT( setEnabled( bool ) ) );
connect( htmlRadio, SIGNAL( toggled( bool ) ), insertExpressionButton, SLOT( setEnabled( bool ) ) );
connect( fieldComboRadio, SIGNAL( toggled( bool ) ), displayFieldComboBox, SLOT( setEnabled( bool ) ) );

QVBoxLayout *layout;

if ( layer->hasGeometryType() )
Expand All @@ -95,13 +106,15 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
layout = new QVBoxLayout( labelingFrame );
layout->setMargin( 0 );
labelingDialog = new QgsLabelingGui( QgisApp::instance()->palLabeling(), layer, QgisApp::instance()->mapCanvas(), labelingFrame );
labelingDialog->layout()->setMargin( 0 );
layout->addWidget( labelingDialog );
labelingFrame->setLayout( layout );

// Create the Labeling (deprecated) dialog tab
layout = new QVBoxLayout( labelOptionsFrame );
layout->setMargin( 0 );
labelDialog = new QgsLabelDialog( layer->label(), labelOptionsFrame );
labelDialog->layout()->setMargin( 0 );
layout->addWidget( labelDialog );
labelOptionsFrame->setLayout( layout );
connect( labelDialog, SIGNAL( labelSourceSet() ), this, SLOT( setLabelCheckBox() ) );
Expand All @@ -110,15 +123,16 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
{
labelingDialog = 0;
labelDialog = 0;
tabWidget->setTabEnabled( 1, false ); // hide labeling item
tabWidget->setTabEnabled( 2, false ); // hide labeling (deprecated) item
mOptsPage_Labels->setEnabled( false ); // disable labeling item
mOptsPage_LabelsOld->setEnabled( false ); // disable labeling (deprecated) item
}

// Create the Actions dialog tab
QVBoxLayout *actionLayout = new QVBoxLayout( actionOptionsFrame );
actionLayout->setMargin( 0 );
const QgsFields &fields = layer->pendingFields();
actionDialog = new QgsAttributeActionDialog( layer->actions(), fields, actionOptionsFrame );
actionDialog->layout()->setMargin( 0 );
actionLayout->addWidget( actionDialog );

// Create the menu for the save style button to choose the output format
Expand All @@ -128,7 +142,9 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
QObject::connect( mSaveAsMenu, SIGNAL( triggered( QAction * ) ), this, SLOT( saveStyleAsMenuTriggered( QAction * ) ) );

mFieldsPropertiesDialog = new QgsFieldsProperties( layer, mFieldsFrame );
mFieldsPropertiesDialog->layout()->setMargin( 0 );
mFieldsFrame->setLayout( new QVBoxLayout( mFieldsFrame ) );
mFieldsFrame->layout()->setMargin( 0 );
mFieldsFrame->layout()->addWidget( mFieldsPropertiesDialog );

connect( mFieldsPropertiesDialog, SIGNAL( toggleEditing() ), this, SLOT( toggleEditing() ) );
Expand Down Expand Up @@ -158,8 +174,7 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
}
else
{
// currently only encoding can be set in this group, so hide it completely
grpProviderOptions->hide();
mDataSourceEncodingFrame->hide();
}
}

Expand All @@ -174,7 +189,9 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
}

diagramPropertiesDialog = new QgsDiagramProperties( layer, mDiagramFrame );
diagramPropertiesDialog->layout()->setMargin( 0 );
mDiagramFrame->setLayout( new QVBoxLayout( mDiagramFrame ) );
mDiagramFrame->layout()->setMargin( 0 );
mDiagramFrame->layout()->addWidget( diagramPropertiesDialog );

//layer title and abstract
Expand All @@ -184,26 +201,18 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
mLayerAbstractTextEdit->setPlainText( layer->abstract() );
}

QSettings settings;
restoreGeometry( settings.value( "/Windows/VectorLayerProperties/geometry" ).toByteArray() );
int tabIndex = settings.value( "/Windows/VectorLayerProperties/row", 0 ).toInt();
setWindowTitle( tr( "Layer Properties - %1" ).arg( layer->name() ) );

// if the last used tab is not enabled display the first enabled one
if ( !tabWidget->isTabEnabled( tabIndex ) )
QSettings settings;
// if dialog hasn't been opened/closed yet, default to Styles tab, which is used most often
// this will be read by restoreOptionsBaseUi()
if ( !settings.contains( QString( "/Windows/VectorLayerProperties/tab" ) ) )
{
tabIndex = 0;
for ( int i = 0; i < tabWidget->count(); i++ )
{
if ( tabWidget->isTabEnabled( i ) )
{
tabIndex = i;
break;
}
}
settings.setValue( QString( "/Windows/VectorLayerProperties/tab" ),
mOptStackedWidget->indexOf( mOptsPage_Style ) );
}
tabWidget->setCurrentIndex( tabIndex );

setWindowTitle( tr( "Layer Properties - %1" ).arg( layer->name() ) );
restoreOptionsBaseUi();
} // QgsVectorLayerProperties ctor


Expand All @@ -213,10 +222,6 @@ QgsVectorLayerProperties::~QgsVectorLayerProperties()
{
disconnect( labelDialog, SIGNAL( labelSourceSet() ), this, SLOT( setLabelCheckBox() ) );
}

QSettings settings;
settings.setValue( "/Windows/VectorLayerProperties/geometry", saveGeometry() );
settings.setValue( "/Windows/VectorLayerProperties/row", tabWidget->currentIndex() );
}

void QgsVectorLayerProperties::toggleEditing()
Expand Down Expand Up @@ -788,13 +793,15 @@ void QgsVectorLayerProperties::updateSymbologyPage()
}
else
{
tabWidget->setTabEnabled( 0, false ); // hide symbology item
mOptsPage_Style->setEnabled( false ); // hide symbology item
}

if ( mRendererDialog )
{
mRendererDialog->layout()->setMargin( 0 );
widgetStackRenderers->addWidget( mRendererDialog );
widgetStackRenderers->setCurrentWidget( mRendererDialog );
widgetStackRenderers->currentWidget()->layout()->setMargin( 0 );
}
}

Expand All @@ -804,9 +811,9 @@ void QgsVectorLayerProperties::on_pbnUpdateExtents_clicked()
mMetadataFilled = false;
}

void QgsVectorLayerProperties::on_tabWidget_currentChanged( int index )
void QgsVectorLayerProperties::mOptionsStackedWidget_CurrentChanged( int indx )
{
if ( index != 6 || mMetadataFilled )
if ( indx != mOptStackedWidget->indexOf( mOptsPage_Metadata ) || mMetadataFilled )
return;

//set the metadata contents (which can be expensive)
Expand Down
5 changes: 3 additions & 2 deletions src/app/qgsvectorlayerproperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#ifndef QGSVECTORLAYERPROPERTIES
#define QGSVECTORLAYERPROPERTIES

#include "qgsoptionsdialogbase.h"
#include "ui_qgsvectorlayerpropertiesbase.h"
#include "qgisgui.h"
#include "qgsaddattrdialog.h"
Expand All @@ -41,7 +42,7 @@ class QgsLabelingGui;
class QgsDiagramProperties;
class QgsFieldsProperties;

class QgsVectorLayerProperties : public QDialog, private Ui::QgsVectorLayerPropertiesBase
class QgsVectorLayerProperties : public QgsOptionsDialogBase, private Ui::QgsVectorLayerPropertiesBase
{
Q_OBJECT

Expand Down Expand Up @@ -106,7 +107,7 @@ class QgsVectorLayerProperties : public QDialog, private Ui::QgsVectorLayerPrope
void on_pbnSaveDefaultStyle_clicked();
void on_pbnLoadStyle_clicked();
void on_pbnSaveStyleAs_clicked();
void on_tabWidget_currentChanged( int idx );
void mOptionsStackedWidget_CurrentChanged( int indx );
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
void on_pbnUpdateExtents_clicked();

Expand Down
54 changes: 36 additions & 18 deletions src/core/qgsapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,30 +623,48 @@ QString QgsApplication::reportStyleSheet()
// Make the style sheet desktop preferences aware by using qappliation
// palette as a basis for colors where appropriate
//
QColor myColor1 = palette().highlight().color();
// QColor myColor1 = palette().highlight().color();
QColor myColor1( Qt::lightGray );
QColor myColor2 = myColor1;
myColor2 = myColor2.lighter( 110 ); //10% lighter
QString myStyle;
myStyle = "p.glossy{ background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, "
"stop: 0 " + myColor1.name() + ","
"stop: 0.1 " + myColor2.name() + ","
"stop: 0.5 " + myColor1.name() + ","
"stop: 0.9 " + myColor2.name() + ","
"stop: 1 " + myColor1.name() + ");"
"color: white;"
"padding-left: 4px;"
"padding-top: 20px;"
"padding-bottom: 8px;"
"border: 1px solid #6c6c6c;"
" stop: 0 " + myColor1.name() + ","
" stop: 0.1 " + myColor2.name() + ","
" stop: 0.5 " + myColor1.name() + ","
" stop: 0.9 " + myColor2.name() + ","
" stop: 1 " + myColor1.name() + ");"
" color: black;"
" padding-left: 4px;"
" padding-top: 20px;"
" padding-bottom: 8px;"
" border: 1px solid #6c6c6c;"
"}"
"p.subheaderglossy{ background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, "
" stop: 0 " + myColor1.name() + ","
" stop: 0.1 " + myColor2.name() + ","
" stop: 0.5 " + myColor1.name() + ","
" stop: 0.9 " + myColor2.name() + ","
" stop: 1 " + myColor1.name() + ");"
" font-weight: bold;"
" font-size: medium;"
" line-height: 1.1em;"
" width: 100%;"
" color: black;"
" padding-left: 4px;"
" padding-right: 4px;"
" padding-top: 20px;"
" padding-bottom: 8px;"
" border: 1px solid #6c6c6c;"
"}"
"th.glossy{ background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, "
"stop: 0 " + myColor1.name() + ","
"stop: 0.1 " + myColor2.name() + ","
"stop: 0.5 " + myColor1.name() + ","
"stop: 0.9 " + myColor2.name() + ","
"stop: 1 " + myColor1.name() + ");"
"color: white;"
"border: 1px solid #6c6c6c;"
" stop: 0 " + myColor1.name() + ","
" stop: 0.1 " + myColor2.name() + ","
" stop: 0.5 " + myColor1.name() + ","
" stop: 0.9 " + myColor2.name() + ","
" stop: 1 " + myColor1.name() + ");"
" color: black;"
" border: 1px solid #6c6c6c;"
"}"
".overview{ font: 1.82em; font-weight: bold;}"
"body{ background: white;"
Expand Down
114 changes: 54 additions & 60 deletions src/core/qgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3396,31 +3396,33 @@ void QgsVectorLayer::setDiagramLayerSettings( const QgsDiagramLayerSettings& s )
QString QgsVectorLayer::metadata()
{
QString myMetadata = "<html><body>";
myMetadata += "<table width=\"100%\">";

//-------------

myMetadata += "<tr class=\"glossy\"><td>";
myMetadata += tr( "General:" );
myMetadata += "</td></tr>";
myMetadata += "<p class=\"subheaderglossy\">";
myMetadata += tr( "General" );
myMetadata += "</p>\n";

// data comment
if ( !( dataComment().isEmpty() ) )
{
myMetadata += "<tr><td>";
myMetadata += tr( "Layer comment: %1" ).arg( dataComment() );
myMetadata += "</td></tr>";
myMetadata += "<p class=\"glossy\">" + tr( "Layer comment" ) + "</p>\n";
myMetadata += "<p>";
myMetadata += dataComment();
myMetadata += "</p>\n";
}

//storage type
myMetadata += "<tr><td>";
myMetadata += tr( "Storage type of this layer: %1" ).arg( storageType() );
myMetadata += "</td></tr>";
myMetadata += "<p class=\"glossy\">" + tr( "Storage type of this layer" ) + "</p>\n";
myMetadata += "<p>";
myMetadata += storageType();
myMetadata += "</p>\n";

// data source
myMetadata += "<tr><td>";
myMetadata += tr( "Source for this layer: %1" ).arg( publicSource() );
myMetadata += "</td></tr>";
myMetadata += "<p class=\"glossy\">" + tr( "Source for this layer" ) + "</p>\n";
myMetadata += "<p>";
myMetadata += publicSource();
myMetadata += "</p>\n";

//geom type

Expand All @@ -3434,42 +3436,46 @@ QString QgsVectorLayer::metadata()
{
QString typeString( QGis::vectorGeometryType( geometryType() ) );

myMetadata += "<tr><td>";
myMetadata += tr( "Geometry type of the features in this layer: %1" ).arg( typeString );
myMetadata += "</td></tr>";
myMetadata += "<p class=\"glossy\">" + tr( "Geometry type of the features in this layer" ) + "</p>\n";
myMetadata += "<p>";
myMetadata += typeString;
myMetadata += "</p>\n";
}

QgsAttributeList pkAttrList = pendingPkAttributesList();
if ( !pkAttrList.isEmpty() )
{
myMetadata += "<tr><td>";
myMetadata += tr( "Primary key attributes: " );
myMetadata += "<p class=\"glossy\">" + tr( "Primary key attributes" ) + "</p>\n";
myMetadata += "<p>";
foreach ( int idx, pkAttrList )
{
myMetadata += pendingFields()[ idx ].name() + " ";
}
myMetadata += "</td></tr>";
myMetadata += "</p>\n";
}


//feature count
myMetadata += "<tr><td>";
myMetadata += tr( "The number of features in this layer: %1" ).arg( featureCount() );
myMetadata += "</td></tr>";
myMetadata += "<p class=\"glossy\">" + tr( "The number of features in this layer" ) + "</p>\n";
myMetadata += "<p>";
myMetadata += QString::number( featureCount() );
myMetadata += "</p>\n";
//capabilities
myMetadata += "<tr><td>";
myMetadata += tr( "Editing capabilities of this layer: %1" ).arg( capabilitiesString() );
myMetadata += "</td></tr>";
myMetadata += "<p class=\"glossy\">" + tr( "Editing capabilities of this layer" ) + "</p>\n";
myMetadata += "<p>";
myMetadata += capabilitiesString();
myMetadata += "</p>\n";

//-------------

QgsRectangle myExtent = extent();
myMetadata += "<tr class=\"glossy\"><td>";
myMetadata += tr( "Extents:" );
myMetadata += "</td></tr>";
//extents in layer cs TODO...maybe make a little nested table to improve layout...
myMetadata += "<tr><td>" + tr( "In layer spatial reference system units : " );
myMetadata += "<p class=\"subheaderglossy\">";
myMetadata += tr( "Extents" );
myMetadata += "</p>\n";

//extents in layer cs TODO...maybe make a little nested table to improve layout...
myMetadata += "<p class=\"glossy\">" + tr( "In layer spatial reference system units" ) + "</p>\n";
myMetadata += "<p>";
// Try to be a bit clever over what number format we use for the
// extents. Some people don't like it using scientific notation when the
// numbers get large, but for small numbers this is the more practical
Expand Down Expand Up @@ -3525,7 +3531,7 @@ QString QgsVectorLayer::metadata()
myMetadata += tr( "unknown extent" );
}

myMetadata += "</td></tr>";
myMetadata += "</p>\n";

//extents in project cs

Expand All @@ -3534,59 +3540,54 @@ QString QgsVectorLayer::metadata()
#if 0
// TODO: currently disabled, will revisit later [MD]
QgsRectangle myProjectedExtent = coordinateTransform->transformBoundingBox( extent() );
myMetadata += "<tr><td>";
myMetadata += tr( "In project spatial reference system units : " )
+ tr( "xMin,yMin %1,%2 : xMax,yMax %3,%4" )
myMetadata += "<p class=\"glossy\">" + tr( "In project spatial reference system units" ) + "</p>\n";
myMetadata += "<p>";
myMetadata += tr( "xMin,yMin %1,%2 : xMax,yMax %3,%4" )
.arg( myProjectedExtent.xMinimum() )
.arg( myProjectedExtent.yMinimum() )
.arg( myProjectedExtent.xMaximum() )
.arg( myProjectedExtent.yMaximum() );
myMetadata += "</td></tr>";
myMetadata += "</p>\n";
#endif

//
// Display layer spatial ref system
//
myMetadata += "<tr class=\"glossy\"><td>";
myMetadata += tr( "Layer Spatial Reference System:" );
myMetadata += "</td></tr>";
myMetadata += "<tr><td>";
myMetadata += "<p class=\"glossy\">" + tr( "Layer Spatial Reference System" ) + "</p>\n";
myMetadata += "<p>";
myMetadata += crs().toProj4().replace( QRegExp( "\"" ), " \"" );
myMetadata += "</td></tr>";
myMetadata += "</p>\n";

//
// Display project (output) spatial ref system
//
#if 0
// TODO: disabled for now, will revisit later [MD]
myMetadata += "<tr><td bgcolor=\"gray\">";
myMetadata += tr( "Project (Output) Spatial Reference System:" );
myMetadata += "</td></tr>";
myMetadata += "<tr><td>";
//myMetadata += "<tr><td bgcolor=\"gray\">";
myMetadata += "<p class=\"glossy\">" + tr( "Project (Output) Spatial Reference System" ) + "</p>\n";
myMetadata += "<p>";
myMetadata += coordinateTransform->destCRS().toProj4().replace( QRegExp( "\"" ), " \"" );
myMetadata += "</td></tr>";
myMetadata += "</p>\n";
#endif
}
catch ( QgsCsException &cse )
{
Q_UNUSED( cse );
QgsDebugMsg( cse.what() );

myMetadata += "<tr><td>";
myMetadata += tr( "In project spatial reference system units : " )
+ tr( "(Invalid transformation of layer extents)" );
myMetadata += "</td></tr>";
myMetadata += "<p class=\"glossy\">" + tr( "In project spatial reference system units" ) + "</p>\n";
myMetadata += "<p>";
myMetadata += tr( "(Invalid transformation of layer extents)" );
myMetadata += "</p>\n";

}

#if 0
//
// Add the info about each field in the attribute table
//
myMetadata += "<tr class=\"glossy\"><td>";
myMetadata += tr( "Attribute field info:" );
myMetadata += "</td></tr>";
myMetadata += "<tr><td>";
myMetadata += "<p class=\"glossy\">" + tr( "Attribute field info" ) + "</p>\n";
myMetadata += "<p>";

// Start a nested table in this trow
myMetadata += "<table width=\"100%\">";
Expand Down Expand Up @@ -3633,13 +3634,6 @@ QString QgsVectorLayer::metadata()
myMetadata += "</table>"; //end of nested table
#endif

myMetadata += "</td></tr>"; //end of stats container table row
//
// Close the table
//

myMetadata += "</table>";

myMetadata += "</body></html>";
return myMetadata;
}
Expand Down
12 changes: 6 additions & 6 deletions src/core/raster/qgsrasterlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ QList< QPair< QString, QColor > > QgsRasterLayer::legendSymbologyItems() const
QString QgsRasterLayer::metadata()
{
QString myMetadata ;
myMetadata += "<p class=\"glossy\">" + tr( "Driver:" ) + "</p>\n";
myMetadata += "<p class=\"glossy\">" + tr( "Driver" ) + "</p>\n";
myMetadata += "<p>";
myMetadata += mDataProvider->description();
myMetadata += "</p>\n";
Expand All @@ -513,7 +513,7 @@ QString QgsRasterLayer::metadata()

myMetadata += "</p>\n";
myMetadata += "<p class=\"glossy\">";
myMetadata += tr( "Data Type:" );
myMetadata += tr( "Data Type" );
myMetadata += "</p>\n";
myMetadata += "<p>";
//just use the first band
Expand Down Expand Up @@ -558,19 +558,19 @@ QString QgsRasterLayer::metadata()
myMetadata += "</p>\n";

myMetadata += "<p class=\"glossy\">";
myMetadata += tr( "Pyramid overviews:" );
myMetadata += tr( "Pyramid overviews" );
myMetadata += "</p>\n";
myMetadata += "<p>";

myMetadata += "<p class=\"glossy\">";
myMetadata += tr( "Layer Spatial Reference System: " );
myMetadata += tr( "Layer Spatial Reference System" );
myMetadata += "</p>\n";
myMetadata += "<p>";
myMetadata += crs().toProj4();
myMetadata += "</p>\n";

myMetadata += "<p class=\"glossy\">";
myMetadata += tr( "Layer Extent (layer original source projection): " );
myMetadata += tr( "Layer Extent (layer original source projection)" );
myMetadata += "</p>\n";
myMetadata += "<p>";
myMetadata += mDataProvider->extent().toString();
Expand All @@ -580,7 +580,7 @@ QString QgsRasterLayer::metadata()
// TODO: this is not related to layer, to be removed? [MD]
#if 0
myMetadata += "<tr><td class=\"glossy\">";
myMetadata += tr( "Project Spatial Reference System: " );
myMetadata += tr( "Project Spatial Reference System" );
myMetadata += "</p>\n";
myMetadata += "<p>";
myMetadata += mCoordinateTransform->destCRS().toProj4();
Expand Down
17 changes: 17 additions & 0 deletions src/gui/qgsoptionsdialogbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,23 @@ void QgsOptionsDialogBase::restoreOptionsBaseUi()
settings.value( QString( "/Windows/%1/splitState" ).arg( mOptsKey ) ).isNull() ? 150 : 16777215 );
mOptSplitter->restoreState( settings.value( QString( "/Windows/%1/splitState" ).arg( mOptsKey ) ).toByteArray() );
int curIndx = settings.value( QString( "/Windows/%1/tab" ).arg( mOptsKey ), 0 ).toInt();

// if the last used tab is not enabled, or is missing, display the first enabled one
if ( !mOptStackedWidget->widget( curIndx )->isEnabled()
|| mOptStackedWidget->count() < ( curIndx + 1 ) )
{
curIndx = 0;
for ( int i = 0; i < mOptStackedWidget->count(); i++ )
{
if ( mOptStackedWidget->widget( i )->isEnabled() )
{
curIndx = i;
break;
}
}
curIndx = -1; // default fallback
}

mOptStackedWidget->setCurrentIndex( curIndx );
mOptListWidget->setCurrentRow( curIndx );

Expand Down
6 changes: 3 additions & 3 deletions src/providers/gdal/qgsgdalprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ QString QgsGdalProvider::metadata()
// end my added code

myMetadata += "<p class=\"glossy\">";
myMetadata += tr( "Dimensions:" );
myMetadata += tr( "Dimensions" );
myMetadata += "</p>\n";
myMetadata += "<p>";
myMetadata += tr( "X: %1 Y: %2 Bands: %3" )
Expand Down Expand Up @@ -326,7 +326,7 @@ QString QgsGdalProvider::metadata()
else
{
myMetadata += "<p class=\"glossy\">";
myMetadata += tr( "Origin:" );
myMetadata += tr( "Origin" );
myMetadata += "</p>\n";
myMetadata += "<p>";
myMetadata += QString::number( mGeoTransform[0] );
Expand All @@ -335,7 +335,7 @@ QString QgsGdalProvider::metadata()
myMetadata += "</p>\n";

myMetadata += "<p class=\"glossy\">";
myMetadata += tr( "Pixel Size:" );
myMetadata += tr( "Pixel Size" );
myMetadata += "</p>\n";
myMetadata += "<p>";
myMetadata += QString::number( mGeoTransform[1] );
Expand Down
236 changes: 176 additions & 60 deletions src/ui/qgsattributeactiondialogbase.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>695</width>
<height>476</height>
<width>609</width>
<height>731</height>
</rect>
</property>
<property name="sizePolicy">
Expand All @@ -21,12 +21,41 @@
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_2">
<widget class="QgsCollapsibleGroupBox" name="groupBoxActionList">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>3</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Action list</string>
</property>
<property name="syncGroup" stdset="0">
<string notr="true">actiongroup</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0" colspan="5">
<item row="1" column="0">
<widget class="QPushButton" name="moveUpButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Move the selected action up</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionArrowUp.png</normaloff>:/images/themes/default/mActionArrowUp.png</iconset>
</property>
</widget>
</item>
<item row="0" column="0" colspan="6">
<widget class="QTableWidget" name="attributeActionTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
Expand Down Expand Up @@ -70,60 +99,101 @@
</item>
<item row="1" column="3">
<widget class="QPushButton" name="removeButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Remove the selected action</string>
</property>
<property name="text">
<string>Remove action</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="moveUpButton">
<property name="toolTip">
<string>Move the selected action up</string>
<string/>
</property>
<property name="text">
<string>Move up</string>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/symbologyRemove.png</normaloff>:/images/themes/default/symbologyRemove.png</iconset>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="moveDownButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Move the selected action down</string>
</property>
<property name="text">
<string>Move down</string>
<string/>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionArrowDown.png</normaloff>:/images/themes/default/mActionArrowDown.png</iconset>
</property>
</widget>
</item>
<item row="1" column="4">
<item row="1" column="5">
<widget class="QPushButton" name="addDefaultActionsButton">
<property name="text">
<string>Add default actions</string>
</property>
</widget>
</item>
<item row="1" column="4">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox">
<widget class="QgsCollapsibleGroupBox" name="groupBoxActionProperties">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>3</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Action properties</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Type</string>
</property>
<property name="buddy">
<cstring>actionType</cstring>
</property>
</widget>
</item>
<property name="syncGroup" stdset="0">
<string notr="true">actiongroup</string>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<property name="labelAlignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
Expand Down Expand Up @@ -176,7 +246,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>37</width>
<width>12</width>
<height>24</height>
</size>
</property>
Expand Down Expand Up @@ -234,24 +304,8 @@
</widget>
</item>
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPlainTextEdit" name="actionAction">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Enter the action command here</string>
</property>
<property name="whatsThis">
<string>Enter the action here. This can be any program, script or command that is available on your system. When the action is invoked any set of characters within [% and %] will be evaluated as expression and replaced by its result. Double quote marks group text into single arguments to the program, script or command. Double quotes will be ignored if prefixed with a backslash</string>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="1">
<widget class="QToolButton" name="browseButton">
<property name="toolTip">
<string>Browse for action</string>
Expand All @@ -265,6 +319,39 @@
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionFileOpen.png</normaloff>:/images/themes/default/mActionFileOpen.png</iconset>
</property>
</widget>
</item>
<item row="1" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" rowspan="2">
<widget class="QPlainTextEdit" name="actionAction">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Enter the action command here</string>
</property>
<property name="whatsThis">
<string>Enter the action here. This can be any program, script or command that is available on your system. When the action is invoked any set of characters within [% and %] will be evaluated as expression and replaced by its result. Double quote marks group text into single arguments to the program, script or command. Double quotes will be ignored if prefixed with a backslash</string>
</property>
</widget>
</item>
</layout>
Expand Down Expand Up @@ -297,7 +384,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<width>12</width>
<height>20</height>
</size>
</property>
Expand Down Expand Up @@ -340,7 +427,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<width>12</width>
<height>20</height>
</size>
</property>
Expand Down Expand Up @@ -368,22 +455,49 @@
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_1">
<property name="text">
<string>Type</string>
</property>
<property name="buddy">
<cstring>actionType</cstring>
</property>
</widget>
</item>
</layout>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>15</x>
<y>33</y>
<width>41</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Type</string>
</property>
<property name="buddy">
<cstring>actionType</cstring>
</property>
</widget>
</widget>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>QgsCollapsibleGroupBox</class>
<extends>QGroupBox</extends>
<header>qgscollapsiblegroupbox.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>attributeActionTable</tabstop>
<tabstop>moveUpButton</tabstop>
Expand All @@ -400,6 +514,8 @@
<tabstop>insertButton</tabstop>
<tabstop>updateButton</tabstop>
</tabstops>
<resources/>
<resources>
<include location="../../images/images.qrc"/>
</resources>
<connections/>
</ui>
40 changes: 20 additions & 20 deletions src/ui/qgsdiagrampropertiesbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>756</width>
<height>627</height>
<width>752</width>
<height>613</height>
</rect>
</property>
<layout class="QVBoxLayout" name="scrollAreaLayout">
Expand All @@ -63,7 +63,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<width>20</width>
<height>20</height>
</size>
</property>
Expand Down Expand Up @@ -124,8 +124,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>725</width>
<height>397</height>
<width>713</width>
<height>394</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -307,7 +307,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<width>0</width>
<height>20</height>
</size>
</property>
Expand All @@ -320,8 +320,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>725</width>
<height>293</height>
<width>715</width>
<height>278</height>
</rect>
</property>
<attribute name="label">
Expand All @@ -343,7 +343,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>0</height>
</size>
</property>
</spacer>
Expand Down Expand Up @@ -378,7 +378,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>483</width>
<width>0</width>
<height>20</height>
</size>
</property>
Expand Down Expand Up @@ -490,7 +490,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<width>0</width>
<height>20</height>
</size>
</property>
Expand All @@ -509,8 +509,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>725</width>
<height>278</height>
<width>713</width>
<height>271</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -638,7 +638,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<width>0</width>
<height>20</height>
</size>
</property>
Expand All @@ -651,7 +651,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<width>0</width>
<height>20</height>
</size>
</property>
Expand All @@ -671,8 +671,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>738</width>
<height>196</height>
<width>728</width>
<height>166</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -781,7 +781,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>0</height>
</size>
</property>
</spacer>
Expand Down Expand Up @@ -844,7 +844,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>0</height>
</size>
</property>
</spacer>
Expand Down Expand Up @@ -891,7 +891,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>0</height>
</size>
</property>
</spacer>
Expand Down
311 changes: 157 additions & 154 deletions src/ui/qgsrasterlayerpropertiesbase.ui

Large diffs are not rendered by default.

41 changes: 29 additions & 12 deletions src/ui/qgsrulebasedrendererv2widget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>643</width>
<width>709</width>
<height>401</height>
</rect>
</property>
Expand Down Expand Up @@ -43,34 +43,49 @@
<attribute name="headerStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="headerMinimumSectionSize">
<number>100</number>
</attribute>
<attribute name="headerStretchLastSection">
<bool>true</bool>
</attribute>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="btnAddRule">
<property name="toolTip">
<string>Add rule</string>
</property>
<property name="text">
<string>Add</string>
<string/>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionSignPlus.png</normaloff>:/images/themes/default/mActionSignPlus.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnEditRule">
<property name="toolTip">
<string>Edit rule</string>
</property>
<property name="text">
<string>Edit</string>
<string/>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/symbologyEdit.png</normaloff>:/images/themes/default/symbologyEdit.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnRemoveRule">
<property name="toolTip">
<string>Remove rule</string>
</property>
<property name="text">
<string>Remove</string>
<string/>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionSignMinus.png</normaloff>:/images/themes/default/mActionSignMinus.png</iconset>
</property>
</widget>
</item>
Expand Down Expand Up @@ -110,7 +125,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<width>0</width>
<height>20</height>
</size>
</property>
Expand All @@ -127,6 +142,8 @@
</item>
</layout>
</widget>
<resources/>
<resources>
<include location="../../images/images.qrc"/>
</resources>
<connections/>
</ui>
61 changes: 31 additions & 30 deletions src/ui/qgssymbolv2selectordialogbase.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>509</width>
<height>416</height>
<width>444</width>
<height>383</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -65,14 +65,17 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout">
<layout class="QHBoxLayout" name="pushBtnBox">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="btnAddLayer">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Add symbol layer</string>
Expand All @@ -81,11 +84,11 @@
</item>
<item>
<widget class="QPushButton" name="btnRemoveLayer">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Remove symbol layer</string>
Expand All @@ -94,11 +97,11 @@
</item>
<item>
<widget class="QPushButton" name="btnLock">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Lock layer's color</string>
Expand All @@ -110,11 +113,11 @@
</item>
<item>
<widget class="QPushButton" name="btnUp">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Move up</string>
Expand All @@ -123,11 +126,11 @@
</item>
<item>
<widget class="QPushButton" name="btnDown">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Move down</string>
Expand Down Expand Up @@ -175,8 +178,6 @@
</widget>
</item>
</layout>
<zorder>stackedWidget</zorder>
<zorder>stackedWidget</zorder>
</widget>
</item>
</layout>
Expand Down
2,311 changes: 1,420 additions & 891 deletions src/ui/qgsvectorlayerpropertiesbase.ui

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/ui/symbollayer/widget_symbolslist.ui
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>194</width>
<width>0</width>
<height>20</height>
</size>
</property>
Expand All @@ -233,7 +233,7 @@
</property>
<property name="minimumSize">
<size>
<width>150</width>
<width>50</width>
<height>0</height>
</size>
</property>
Expand Down Expand Up @@ -300,7 +300,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<width>0</width>
<height>20</height>
</size>
</property>
Expand Down