257 changes: 111 additions & 146 deletions src/app/qgisapp.cpp

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
//! update proxy settings
void namUpdate();

//! Helper to get a theme icon. It will fall back to the
//default theme if the active theme does not have the required
//icon.
static QIcon getThemeIcon( const QString theName );
//! Helper to get a theme icon as a pixmap. It will fall back to the
//default theme if the active theme does not have the required
//icon.
static QPixmap getThemePixmap( const QString theName );

/** Add a dock widget to the main window. Overloaded from QMainWindow.
* After adding the dock widget to the ui (by delegating to the QMainWindow
* parent class, it will also add it to the View menu list of docks.*/
Expand Down
24 changes: 12 additions & 12 deletions src/app/qgsattributetabledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,18 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid

updateTitle();

mRemoveSelectionButton->setIcon( QgisApp::getThemeIcon( "/mActionUnselectAttributes.png" ) );
mSelectedToTopButton->setIcon( QgisApp::getThemeIcon( "/mActionSelectedToTop.png" ) );
mCopySelectedRowsButton->setIcon( QgisApp::getThemeIcon( "/mActionCopySelected.png" ) );
mZoomMapToSelectedRowsButton->setIcon( QgisApp::getThemeIcon( "/mActionZoomToSelected.png" ) );
mPanMapToSelectedRowsButton->setIcon( QgisApp::getThemeIcon( "/mActionPanToSelected.png" ) );
mInvertSelectionButton->setIcon( QgisApp::getThemeIcon( "/mActionInvertSelection.png" ) );
mToggleEditingButton->setIcon( QgisApp::getThemeIcon( "/mActionToggleEditing.png" ) );
mSaveEditsButton->setIcon( QgisApp::getThemeIcon( "/mActionSaveEdits.png" ) );
mDeleteSelectedButton->setIcon( QgisApp::getThemeIcon( "/mActionDeleteSelected.png" ) );
mOpenFieldCalculator->setIcon( QgisApp::getThemeIcon( "/mActionCalculateField.png" ) );
mAddAttribute->setIcon( QgisApp::getThemeIcon( "/mActionNewAttribute.png" ) );
mRemoveAttribute->setIcon( QgisApp::getThemeIcon( "/mActionDeleteAttribute.png" ) );
mRemoveSelectionButton->setIcon( QgsApplication::getThemeIcon( "/mActionUnselectAttributes.png" ) );
mSelectedToTopButton->setIcon( QgsApplication::getThemeIcon( "/mActionSelectedToTop.png" ) );
mCopySelectedRowsButton->setIcon( QgsApplication::getThemeIcon( "/mActionCopySelected.png" ) );
mZoomMapToSelectedRowsButton->setIcon( QgsApplication::getThemeIcon( "/mActionZoomToSelected.png" ) );
mPanMapToSelectedRowsButton->setIcon( QgsApplication::getThemeIcon( "/mActionPanToSelected.png" ) );
mInvertSelectionButton->setIcon( QgsApplication::getThemeIcon( "/mActionInvertSelection.png" ) );
mToggleEditingButton->setIcon( QgsApplication::getThemeIcon( "/mActionToggleEditing.png" ) );
mSaveEditsButton->setIcon( QgsApplication::getThemeIcon( "/mActionSaveEdits.png" ) );
mDeleteSelectedButton->setIcon( QgsApplication::getThemeIcon( "/mActionDeleteSelected.png" ) );
mOpenFieldCalculator->setIcon( QgsApplication::getThemeIcon( "/mActionCalculateField.png" ) );
mAddAttribute->setIcon( QgsApplication::getThemeIcon( "/mActionNewAttribute.png" ) );
mRemoveAttribute->setIcon( QgsApplication::getThemeIcon( "/mActionDeleteAttribute.png" ) );

// toggle editing
bool canChangeAttributes = mLayer->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeAttributeValues;
Expand Down
6 changes: 3 additions & 3 deletions src/app/qgsbrowserdockwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ QgsBrowserDockWidget::QgsBrowserDockWidget( QWidget * parent ) :
mBrowserView = new QgsBrowserTreeView( this );

QToolButton* refreshButton = new QToolButton( this );
refreshButton->setIcon( QgisApp::instance()->getThemeIcon( "mActionDraw.png" ) );
refreshButton->setIcon( QgsApplication::getThemeIcon( "mActionDraw.png" ) );
// remove this to save space
refreshButton->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
refreshButton->setText( tr( "Refresh" ) );
Expand All @@ -97,7 +97,7 @@ QgsBrowserDockWidget::QgsBrowserDockWidget( QWidget * parent ) :
connect( refreshButton, SIGNAL( clicked() ), this, SLOT( refresh() ) );

QToolButton* addLayersButton = new QToolButton( this );
addLayersButton->setIcon( QgisApp::instance()->getThemeIcon( "mActionAddLayer.png" ) );
addLayersButton->setIcon( QgsApplication::getThemeIcon( "mActionAddLayer.png" ) );
// remove this to save space
addLayersButton->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
addLayersButton->setText( tr( "Add Selection" ) );
Expand All @@ -106,7 +106,7 @@ QgsBrowserDockWidget::QgsBrowserDockWidget( QWidget * parent ) :
connect( addLayersButton, SIGNAL( clicked() ), this, SLOT( addSelectedLayers() ) );

QToolButton* collapseButton = new QToolButton( this );
collapseButton->setIcon( QgisApp::instance()->getThemeIcon( "mActionCollapseTree.png" ) );
collapseButton->setIcon( QgsApplication::getThemeIcon( "mActionCollapseTree.png" ) );
collapseButton->setToolTip( tr( "Collapse All" ) );
collapseButton->setAutoRaise( true );
connect( collapseButton, SIGNAL( clicked() ), mBrowserView, SLOT( collapseAll() ) );
Expand Down
18 changes: 9 additions & 9 deletions src/app/qgscustomprojectiondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ QgsCustomProjectionDialog::QgsCustomProjectionDialog( QWidget *parent, Qt::WFlag
QSettings settings;
restoreGeometry( settings.value( "/Windows/CustomProjection/geometry" ).toByteArray() );

pbnFirst->setIcon( QgisApp::getThemeIcon( "mIconFirst.png" ) );
pbnPrevious->setIcon( QgisApp::getThemeIcon( "mIconPrevious.png" ) );
pbnNext->setIcon( QgisApp::getThemeIcon( "mIconNext.png" ) );
pbnLast->setIcon( QgisApp::getThemeIcon( "mIconLast.png" ) );
pbnNew->setIcon( QgisApp::getThemeIcon( "mIconNew.png" ) );
pbnSave->setIcon( QgisApp::getThemeIcon( "mActionFileSave.png" ) );
pbnDelete->setIcon( QgisApp::getThemeIcon( "mIconDelete.png" ) );
pbnFirst->setIcon( QgsApplication::getThemeIcon( "mIconFirst.png" ) );
pbnPrevious->setIcon( QgsApplication::getThemeIcon( "mIconPrevious.png" ) );
pbnNext->setIcon( QgsApplication::getThemeIcon( "mIconNext.png" ) );
pbnLast->setIcon( QgsApplication::getThemeIcon( "mIconLast.png" ) );
pbnNew->setIcon( QgsApplication::getThemeIcon( "mIconNew.png" ) );
pbnSave->setIcon( QgsApplication::getThemeIcon( "mActionFileSave.png" ) );
pbnDelete->setIcon( QgsApplication::getThemeIcon( "mIconDelete.png" ) );
// user database is created at QGIS startup in QgisApp::createDB
// we just check whether there is our database [MD]
QFileInfo myFileInfo;
Expand Down Expand Up @@ -594,7 +594,7 @@ void QgsCustomProjectionDialog::on_pbnNew_clicked()
if ( pbnNew->text() == tr( "Abort" ) )
{
//if we get here, user has aborted add record
pbnNew->setIcon( QgisApp::getThemeIcon( "mIconNew.png" ) );
pbnNew->setIcon( QgsApplication::getThemeIcon( "mIconNew.png" ) );
//next line needed for new/abort logic
pbnNew->setText( tr( "New" ) );
//get back to the last used record before insert was pressed
Expand All @@ -616,7 +616,7 @@ void QgsCustomProjectionDialog::on_pbnNew_clicked()
pbnNext->setEnabled( false );
pbnLast->setEnabled( false );
pbnDelete->setEnabled( false );
pbnNew->setIcon( QgisApp::getThemeIcon( "mIconNew.png" ) );
pbnNew->setIcon( QgsApplication::getThemeIcon( "mIconNew.png" ) );
//next line needed for new/abort logic
pbnNew->setText( tr( "Abort" ) );
//clear the controls
Expand Down
4 changes: 3 additions & 1 deletion src/app/qgsembedlayerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include "qgsembedlayerdialog.h"
#include "qgsproject.h"
#include "qgisapp.h"
#include "qgsapplication.h"

#include <QDomDocument>
#include <QFileDialog>
#include <QFileInfo>
Expand Down Expand Up @@ -172,7 +174,7 @@ void QgsEmbedLayerDialog::addLegendGroupToTreeWidget( const QDomElement& groupEl
{
groupItem = new QTreeWidgetItem( parent );
}
groupItem->setIcon( 0, QgisApp::getThemeIcon( "mActionFolder.png" ) );
groupItem->setIcon( 0, QgsApplication::getThemeIcon( "mActionFolder.png" ) );
groupItem->setText( 0, groupElem.attribute( "name" ) );
groupItem->setData( 0, Qt::UserRole, "group" );

Expand Down
10 changes: 5 additions & 5 deletions src/app/qgsidentifyresults.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void QgsIdentifyResults::addFeature( QgsVectorLayer *vlayer,
if ( vlayer->pendingFields().size() > 0 )
{
QTreeWidgetItem *editItem = new QTreeWidgetItem( QStringList() << "" << ( vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ) ) );
editItem->setIcon( 0, QgisApp::getThemeIcon( vlayer->isEditable() ? "/mIconEditable.png" : "/mIconEditable.png" ) );
editItem->setIcon( 0, QgsApplication::getThemeIcon( vlayer->isEditable() ? "/mIconEditable.png" : "/mIconEditable.png" ) );
editItem->setData( 0, Qt::UserRole, "edit" );
actionItem->addChild( editItem );
}
Expand All @@ -239,7 +239,7 @@ void QgsIdentifyResults::addFeature( QgsVectorLayer *vlayer,
continue;

QTreeWidgetItem *twi = new QTreeWidgetItem( QStringList() << "" << action.name() );
twi->setIcon( 0, QgisApp::getThemeIcon( "/mAction.png" ) );
twi->setIcon( 0, QgsApplication::getThemeIcon( "/mAction.png" ) );
twi->setData( 0, Qt::UserRole, "action" );
twi->setData( 0, Qt::UserRole + 1, QVariant::fromValue( i ) );
actionItem->addChild( twi );
Expand Down Expand Up @@ -329,7 +329,7 @@ void QgsIdentifyResults::editingToggled()
continue;

QTreeWidgetItem *editItem = actions->child( j );
editItem->setIcon( 0, QgisApp::getThemeIcon( vlayer->isEditable() ? "/mIconEditable.png" : "/mIconEditable.png" ) );
editItem->setIcon( 0, QgsApplication::getThemeIcon( vlayer->isEditable() ? "/mIconEditable.png" : "/mIconEditable.png" ) );
editItem->setText( 1, vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ) );
}
}
Expand Down Expand Up @@ -434,7 +434,7 @@ void QgsIdentifyResults::contextMenuEvent( QContextMenuEvent* event )
if ( featItem )
{
mActionPopup->addAction(
QgisApp::getThemeIcon( vlayer->isEditable() ? "/mIconEditable.png" : "/mIconEditable.png" ),
QgsApplication::getThemeIcon( vlayer->isEditable() ? "/mIconEditable.png" : "/mIconEditable.png" ),
vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ),
this, SLOT( featureForm() ) );
mActionPopup->addAction( tr( "Zoom to feature" ), this, SLOT( zoomToFeature() ) );
Expand Down Expand Up @@ -474,7 +474,7 @@ void QgsIdentifyResults::contextMenuEvent( QContextMenuEvent* event )
continue;

QgsFeatureAction *a = new QgsFeatureAction( action.name(), mFeatures[ featIdx ], vlayer, i, idx, this );
mActionPopup->addAction( QgisApp::getThemeIcon( "/mAction.png" ), action.name(), a, SLOT( execute() ) );
mActionPopup->addAction( QgsApplication::getThemeIcon( "/mAction.png" ), action.name(), a, SLOT( execute() ) );
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/app/qgsmaptoolrotatelabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <QMouseEvent>

#include "qgisapp.h"
#include "qgsapplication.h"

QgsMapToolRotateLabel::QgsMapToolRotateLabel( QgsMapCanvas* canvas ): QgsMapToolLabel( canvas ), mRotationItem( 0 ), mRotationPreviewBox( 0 )
{
Expand Down Expand Up @@ -76,7 +77,7 @@ void QgsMapToolRotateLabel::canvasPressEvent( QMouseEvent *e )

mRotationItem = new QgsPointRotationItem( mCanvas );
mRotationItem->setOrientation( QgsPointRotationItem::Counterclockwise );
mRotationItem->setSymbol( QgisApp::instance()->getThemePixmap( "mActionRotatePointSymbols.png" ).toImage() );
mRotationItem->setSymbol( QgsApplication::getThemePixmap( "mActionRotatePointSymbols.png" ).toImage() );
mRotationItem->setPointLocation( mRotationPoint );
mRotationItem->setSymbolRotation( mCurrentRotation );
}
Expand Down
5 changes: 3 additions & 2 deletions src/app/qgsmergeattributesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "qgsmergeattributesdialog.h"
#include "qgisapp.h"
#include "qgsapplication.h"
#include "qgsfield.h"
#include "qgsmapcanvas.h"
#include "qgsrubberband.h"
Expand Down Expand Up @@ -46,8 +47,8 @@ QgsMergeAttributesDialog::QgsMergeAttributesDialog( const QgsFeatureList &featur
mTableWidget->setSelectionBehavior( QAbstractItemView::SelectRows );
mTableWidget->setSelectionMode( QAbstractItemView::SingleSelection );

mFromSelectedPushButton->setIcon( QgisApp::getThemeIcon( "mActionFromSelectedFeature.png" ) );
mRemoveFeatureFromSelectionButton->setIcon( QgisApp::getThemeIcon( "mActionRemoveSelectedFeature.png" ) );
mFromSelectedPushButton->setIcon( QgsApplication::getThemeIcon( "mActionFromSelectedFeature.png" ) );
mRemoveFeatureFromSelectionButton->setIcon( QgsApplication::getThemeIcon( "mActionRemoveSelectedFeature.png" ) );

QSettings settings;
restoreGeometry( settings.value( "/Windows/MergeAttributes/geometry" ).toByteArray() );
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsnewspatialitelayerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ QgsNewSpatialiteLayerDialog::QgsNewSpatialiteLayerDialog( QWidget *parent, Qt::W
QSettings settings;
restoreGeometry( settings.value( "/Windows/NewSpatiaLiteLayer/geometry" ).toByteArray() );

mAddAttributeButton->setIcon( QgisApp::getThemeIcon( "/mActionNewAttribute.png" ) );
mRemoveAttributeButton->setIcon( QgisApp::getThemeIcon( "/mActionDeleteAttribute.png" ) );
mAddAttributeButton->setIcon( QgsApplication::getThemeIcon( "/mActionNewAttribute.png" ) );
mRemoveAttributeButton->setIcon( QgsApplication::getThemeIcon( "/mActionDeleteAttribute.png" ) );
mTypeBox->addItem( tr( "Text data" ), "text" );
mTypeBox->addItem( tr( "Whole number" ), "integer" );
mTypeBox->addItem( tr( "Decimal number" ), "real" );
Expand Down
949 changes: 30 additions & 919 deletions src/app/qgsrasterlayerproperties.cpp

Large diffs are not rendered by default.

61 changes: 2 additions & 59 deletions src/app/qgsrasterlayerproperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,12 @@ class QgsRasterLayer;
class QgsMapToolEmitPoint;
class QgsRasterRenderer;
class QgsRasterRendererWidget;
class QwtPlotPicker;
class QwtPlotMarker;
class QwtPlotZoomer;
class QgsRasterHistogramWidget;

/**Property sheet for a raster map layer
*@author Tim Sutton
*/

// fix for qwt5/qwt6 QwtDoublePoint vs. QPointF
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
typedef QPointF QwtDoublePoint;
#endif

class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPropertiesBase
{
Q_OBJECT
Expand All @@ -59,9 +52,6 @@ class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPrope
/** synchronize state with associated raster layer */
void sync();

/** Save the histogram as an image to disk */
void histoSaveAsImage( const QString& theFilename );

public slots:
//TODO: Verify that these all need to be public
/** \brief Applies the settings made in the dialog without closing the box */
Expand All @@ -80,8 +70,6 @@ class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPrope
void on_pbnExportTransparentPixelValues_clicked();
/** \brief auto slot executed when the active page in the main widget stack is changed */
void on_tabBar_currentChanged( int theTab );
/** \brief slot executed when user wishes to refresh raster histogram */
void refreshHistogram();
/** \brief slow executed when user wishes to import transparency values */
void on_pbnImportTransparentPixelValues_clicked();
/** \brief slot executed when user presses "Remove Selected Row" button on the transparency page */
Expand All @@ -106,32 +94,9 @@ class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPrope
void on_pbnSaveStyleAs_clicked();
/** Help button */
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
/** This slot lets you save the histogram as an image to disk */
void on_mSaveAsImageButton_clicked();
/**Enable or disable Build pyramids button depending on selection in pyramids list*/
void toggleBuildPyramidsButton();

// histogram

/** Used when the histogram band selector changes, or when tab is loaded. */
void on_cboHistoBand_currentIndexChanged( int );
/** Applies the selected min/max values to the renderer widget. */
void applyHistoMin( );
void applyHistoMax( );
/** Button to activate picking of the min/max value on the graph. */
void on_btnHistoMin_toggled();
void on_btnHistoMax_toggled();
/** Called when a selection has been made using the plot picker. */
void histoPickerSelected( const QPointF & );
/** Called when a selection has been made using the plot picker (for qwt5 only). */
void histoPickerSelectedQwt5( const QwtDoublePoint & );
/** Various actions that are stored in btnHistoActions. */
void histoActionTriggered( QAction* );
/** Draw the min/max markers on the histogram plot. */
void updateHistoMarkers();
/** Button to compute the histogram, appears when no cached histogram is available. */
void on_btnHistoCompute_clicked();

signals:
/** emitted when changes to layer were saved to update legend */
void refreshLegend( QString layerID, bool expandItem );
Expand Down Expand Up @@ -187,28 +152,6 @@ class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPrope
QgsMapCanvas* mMapCanvas;
QgsMapToolEmitPoint* mPixelSelectorTool;

// histogram

QwtPlotPicker* mHistoPicker;
QwtPlotZoomer* mHistoZoomer;
QwtPlotMarker* mHistoMarkerMin;
QwtPlotMarker* mHistoMarkerMax;
double mHistoMin;
double mHistoMax;
QVector<QColor> mHistoColors;
bool mHistoShowMarkers;
bool mHistoLoadApplyAll;
enum HistoShowBands
{
ShowAll = 0,
ShowSelected = 1,
ShowRGB = 2
};
HistoShowBands mHistoShowBands;

/** \brief Compute the histogram on demand. */
bool computeHistogram( bool forceComputeFlag );
/** \brief Returns a list of selected bands - or empty if there is no selection restriction. */
QList< int > histoSelectedBands();
QgsRasterHistogramWidget* mHistogramWidget;
};
#endif
5 changes: 3 additions & 2 deletions src/app/qgsundowidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "qgslegend.h"

#include "qgisapp.h"
#include "qgsapplication.h"

QgsUndoWidget::QgsUndoWidget( QWidget * parent, QgsMapCanvas * mapCanvas )
: QDockWidget( parent )
Expand Down Expand Up @@ -148,13 +149,13 @@ void QgsUndoWidget::setupUi( QDockWidget *UndoWidget )

undoButton = new QPushButton( dockWidgetContents );
undoButton->setObjectName( QString::fromUtf8( "undoButton" ) );
undoButton->setIcon( QgisApp::instance()->getThemeIcon( "mActionUndo.png" ) );
undoButton->setIcon( QgsApplication::getThemeIcon( "mActionUndo.png" ) );

gridLayout->addWidget( undoButton, 1, 0, 1, 1 );

redoButton = new QPushButton( dockWidgetContents );
redoButton->setObjectName( QString::fromUtf8( "redoButton" ) );
redoButton->setIcon( QgisApp::instance()->getThemeIcon( "mActionRedo.png" ) );
redoButton->setIcon( QgsApplication::getThemeIcon( "mActionRedo.png" ) );

gridLayout->addWidget( redoButton, 1, 1, 1, 1 );

Expand Down
10 changes: 5 additions & 5 deletions src/app/qgsvectorlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
connect( layer, SIGNAL( attributeAdded( int ) ), this, SLOT( attributeAdded( int ) ) );
connect( layer, SIGNAL( attributeDeleted( int ) ), this, SLOT( attributeDeleted( int ) ) );

mAddAttributeButton->setIcon( QgisApp::getThemeIcon( "/mActionNewAttribute.png" ) );
mDeleteAttributeButton->setIcon( QgisApp::getThemeIcon( "/mActionDeleteAttribute.png" ) );
mToggleEditingButton->setIcon( QgisApp::getThemeIcon( "/mActionToggleEditing.png" ) );
mCalculateFieldButton->setIcon( QgisApp::getThemeIcon( "/mActionCalculateField.png" ) );
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() ) );

Expand Down Expand Up @@ -179,7 +179,7 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
for ( ; it != overlayPluginList.constEnd(); ++it )
{
QgsApplyDialog* d = ( *it )->dialog( lyr );
position = tabWidget->insertTab( tabWidget->count(), qobject_cast<QDialog*>( d ), QgisApp::getThemeIcon( "propertyicons/diagram.png" ), tr( "Overlay" ) );
position = tabWidget->insertTab( tabWidget->count(), qobject_cast<QDialog*>( d ), QgsApplication::getThemeIcon( "propertyicons/diagram.png" ), tr( "Overlay" ) );
tabWidget->setCurrentIndex( position ); //ugly, but otherwise the properties dialog is a mess
mOverlayDialogs.push_back( d );
}
Expand Down
39 changes: 39 additions & 0 deletions src/core/qgsapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <QMessageBox>
#include <QPalette>
#include <QSettings>
#include <QIcon>
#include <QPixmap>

#ifndef Q_WS_WIN
#include <netinet/in.h>
Expand Down Expand Up @@ -329,6 +331,43 @@ QString QgsApplication::iconPath( QString iconFile )
return defaultThemePath() + iconFile;
}

QIcon QgsApplication::getThemeIcon( const QString theName )
{
QString myPreferredPath = activeThemePath() + QDir::separator() + theName;
QString myDefaultPath = defaultThemePath() + QDir::separator() + theName;
if ( QFile::exists( myPreferredPath ) )
{
return QIcon( myPreferredPath );
}
else if ( QFile::exists( myDefaultPath ) )
{
//could still return an empty icon if it
//doesnt exist in the default theme either!
return QIcon( myDefaultPath );
}
else
{
return QIcon();
}
}

// TODO: add some caching mechanism ?
QPixmap QgsApplication::getThemePixmap( const QString theName )
{
QString myPreferredPath = activeThemePath() + QDir::separator() + theName;
QString myDefaultPath = defaultThemePath() + QDir::separator() + theName;
if ( QFile::exists( myPreferredPath ) )
{
return QPixmap( myPreferredPath );
}
else
{
//could still return an empty icon if it
//doesnt exist in the default theme either!
return QPixmap( myDefaultPath );
}
}

/*!
Set the theme path to the specified theme.
*/
Expand Down
10 changes: 10 additions & 0 deletions src/core/qgsapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,16 @@ class CORE_EXPORT QgsApplication: public QApplication
//! @note Added in 1.5
static QString iconPath( QString iconFile );

//! Helper to get a theme icon. It will fall back to the
//! default theme if the active theme does not have the required icon.
//! @note Added in 2.0
static QIcon getThemeIcon( const QString theName );

//! Helper to get a theme icon as a pixmap. It will fall back to the
//! default theme if the active theme does not have the required icon.
//! @note Added in 2.0
static QPixmap getThemePixmap( const QString theName );

//! Returns the path to user's style. Added in QGIS 1.4
static const QString userStyleV2Path();

Expand Down
43 changes: 10 additions & 33 deletions src/core/qgsdataitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <QSettings>

#include "qgis.h"
#include "qgsapplication.h"
#include "qgsdataitem.h"

#include "qgsdataprovider.h"
Expand All @@ -46,7 +45,7 @@ const QIcon &QgsLayerItem::iconPoint()
static QIcon icon;

if ( icon.isNull() )
icon = QIcon( getThemePixmap( "/mIconPointLayer.png" ) );
icon = QgsApplication::getThemeIcon( "/mIconPointLayer.png" );

return icon;
}
Expand All @@ -56,7 +55,7 @@ const QIcon &QgsLayerItem::iconLine()
static QIcon icon;

if ( icon.isNull() )
icon = QIcon( getThemePixmap( "/mIconLineLayer.png" ) );
icon = QgsApplication::getThemeIcon( "/mIconLineLayer.png" );

return icon;
}
Expand All @@ -66,7 +65,7 @@ const QIcon &QgsLayerItem::iconPolygon()
static QIcon icon;

if ( icon.isNull() )
icon = QIcon( getThemePixmap( "/mIconPolygonLayer.png" ) );
icon = QgsApplication::getThemeIcon( "/mIconPolygonLayer.png" );

return icon;
}
Expand All @@ -76,7 +75,7 @@ const QIcon &QgsLayerItem::iconTable()
static QIcon icon;

if ( icon.isNull() )
icon = QIcon( getThemePixmap( "/mIconTableLayer.png" ) );
icon = QgsApplication::getThemeIcon( "/mIconTableLayer.png" );

return icon;
}
Expand All @@ -86,7 +85,7 @@ const QIcon &QgsLayerItem::iconRaster()
static QIcon icon;

if ( icon.isNull() )
icon = QIcon( getThemePixmap( "/mIconRaster.png" ) );
icon = QgsApplication::getThemeIcon( "/mIconRaster.png" );

return icon;
}
Expand All @@ -96,7 +95,7 @@ const QIcon &QgsLayerItem::iconDefault()
static QIcon icon;

if ( icon.isNull() )
icon = QIcon( getThemePixmap( "/mIconLayer.png" ) );
icon = QgsApplication::getThemeIcon( "/mIconLayer.png" );

return icon;
}
Expand All @@ -106,7 +105,7 @@ const QIcon &QgsDataCollectionItem::iconDataCollection()
static QIcon icon;

if ( icon.isNull() )
icon = QIcon( getThemePixmap( "/mIconDbSchema.png" ) );
icon = QgsApplication::getThemeIcon( "/mIconDbSchema.png" );

return icon;
}
Expand All @@ -132,7 +131,7 @@ const QIcon &QgsFavouritesItem::iconFavourites()
static QIcon icon;

if ( icon.isNull() )
icon = QIcon( getThemePixmap( "/mIconFavourites.png" ) );
icon = QgsApplication::getThemeIcon( "/mIconFavourites.png" );

return icon;
}
Expand All @@ -142,7 +141,7 @@ const QIcon &QgsZipItem::iconZip()
static QIcon icon;

if ( icon.isNull() )
icon = QIcon( getThemePixmap( "/mIconZip.png" ) );
icon = QgsApplication::getThemeIcon( "/mIconZip.png" );
// icon from http://www.softicons.com/free-icons/application-icons/mega-pack-icons-1-by-nikolay-verin/winzip-folder-icon

return icon;
Expand All @@ -160,28 +159,6 @@ QgsDataItem::~QgsDataItem()
QgsDebugMsg( "mName = " + mName + " mPath = " + mPath );
}

// TODO: This is copy from QgisApp, bad
// TODO: add some caching mechanism ?
QPixmap QgsDataItem::getThemePixmap( const QString theName )
{
QString myPreferredPath = QgsApplication::activeThemePath() + QDir::separator() + theName;
QString myDefaultPath = QgsApplication::defaultThemePath() + QDir::separator() + theName;

// QgsDebugMsg( "theName = " + theName );
// QgsDebugMsg( "myPreferredPath = " + myPreferredPath );
// QgsDebugMsg( "myDefaultPath = " + myDefaultPath );
if ( QFile::exists( myPreferredPath ) )
{
return QPixmap( myPreferredPath );
}
else
{
//could still return an empty icon if it
//doesnt exist in the default theme either!
return QPixmap( myDefaultPath );
}
}

void QgsDataItem::emitBeginInsertItems( QgsDataItem* parent, int first, int last )
{
emit beginInsertItems( parent, first, last );
Expand Down Expand Up @@ -698,7 +675,7 @@ void QgsDirectoryParamWidget::showHideColumn()
QgsErrorItem::QgsErrorItem( QgsDataItem* parent, QString error, QString path )
: QgsDataItem( QgsDataItem::Error, parent, error, path )
{
mIcon = QIcon( getThemePixmap( "/mIconDelete.png" ) );
mIcon = QIcon( QgsApplication::getThemePixmap( "/mIconDelete.png" ) );

mPopulated = true; // no more children
}
Expand Down
3 changes: 1 addition & 2 deletions src/core/qgsdataitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <QVector>
#include <QTreeWidget>

#include "qgsapplication.h"
#include "qgsmaplayer.h"
#include "qgscoordinatereferencesystem.h"

Expand Down Expand Up @@ -107,8 +108,6 @@ class CORE_EXPORT QgsDataItem : public QObject

// static methods

static QPixmap getThemePixmap( const QString theName );

// Find child index in vector of items using '==' operator
static int findItem( QVector<QgsDataItem*> items, QgsDataItem * item );

Expand Down
8 changes: 8 additions & 0 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ raster/qgsmultibandcolorrendererwidget.cpp
raster/qgspalettedrendererwidget.cpp
raster/qgssinglebandgrayrendererwidget.cpp
raster/qgssinglebandpseudocolorrendererwidget.cpp
raster/qgsrasterhistogramwidget.cpp

symbology-ng/qgsbrushstylecombobox.cpp
symbology-ng/qgscolorrampcombobox.cpp
Expand Down Expand Up @@ -100,6 +101,7 @@ raster/qgspalettedrendererwidget.h
raster/qgsmultibandcolorrendererwidget.h
raster/qgssinglebandgrayrendererwidget.h
raster/qgssinglebandpseudocolorrendererwidget.h
raster/qgsrasterhistogramwidget.h

symbology-ng/qgsdashspacedialog.h
symbology-ng/qgssymbollayerv2widget.h
Expand Down Expand Up @@ -251,6 +253,7 @@ INCLUDE_DIRECTORIES(
../core/symbology-ng
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/../ui
${QWT_INCLUDE_DIR}
)
IF (WITH_INTERNAL_SPATIALITE)
INCLUDE_DIRECTORIES(../core/spatialite/headers)
Expand Down Expand Up @@ -316,13 +319,18 @@ ADD_DEPENDENCIES(qgis_gui ui)
TARGET_LINK_LIBRARIES(qgis_gui
qgis_core
${QT_QTUITOOLS_LIBRARY}
${QWT_LIBRARY}
#${QT_QTTEST_LIBRARY} # for ModelTest
)

IF (NOT WITH_INTERNAL_SPATIALITE)
TARGET_LINK_LIBRARIES(qgis_gui ${SQLITE3_LIBRARIES})
ENDIF (NOT WITH_INTERNAL_SPATIALITE)

IF(WIN32)
ADD_DEFINITIONS(-DQWT_DLL)
ENDIF(WIN32)

IF (APPLE)
SET_TARGET_PROPERTIES(qgis_gui PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
ENDIF (APPLE)
Expand Down
992 changes: 992 additions & 0 deletions src/gui/raster/qgsrasterhistogramwidget.cpp

Large diffs are not rendered by default.

123 changes: 123 additions & 0 deletions src/gui/raster/qgsrasterhistogramwidget.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
/***************************************************************************
qgsrasterrendererwidget.h
---------------------------
begin : July 2012
copyright : (C) 2012 by Etienne Tourigny
email : etourigny dot dev at gmail dot com
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSRASTERHISTOGRAMWIDGET_H
#define QGSRASTERHISTOGRAMWIDGET_H

#include "ui_qgsrasterhistogramwidgetbase.h"

class QgsRasterLayer;
class QgsRasterRendererWidget;
class QwtPlotPicker;
class QwtPlotMarker;
class QwtPlotZoomer;

// fix for qwt5/qwt6 QwtDoublePoint vs. QPointF
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
typedef QPointF QwtDoublePoint;
#endif

/** Histogram widget
*@author Etienne Tourigny
*/

class QgsRasterHistogramWidget : public QWidget, private Ui::QgsRasterHistogramWidgetBase
{
Q_OBJECT

public:
QgsRasterHistogramWidget( QgsRasterLayer *lyr, QWidget *parent = 0 );
~QgsRasterHistogramWidget();

/** Save the histogram as an image to disk */
bool histoSaveAsImage( const QString& theFilename, int width = 600, int height = 600, int quality = -1 );

/** Set the renderer widget (or just its name if there is no widget) */
void setRendererWidget( const QString& name, QgsRasterRendererWidget* rendererWidget = NULL );

/** Activate the histogram widget */
void setActive( bool theActiveFlag );

/** \brief Compute the histogram on demand. */
bool computeHistogram( bool forceComputeFlag );

/** Apply a histoActionTriggered() event. */
void histoAction( const QString actionName, bool actionFlag = true );

/** Apply a histoActionTriggered() event. */
void setSelectedBand( int index );

public slots:
/** \brief slot executed when user wishes to refresh raster histogramwidget */
void refreshHistogram();
/** This slot lets you save the histogram as an image to disk */
void on_mSaveAsImageButton_clicked();

private slots:
/** Used when the histogram band selector changes, or when tab is loaded. */
void on_cboHistoBand_currentIndexChanged( int );
/** Applies the selected min/max values to the renderer widget. */
void applyHistoMin( );
void applyHistoMax( );
/** Button to activate picking of the min/max value on the graph. */
void on_btnHistoMin_toggled();
void on_btnHistoMax_toggled();
/** Called when a selection has been made using the plot picker. */
void histoPickerSelected( const QPointF & );
/** Called when a selection has been made using the plot picker (for qwt5 only). */
void histoPickerSelectedQwt5( const QwtDoublePoint & );
/** Various actions that are stored in btnHistoActions. */
void histoActionTriggered( QAction* );
/** Draw the min/max markers on the histogram plot. */
void updateHistoMarkers();
/** Button to compute the histogram, appears when no cached histogram is available. */
void on_btnHistoCompute_clicked();

//signals:

private:

enum HistoShowBands
{
ShowAll = 0,
ShowSelected = 1,
ShowRGB = 2
};

/** \brief Pointer to the raster layer that this property dilog changes the behaviour of. */
QgsRasterLayer * mRasterLayer;
/** \brief Pointer to the renderer widget, to get/set min/max. */
QgsRasterRendererWidget* mRendererWidget;
/** \brief Name of the renderer widget (see QgsRasterRendererRegistry). */
QString mRendererName;

QwtPlotPicker* mHistoPicker;
QwtPlotZoomer* mHistoZoomer;
QwtPlotMarker* mHistoMarkerMin;
QwtPlotMarker* mHistoMarkerMax;
double mHistoMin;
double mHistoMax;
QVector<QColor> mHistoColors;
bool mHistoShowMarkers;
bool mHistoLoadApplyAll;
HistoShowBands mHistoShowBands;
/** \brief Returns a list of selected bands in the histogram widget- or empty if there is no selection restriction. */
QList< int > histoSelectedBands();
/** \brief Returns a list of selected bands in the renderer widget. */
QList< int > rendererSelectedBands();
QPair< QString, QString > rendererMinMax( int theBandNo );
};
#endif
8 changes: 4 additions & 4 deletions src/providers/gdal/qgsgdaldataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ QString QgsGdalLayerItem::layerName() const
QgsWCSConnectionItem::QgsWCSConnectionItem( QgsDataItem* parent, QString name, QString path )
: QgsDataCollectionItem( parent, name, path )
{
mIcon = QIcon( getThemePixmap( "mIconWcs.png" ) );
mIcon = QIcon( QgsApplication::getThemePixmap( "mIconWcs.png" ) );
}

QgsWCSConnectionItem::~QgsWCSConnectionItem()
Expand Down Expand Up @@ -245,7 +245,7 @@ QgsWCSLayerItem::QgsWCSLayerItem( QgsDataItem* parent, QString name, QString pat
if ( mChildren.size() == 0 )
{
//mIcon = iconRaster();
mIcon = QIcon( getThemePixmap( "mIconWcs.png" ) );
mIcon = QgsApplication::getThemeIcon( "mIconWcs.png" );
}
mPopulated = true;
}
Expand Down Expand Up @@ -323,7 +323,7 @@ QString QgsWCSLayerItem::createUri()
QgsWCSRootItem::QgsWCSRootItem( QgsDataItem* parent, QString name, QString path )
: QgsDataCollectionItem( parent, name, path )
{
mIcon = QIcon( getThemePixmap( "mIconWcs.png" ) );
mIcon = QgsApplication::getThemeIcon( "mIconWcs.png" );

populate();
}
Expand All @@ -341,7 +341,7 @@ QVector<QgsDataItem*>QgsWCSRootItem::createChildren()
QgsOWSConnection connection( "WCS", connName );
QgsDataItem * conn = new QgsWCSConnectionItem( this, connName, connection.uri().encodedUri() );

conn->setIcon( QIcon( getThemePixmap( "mIconConnect.png" ) ) );
conn->setIcon( QgsApplication::getThemeIcon( "mIconConnect.png" ) );
connections.append( conn );
}
return connections;
Expand Down
8 changes: 8 additions & 0 deletions src/providers/gdal/qgsgdalprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,10 @@ void QgsGdalProvider::populateHistogram( int theBandNo, QgsRasterBandStats & the
double dfHalfBucket = 0;
eErr = GDALGetRasterStatistics( myGdalBand, TRUE, TRUE, &myMinVal, &myMaxVal, NULL, NULL );
if ( eErr != CE_None )
{
delete [] myHistogramArray;
return;
}
dfHalfBucket = ( myMaxVal - myMinVal ) / ( 2 * theBinCount );
myMinVal -= dfHalfBucket;
myMaxVal += dfHalfBucket;
Expand All @@ -1509,7 +1512,10 @@ void QgsGdalProvider::populateHistogram( int theBandNo, QgsRasterBandStats & the
theIgnoreOutOfRangeFlag, theHistogramEstimatedFlag, progressCallback,
&myProg ); //this is the arg for our custom gdal progress callback
if ( myError != CE_None )
{
delete [] myHistogramArray;
return;
}

#endif

Expand All @@ -1526,6 +1532,8 @@ void QgsGdalProvider::populateHistogram( int theBandNo, QgsRasterBandStats & the
// QgsDebugMsg( "Added " + QString::number( myHistogramArray[myBin] ) + " to histogram vector" );
}
}
delete [] myHistogramArray;


}
QgsDebugMsg( ">>>>> Histogram vector now contains " + QString::number( theBandStats.histogramVector->size() ) +
Expand Down
6 changes: 3 additions & 3 deletions src/providers/mssql/qgsmssqldataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
QgsMssqlConnectionItem::QgsMssqlConnectionItem( QgsDataItem* parent, QString name, QString path )
: QgsDataCollectionItem( parent, name, path )
{
mIcon = QIcon( getThemePixmap( "mIconConnect.png" ) );
mIcon = QgsApplication::getThemeIcon( "mIconConnect.png" );
QSettings settings;
QString key = "/MSSQL/connections/" + mName;
mService = settings.value( key + "/service" ).toString();
Expand Down Expand Up @@ -438,7 +438,7 @@ QString QgsMssqlLayerItem::createUri()
QgsMssqlSchemaItem::QgsMssqlSchemaItem( QgsDataItem* parent, QString name, QString path )
: QgsDataCollectionItem( parent, name, path )
{
mIcon = QIcon( getThemePixmap( "mIconDbSchema.png" ) );
mIcon = QgsApplication::getThemeIcon( "mIconDbSchema.png" );
}

QVector<QgsDataItem*> QgsMssqlSchemaItem::createChildren()
Expand Down Expand Up @@ -518,7 +518,7 @@ QgsMssqlLayerItem* QgsMssqlSchemaItem::addLayer( QgsMssqlLayerProperty layerProp
QgsMssqlRootItem::QgsMssqlRootItem( QgsDataItem* parent, QString name, QString path )
: QgsDataCollectionItem( parent, name, path )
{
mIcon = QIcon( getThemePixmap( "mIconMssql.png" ) );
mIcon = QgsApplication::getThemeIcon( "mIconMssql.png" );
populate();
}

Expand Down
10 changes: 5 additions & 5 deletions src/providers/mssql/qgsmssqltablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,23 +296,23 @@ QIcon QgsMssqlTableModel::iconForWkbType( QGis::WkbType type )
case QGis::WKBPoint25D:
case QGis::WKBMultiPoint:
case QGis::WKBMultiPoint25D:
return QIcon( QgsDataItem::getThemePixmap( "/mIconPointLayer.png" ) );
return QgsApplication::getThemeIcon( "/mIconPointLayer.png" );
case QGis::WKBLineString:
case QGis::WKBLineString25D:
case QGis::WKBMultiLineString:
case QGis::WKBMultiLineString25D:
return QIcon( QgsDataItem::getThemePixmap( "/mIconLineLayer.png" ) );
return QgsApplication::getThemeIcon( "/mIconLineLayer.png" );
case QGis::WKBPolygon:
case QGis::WKBPolygon25D:
case QGis::WKBMultiPolygon:
case QGis::WKBMultiPolygon25D:
return QIcon( QgsDataItem::getThemePixmap( "/mIconPolygonLayer.png" ) );
return QgsApplication::getThemeIcon( "/mIconPolygonLayer.png" );
case QGis::WKBNoGeometry:
return QIcon( QgsDataItem::getThemePixmap( "/mIconTableLayer.png" ) );
return QgsApplication::getThemeIcon( "/mIconTableLayer.png" );
case QGis::WKBUnknown:
break;
}
return QIcon( QgsDataItem::getThemePixmap( "/mIconLayer.png" ) );
return QgsApplication::getThemeIcon( "/mIconLayer.png" );
}

bool QgsMssqlTableModel::setData( const QModelIndex &idx, const QVariant &value, int role )
Expand Down
6 changes: 4 additions & 2 deletions src/providers/ows/qgsowsdataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
#include "qgsowsconnection.h"
#include "qgsnewhttpconnection.h"

#include "qgsapplication.h"

#include <QFileInfo>

// ---------------------------------------------------------------------------
QgsOWSConnectionItem::QgsOWSConnectionItem( QgsDataItem* parent, QString name, QString path )
: QgsDataCollectionItem( parent, name, path )
{
mIcon = QIcon( getThemePixmap( "mIconConnect.png" ) );
mIcon = QgsApplication::getThemeIcon( "mIconConnect.png" );
}

QgsOWSConnectionItem::~QgsOWSConnectionItem()
Expand Down Expand Up @@ -134,7 +136,7 @@ void QgsOWSConnectionItem::deleteConnection()
QgsOWSRootItem::QgsOWSRootItem( QgsDataItem* parent, QString name, QString path )
: QgsDataCollectionItem( parent, name, path )
{
mIcon = QIcon( getThemePixmap( "mIconOws.png" ) );
mIcon = QgsApplication::getThemeIcon( "mIconOws.png" );

populate();
}
Expand Down
10 changes: 5 additions & 5 deletions src/providers/postgres/qgspgtablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,23 +285,23 @@ QIcon QgsPgTableModel::iconForWkbType( QGis::WkbType type )
case QGis::WKBPoint25D:
case QGis::WKBMultiPoint:
case QGis::WKBMultiPoint25D:
return QIcon( QgsDataItem::getThemePixmap( "/mIconPointLayer.png" ) );
return QgsApplication::getThemeIcon( "/mIconPointLayer.png" );
case QGis::WKBLineString:
case QGis::WKBLineString25D:
case QGis::WKBMultiLineString:
case QGis::WKBMultiLineString25D:
return QIcon( QgsDataItem::getThemePixmap( "/mIconLineLayer.png" ) );
return QgsApplication::getThemeIcon( "/mIconLineLayer.png" );
case QGis::WKBPolygon:
case QGis::WKBPolygon25D:
case QGis::WKBMultiPolygon:
case QGis::WKBMultiPolygon25D:
return QIcon( QgsDataItem::getThemePixmap( "/mIconPolygonLayer.png" ) );
return QgsApplication::getThemeIcon( "/mIconPolygonLayer.png" );
case QGis::WKBNoGeometry:
return QIcon( QgsDataItem::getThemePixmap( "/mIconTableLayer.png" ) );
return QgsApplication::getThemeIcon( "/mIconTableLayer.png" );
case QGis::WKBUnknown:
break;
}
return QIcon( QgsDataItem::getThemePixmap( "/mIconLayer.png" ) );
return QgsApplication::getThemeIcon( "/mIconLayer.png" );
}

bool QgsPgTableModel::setData( const QModelIndex &idx, const QVariant &value, int role )
Expand Down
7 changes: 4 additions & 3 deletions src/providers/postgres/qgspostgresdataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "qgscolumntypethread.h"
#include "qgslogger.h"
#include "qgsdatasourceuri.h"
#include "qgsapplication.h"

#include <QMessageBox>

Expand All @@ -28,7 +29,7 @@ QGISEXTERN bool deleteLayer( const QString& uri, QString& errCause );
QgsPGConnectionItem::QgsPGConnectionItem( QgsDataItem* parent, QString name, QString path )
: QgsDataCollectionItem( parent, name, path )
{
mIcon = QIcon( getThemePixmap( "mIconConnect.png" ) );
mIcon = QgsApplication::getThemeIcon( "mIconConnect.png" );
}

QgsPGConnectionItem::~QgsPGConnectionItem()
Expand Down Expand Up @@ -304,7 +305,7 @@ QString QgsPGLayerItem::createUri()
QgsPGSchemaItem::QgsPGSchemaItem( QgsDataItem* parent, QString name, QString path )
: QgsDataCollectionItem( parent, name, path )
{
mIcon = QIcon( getThemePixmap( "mIconDbSchema.png" ) );
mIcon = QgsApplication::getThemeIcon( "mIconDbSchema.png" );
}

QVector<QgsDataItem*> QgsPGSchemaItem::createChildren()
Expand Down Expand Up @@ -364,7 +365,7 @@ void QgsPGSchemaItem::addLayer( QgsPostgresLayerProperty layerProperty )
QgsPGRootItem::QgsPGRootItem( QgsDataItem* parent, QString name, QString path )
: QgsDataCollectionItem( parent, name, path )
{
mIcon = QIcon( getThemePixmap( "mIconPostgis.png" ) );
mIcon = QgsApplication::getThemeIcon( "mIconPostgis.png" );
populate();
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/spatialite/qgsspatialitedataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ bool QgsSLConnectionItem::handleDrop( const QMimeData * data, Qt::DropAction )
QgsSLRootItem::QgsSLRootItem( QgsDataItem* parent, QString name, QString path )
: QgsDataCollectionItem( parent, name, path )
{
mIcon = QIcon( getThemePixmap( "mIconSpatialite.png" ) );
mIcon = QgsApplication::getThemeIcon( "mIconSpatialite.png" );
populate();
}

Expand Down
8 changes: 4 additions & 4 deletions src/providers/wfs/qgswfsdataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ QgsWFSLayerItem::QgsWFSLayerItem( QgsDataItem* parent, QString name, QgsDataSour
mUri = QgsWFSCapabilities( uri.encodedUri() ).uriGetFeature( featureType );
mPopulated = true;
//mIcon = QIcon( getThemePixmap( "mIconVectorLayer.png" ) );
mIcon = QIcon( getThemePixmap( "mIconWfs.png" ) );
mIcon = QgsApplication::getThemeIcon( "mIconWfs.png" );
}

QgsWFSLayerItem::~QgsWFSLayerItem()
Expand All @@ -42,7 +42,7 @@ QgsWFSLayerItem::~QgsWFSLayerItem()
QgsWFSConnectionItem::QgsWFSConnectionItem( QgsDataItem* parent, QString name, QString path )
: QgsDataCollectionItem( parent, name, path ), mName( name ), mCapabilities( NULL )
{
mIcon = QIcon( getThemePixmap( "mIconWfs.png" ) );
mIcon = QgsApplication::getThemeIcon( "mIconWfs.png" );
}

QgsWFSConnectionItem::~QgsWFSConnectionItem()
Expand Down Expand Up @@ -138,7 +138,7 @@ void QgsWFSConnectionItem::deleteConnection()
QgsWFSRootItem::QgsWFSRootItem( QgsDataItem* parent, QString name, QString path )
: QgsDataCollectionItem( parent, name, path )
{
mIcon = QIcon( getThemePixmap( "mIconWfs.png" ) );
mIcon = QgsApplication::getThemeIcon( "mIconWfs.png" );

populate();
}
Expand All @@ -155,7 +155,7 @@ QVector<QgsDataItem*> QgsWFSRootItem::createChildren()
{
QgsOWSConnection connection( "WF", connName );
QgsDataItem * conn = new QgsWFSConnectionItem( this, connName, connection.uri().encodedUri() );
conn->setIcon( QIcon( getThemePixmap( "mIconConnect.png" ) ) );
conn->setIcon( QgsApplication::getThemeIcon( "mIconConnect.png" ) );
connections.append( conn );
}
return connections;
Expand Down
10 changes: 6 additions & 4 deletions src/providers/wms/qgswmsdataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@

#include "qgstilescalewidget.h"

#include "qgsapplication.h"

// ---------------------------------------------------------------------------
QgsWMSConnectionItem::QgsWMSConnectionItem( QgsDataItem* parent, QString name, QString path )
: QgsDataCollectionItem( parent, name, path )
{
mIcon = QIcon( getThemePixmap( "mIconWms.png" ) );
mIcon = QgsApplication::getThemeIcon( "mIconWms.png" );
}

QgsWMSConnectionItem::~QgsWMSConnectionItem()
Expand Down Expand Up @@ -163,7 +165,7 @@ QgsWMSLayerItem::QgsWMSLayerItem( QgsDataItem* parent, QString name, QString pat
if ( mChildren.size() == 0 )
{
//mIcon = iconRaster();
mIcon = QIcon( getThemePixmap( "mIconWms.png" ) );
mIcon = QgsApplication::getThemeIcon( "mIconWms.png" );
}
mPopulated = true;
}
Expand Down Expand Up @@ -221,7 +223,7 @@ QString QgsWMSLayerItem::createUri()
QgsWMSRootItem::QgsWMSRootItem( QgsDataItem* parent, QString name, QString path )
: QgsDataCollectionItem( parent, name, path )
{
mIcon = QIcon( getThemePixmap( "mIconWms.png" ) );
mIcon = QgsApplication::getThemeIcon( "mIconWms.png" );

populate();
}
Expand All @@ -240,7 +242,7 @@ QVector<QgsDataItem*>QgsWMSRootItem::createChildren()
QgsWMSConnection connection( connName );
QgsDataItem * conn = new QgsWMSConnectionItem( this, connName, connection.uri().encodedUri() );

conn->setIcon( QIcon( getThemePixmap( "mIconConnect.png" ) ) );
conn->setIcon( QgsApplication::getThemeIcon( "mIconConnect.png" ) );
connections.append( conn );
}
return connections;
Expand Down
441 changes: 441 additions & 0 deletions src/ui/qgsrasterhistogramwidgetbase.ui

Large diffs are not rendered by default.

486 changes: 27 additions & 459 deletions src/ui/qgsrasterlayerpropertiesbase.ui

Large diffs are not rendered by default.

17 changes: 11 additions & 6 deletions tests/src/core/qgsrenderchecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

#include "qgsrenderchecker.h"

#include <QDir>
#include <QColor>
#include <QPainter>
#include <QImage>
Expand All @@ -33,16 +32,17 @@ QgsRenderChecker::QgsRenderChecker( ) :
mMatchTarget( 0 ),
mElapsedTime( 0 ),
mElapsedTimeTarget( 0 ),
mpMapRenderer( NULL )
mpMapRenderer( NULL ),
mControlPathPrefix( "" )
{

}

QString QgsRenderChecker::controlImagePath() const
{
QString myDataDir( TEST_DATA_DIR ); //defined in CmakeLists.txt
QString myControlImageDir = myDataDir + QDir::separator() + "control_images"
+ QDir::separator() ;
QString myControlImageDir = myDataDir + QDir::separator() + "control_images" +
QDir::separator() + mControlPathPrefix;
return myControlImageDir;
}

Expand Down Expand Up @@ -167,7 +167,8 @@ bool QgsRenderChecker::runTest( QString theTestName,


bool QgsRenderChecker::compareImages( QString theTestName,
unsigned int theMismatchCount )
unsigned int theMismatchCount,
QString theRenderedImageFile )
{
if ( mExpectedImageFile.isEmpty() )
{
Expand All @@ -178,6 +179,10 @@ bool QgsRenderChecker::compareImages( QString theTestName,
"Image File not set.</td></tr></table>\n";
return false;
}
if ( ! theRenderedImageFile.isEmpty() )
{
mRenderedImageFile = theRenderedImageFile;
}
if ( mRenderedImageFile.isEmpty() )
{
qDebug( "QgsRenderChecker::runTest failed - Rendered Image File not set." );
Expand Down Expand Up @@ -327,7 +332,7 @@ bool QgsRenderChecker::compareImages( QString theTestName,
"\" type=\"text/text\">" + myMessage +
" If you feel the difference image should be considered an anomaly "
"you can do something like this\n"
"cp " + myDiffImageFile + "../tests/testdata/control_images/" + theTestName +
"cp " + myDiffImageFile + " ../tests/testdata/control_images/" + theTestName +
"/<imagename>.png"
"</DartMeasurement>";
qDebug() << myMeasureMessage;
Expand Down
8 changes: 7 additions & 1 deletion tests/src/core/qgsrenderchecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#ifndef QGSRENDERCHECKER_H
#define QGSRENDERCHECKER_H

#include <QDir>
#include <QString>
#include <qgsmaprenderer.h>
class QImage;
Expand Down Expand Up @@ -52,6 +53,10 @@ class QgsRenderChecker
* controlImagePath + '/' + mControlName + '/' + mControlName + '.png'
*/
void setControlName( const QString theName );
/** Prefix where the control images are kept.
* This will be appended to controlImagePath
*/
void setControlPathPrefix( const QString theName ) { mControlPathPrefix = theName + QDir::separator(); }
/** Get an md5 hash that uniquely identifies an image */
QString imageToHash( QString theImageFile );

Expand Down Expand Up @@ -79,7 +84,7 @@ class QgsRenderChecker
* for that by providing a tolerance.
* @note: make sure to call setExpectedImage and setRenderedImage first.
*/
bool compareImages( QString theTestName, unsigned int theMismatchCount = 0 );
bool compareImages( QString theTestName, unsigned int theMismatchCount = 0, QString theRenderedImageFile = "" );
/** Get a list of all teh anomalies. An anomaly is a rendered difference
* file where there is some red pixel content (indicating a render check
* mismatch), but where the output was still acceptible. If the render
Expand All @@ -100,6 +105,7 @@ class QgsRenderChecker
int mElapsedTime;
int mElapsedTimeTarget;
QgsMapRenderer * mpMapRenderer;
QString mControlPathPrefix;

}; // class QgsRenderChecker

Expand Down
8 changes: 8 additions & 0 deletions tests/src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../core #for render checker class
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/gui
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/gui/symbology-ng
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/gui/raster
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/core
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/core/raster
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/core/symbology-ng
${QT_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${QWT_INCLUDE_DIR}
)

#############################################################
Expand All @@ -37,6 +39,10 @@ IF (WIN32)
SET(PLATFORM_LIBRARIES wsock32)
ENDIF (WIN32)

IF(WIN32)
ADD_DEFINITIONS(-DQWT_DLL)
ENDIF(WIN32)

# Since the tests are not actually installed, but rather
# run directly from the build/src/tests dir we need to
# ensure the omg libs can be found.
Expand Down Expand Up @@ -93,6 +99,7 @@ MACRO (ADD_QGIS_TEST testname testsrc)
${PROJ_LIBRARY}
${GEOS_LIBRARY}
${GDAL_LIBRARY}
${QWT_LIBRARY}
qgis_core
qgis_gui)
ADD_TEST(qgis_${testname} ${CMAKE_CURRENT_BINARY_DIR}/../../../output/bin/qgis_${testname})
Expand All @@ -110,4 +117,5 @@ ADD_QGIS_TEST(zoomtest testqgsmaptoolzoom.cpp)
#QT4_WRAP_CPP(rendererv2gui_MOC_SRCS ${rendererv2gui_HDRS})
#ADD_EXECUTABLE(qgis_rendererv2gui ${rendererv2gui_SRCS} ${rendererv2gui_MOC_SRCS})

ADD_QGIS_TEST(histogramtest testqgsrasterhistogram.cpp)

295 changes: 295 additions & 0 deletions tests/src/gui/testqgsrasterhistogram.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,295 @@
/***************************************************************************
testziplayer.cpp
--------------------------------------
Date : Mon Jul 16 15:50:29 BRT 2012
Copyright : (C) 2012 Etienne Tourigny
Email : etourigny.dev@gmail.com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include <QtTest>
#include <QObject>
#include <QString>
#include <QObject>
#include <QApplication>
#include <QFileInfo>

#include <qwt_global.h>

//qgis includes...
#include <qgsapplication.h>
#include <qgsproviderregistry.h>
#include <qgsrasterlayer.h>
#include <qgsconfig.h>
#include "qgssinglebandgrayrendererwidget.h"
#include "qgsmultibandcolorrendererwidget.h"
#include "qgssinglebandpseudocolorrendererwidget.h"
#include "qgsrasterhistogramwidget.h"

//qgis unit test includes
#include <qgsrenderchecker.h>


/** \ingroup UnitTests
* This is a unit test to verify that raster histogram works
*/
class TestRasterHistogram: public QObject
{
Q_OBJECT;

private:

QString mDataDir;
QString mTestPrefix;
int mWidth, mHeight, mImageQuality;
QgsRasterLayer* mRasterLayer;
QgsSingleBandGrayRendererWidget* mGrayRendererWidget;
QgsMultiBandColorRendererWidget* mRGBRendererWidget;
QgsSingleBandPseudoColorRendererWidget* mPseudoRendererWidget;
QgsRasterHistogramWidget* mHistogramWidget;
QString mReport;

bool openLayer( const QString& fileName );
void closeLayer( );
bool saveImage( const QString& fileName );
bool testFile( QString testName,
QString rendererName,
QgsRasterRendererWidget* rendererWidget,
QStringList actionsList = QStringList(),
int selectedBand = -1 );

private slots:

// init / cleanup
void initTestCase();// will be called before the first testfunction is executed.
void cleanupTestCase();// will be called after the last testfunction was executed.
void init() {};// will be called before each testfunction is executed.
void cleanup() {};// will be called after every testfunction.

// tests
void testGray1();
void testGray2();
void testRGB1();
void testRGB2();
void testRGB3();
void testRGB4();
void testPseudo1();
};


// slots

void TestRasterHistogram::initTestCase()
{
QgsApplication::init();
QgsApplication::initQgis();
QString mySettings = QgsApplication::showSettings();
mySettings = mySettings.replace( "\n", "<br />" );

// output test environment
QgsApplication::showSettings();
qDebug() << "QWT version: " << QWT_VERSION_STR;
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
mTestPrefix = "histogram_qwt6";
#else
mTestPrefix = "histogram_qwt5";
#endif

// save data dir
mDataDir = QString( TEST_DATA_DIR ) + QDir::separator();
mWidth = mHeight = 400;
mImageQuality = -1;
// Set up the QSettings environment
QCoreApplication::setOrganizationName( "QuantumGIS" );
QCoreApplication::setOrganizationDomain( "qgis.org" );
QCoreApplication::setApplicationName( "QGIS-TEST" );

// setup objects
mRasterLayer = 0;
mGrayRendererWidget = 0;
mRGBRendererWidget = 0;
mPseudoRendererWidget = 0;
mHistogramWidget = 0;

mReport += "<h1>Raster Histogram Tests</h1>\n";
mReport += "<p>" + mySettings + "</p>";

// remove .aux.xml file to make sure histogram computation is fresh
QFile::remove( mDataDir + QDir::separator() + "landsat.tif.aux.xml" );
QVERIFY( openLayer( "landsat.tif" ) );
}

void TestRasterHistogram::cleanupTestCase()
{
closeLayer();
// remove .aux.xml file to make sure histogram computation is fresh
QFile::remove( mDataDir + QDir::separator() + "landsat.tif.aux.xml" );
QString myReportFile = QDir::tempPath() + QDir::separator() + "qgishistotest.html";
QFile myFile( myReportFile );
if ( myFile.open( QIODevice::WriteOnly | QIODevice::Append ) )
{
QTextStream myQTextStream( &myFile );
myQTextStream << mReport;
myFile.close();
//QDesktopServices::openUrl( "file:///" + myReportFile );
}
}

// grayscale, all bands
void TestRasterHistogram::testGray1( )
{
QStringList actionsList;
QVERIFY( testFile( "gray1", "singlebandgray", mGrayRendererWidget, actionsList )
== true );
}

// grayscale, gray band
void TestRasterHistogram::testGray2( )
{
QStringList actionsList( "Show RGB" );
QVERIFY( testFile( "gray2", "singlebandgray", mGrayRendererWidget, actionsList )
== true );
}

// RGB, all bands
void TestRasterHistogram::testRGB1( )
{
QStringList actionsList;
QVERIFY( testFile( "rgb1", "multibandcolor", mRGBRendererWidget, actionsList )
== true );
}

// RGB, RGB bands
void TestRasterHistogram::testRGB2( )
{
QStringList actionsList( "Show RGB" );
QVERIFY( testFile( "rgb2", "multibandcolor", mRGBRendererWidget, actionsList )
== true );
}

// RGB, band 5
void TestRasterHistogram::testRGB3( )
{
QStringList actionsList( "Show selected" );
QVERIFY( testFile( "rgb3", "multibandcolor", mRGBRendererWidget, actionsList, 5 )
== true );
}

// RGB, all bands + markers, load 1 stddev
void TestRasterHistogram::testRGB4( )
{
QStringList actionsList;
actionsList << "Show selected" << "Show markers" << "Load 1 stddev";
QVERIFY( testFile( "rgb4", "multibandcolor", mRGBRendererWidget, actionsList )
== true );
}

// pseudocolor, all bands
void TestRasterHistogram::testPseudo1( )
{
QStringList actionsList;
QVERIFY( testFile( "pseudo1", "singlebandpseudocolor", mPseudoRendererWidget, actionsList )
== true );
}

// helper methods

bool TestRasterHistogram::openLayer( const QString& fileName )
{
mRasterLayer = new QgsRasterLayer( mDataDir + QDir::separator() + fileName, fileName );
if ( ! mRasterLayer )
return false;
mGrayRendererWidget = new QgsSingleBandGrayRendererWidget( mRasterLayer );
mRGBRendererWidget = new QgsMultiBandColorRendererWidget( mRasterLayer );
mPseudoRendererWidget = new QgsSingleBandPseudoColorRendererWidget( mRasterLayer );
mHistogramWidget = new QgsRasterHistogramWidget( mRasterLayer, 0 );
mHistogramWidget->computeHistogram( true );
return true;
}

void TestRasterHistogram::closeLayer( )
{
if ( mHistogramWidget )
{
delete mHistogramWidget;
mHistogramWidget = 0;
}
if ( mGrayRendererWidget )
{
delete mGrayRendererWidget;
mGrayRendererWidget = 0;
}
if ( mRGBRendererWidget )
{
delete mRGBRendererWidget;
mRGBRendererWidget = 0;
}
if ( mPseudoRendererWidget )
{
delete mPseudoRendererWidget;
mPseudoRendererWidget = 0;
}
if ( mRasterLayer )
{
delete mRasterLayer;
mRasterLayer = 0;
}
}

bool TestRasterHistogram::saveImage( const QString& fileName )
{
return mHistogramWidget->histoSaveAsImage( fileName, mWidth, mHeight, mImageQuality );
}

// test resulting image file based on md5sum - perhaps a direct file comparison might be better
bool TestRasterHistogram::testFile( QString theTestType,
QString rendererName, QgsRasterRendererWidget* rendererWidget,
QStringList actionsList, int selectedBand )
{
if ( mRasterLayer == 0 )
{
QWARN( QString( "Invalid raster layer" ).toLocal8Bit().data() );
return false;
}

// reset histogram widget to clear previous state
if ( mHistogramWidget )
delete mHistogramWidget;
mHistogramWidget = new QgsRasterHistogramWidget( mRasterLayer, 0 );

// setup histogram widget
mHistogramWidget->setRendererWidget( rendererName, rendererWidget );
foreach( QString actionName, actionsList )
{
mHistogramWidget->histoAction( actionName );
}
if ( selectedBand != -1 )
{
mHistogramWidget->setSelectedBand( selectedBand );
}
QString fileName = QDir::tempPath() + QDir::separator() +
theTestType + "_result.png";
if ( ! saveImage( fileName ) )
{
QWARN( QString( "Did not save image file " + fileName ).toLocal8Bit().data() );
return false;
}
mReport += "<h2>" + theTestType + "</h2>\n";
QgsRenderChecker myChecker;
myChecker.setControlPathPrefix( mTestPrefix );
myChecker.setControlName( "expected_histo_" + theTestType );
// myChecker.setMapRenderer( mpMapRenderer );
bool myResultFlag = myChecker.compareImages( theTestType, 0, fileName );
mReport += "\n\n\n" + myChecker.report();
return myResultFlag;

}


QTEST_MAIN( TestRasterHistogram )
#include "moc_testqgsrasterhistogram.cxx"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.