Skip to content

Commit

Permalink
Merge branch 'master' of github.com:qgis/Quantum-GIS
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux committed Feb 28, 2012
2 parents c1b268c + cda3693 commit 3334c9c
Show file tree
Hide file tree
Showing 40 changed files with 1,295 additions and 974 deletions.
3 changes: 2 additions & 1 deletion debian/changelog
Expand Up @@ -5,8 +5,9 @@ qgis (1.9.90) UNRELEASED; urgency=low
* include heatmap plugin
* drop extra include path for QtWebkit on oneiric and natty
* add translations for desktop link
* add browser desktop entry

-- Jürgen E. Fischer <jef@norbit.de> Thu, 16 Feb 2012 23:21:09 +0100
-- Jürgen E. Fischer <jef@norbit.de> Thu, 23 Feb 2012 09:36:48 +0100

qgis (1.8.0) UNRELEASED; urgency=low

Expand Down
55 changes: 55 additions & 0 deletions debian/qbrowser.desktop
@@ -0,0 +1,55 @@
[Desktop Entry]
Type=Application
Name=Quantum GIS Browser
Version=1.0
GenericName=Geographic Information System
GenericName[ar]=نظام المعلومات الجغرافي
GenericName[az]=Coğrafi informasiya sistemi
GenericName[bg]=Географска информационна система
GenericName[bs]=Geografski informacioni sistem
GenericName[ca]=Sistema d'informació geogràfica
GenericName[cs]=Geografický Informační Systém
GenericName[de]=Geographisches Informationssystem
GenericName[el]=Σύστημα Γεωγραφικών Πληροφοριών
GenericName[es]=Sistema de Información Geográfica
GenericName[et]=Geoinfosüsteem
GenericName[eu]=Geografia-informazioko sistemen
GenericName[fa]=سامانه اطلاعات مکانی
GenericName[fi]=Maantieteellinen Tietojärjestelmä
GenericName[fr]=Système d'Information Géographique
GenericName[gl]=Sistema de información xeográfica
GenericName[he]=מערכת מידע גאוגרפית
GenericName[hi]=भूगोलीय_सूचना_प्रणाली
GenericName[hr]=Geografski informacijski sustav
GenericName[hu]=Földrajzi információs rendszer
GenericName[hy]=Աշխարհագրական տեղեկատվական համակարգ
GenericName[id]=Sistem informasi geografis
GenericName[is]=Landfræðilegt upplýsingakerfi
GenericName[it]=Sistema Informativo Geografico
GenericName[ka]=გეოინფორმაციული სისტემა
GenericName[lt]=Geografinė informacinė sistema
GenericName[lv]=Ģeogrāfiskā informācijas sistēma
GenericName[mk]=Географски информационен систем
GenericName[ml]=ജി.ഐ.എസ്.
GenericName[nl]=Geografisch informatiesysteem
GenericName[nn]=Geografiske informasjonssystem
GenericName[no]=Geografiske informasjonssystemer
GenericName[pl]=System Informacji Geograficznej
GenericName[pt]=Sistema de Informação Geográfica
GenericName[ro]=Sistem Informatic Geografic
GenericName[ru]=Геоинформационная система
GenericName[sh]=Geografski informacijski sistem
GenericName[sk]=Geografický informačný systém
GenericName[sl]=Geografski informacijski sistem
GenericName[sr]=Географски информациони систем
GenericName[sv]=Geografiskt Informationssystem
GenericName[th]=ระบบสารสนเทศภูมิศาสตร์
GenericName[tr]=Coğrafi bilgi sistemi
GenericName[uk]=Геоінформаційна система
GenericName[uz]=Geografik axborot tizimi
Icon=qgis-icon
TryExec=/usr/bin/qbrowser
Exec=/usr/bin/qbrowser %F
Terminal=false
StartupNotify=false
Categories=Qt;Education;Science;Geography;
4 changes: 2 additions & 2 deletions debian/qgis.desktop
@@ -1,8 +1,8 @@
[Desktop Entry]
Type=Application
Name=Quantum GIS
Name=Quantum GIS Desktop
Version=1.0
GenericName=Geographical Information System
GenericName=Geographic Information System
GenericName[ar]=نظام المعلومات الجغرافي
GenericName[az]=Coğrafi informasiya sistemi
GenericName[bg]=Географска информационна система
Expand Down
1 change: 1 addition & 0 deletions debian/qgis.install
Expand Up @@ -19,6 +19,7 @@ usr/share/pixmaps/qgis-icon.xpm
usr/share/pixmaps/qgis-mime-icon.png
usr/share/pixmaps/qgis-mime-icon.png usr/share/icons/crystalsvg/128x128/mimetypes
../qgis.desktop usr/share/applications
../qbrowser.desktop usr/share/applications
../qgis.xml usr/share/mime/packages
../mime/application/x-esri-shape.desktop usr/share/mimelnk/application
../mime/application/x-mapinfo-mif.desktop usr/share/mimelnk/application
Expand Down
1,904 changes: 982 additions & 922 deletions i18n/qgis_de.ts

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions i18n/qgis_it.ts
Expand Up @@ -1806,7 +1806,7 @@ Il plugin non sarà installato.</translation>
</message>
<message>
<source>Miscellaneous</source>
<translation>MIscellanea</translation>
<translation>Miscellanea</translation>
</message>
<message>
<source>GdalTools settings</source>
Expand Down Expand Up @@ -12921,7 +12921,6 @@ Database:%2</source>
<comment>number of rows</comment>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgscomposition.sip
Expand Up @@ -107,7 +107,7 @@ class QgsComposition: QGraphicsScene
@param doc xml document
@param addUndoCommands insert AddItem commands if true (e.g. for copy/paste)
@param pos item position. Optional, take position from xml if 0*/
void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, bool addUndoCommands = false, QPointF* pos = 0 );
//void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore, bool addUndoCommands = false, QPointF* pos = 0 );

/**Adds item to z list. Usually called from constructor of QgsComposerItem*/
void addItemToZList( QgsComposerItem* item );
Expand Down
10 changes: 5 additions & 5 deletions src/app/composer/qgscomposer.cpp
Expand Up @@ -1126,10 +1126,10 @@ void QgsComposer::showEvent( QShowEvent* event )
if ( event->spontaneous() ) //event from the window system
{
//go through maps and restore original preview modes (show on demand after loading from project file)
QMap< QgsComposerMap*, QgsComposerMap::PreviewMode >::iterator mapIt = mMapsToRestore.begin();
QMap< QgsComposerMap*, int >::iterator mapIt = mMapsToRestore.begin();
for ( ; mapIt != mMapsToRestore.end(); ++mapIt )
{
mapIt.key()->setPreviewMode( mapIt.value() );
mapIt.key()->setPreviewMode(( QgsComposerMap::PreviewMode )( mapIt.value() ) );
mapIt.key()->cache();
mapIt.key()->update();
}
Expand Down Expand Up @@ -1186,10 +1186,10 @@ void QgsComposer::writeXML( QDomNode& parentNode, QDomDocument& doc )
composerElem.setAttribute( "title", mTitle );

//change preview mode of minimised / hidden maps before saving XML (show contents only on demand)
QMap< QgsComposerMap*, QgsComposerMap::PreviewMode >::iterator mapIt = mMapsToRestore.begin();
QMap< QgsComposerMap*, int >::iterator mapIt = mMapsToRestore.begin();
for ( ; mapIt != mMapsToRestore.end(); ++mapIt )
{
mapIt.key()->setPreviewMode( mapIt.value() );
mapIt.key()->setPreviewMode(( QgsComposerMap::PreviewMode )( mapIt.value() ) );
}
mMapsToRestore.clear();

Expand Down Expand Up @@ -1281,7 +1281,7 @@ void QgsComposer::readXML( const QDomElement& composerElem, const QDomDocument&
//read and restore all the items
if ( mComposition )
{
mComposition->addItemsFromXML( composerElem, doc );
mComposition->addItemsFromXML( composerElem, doc, &mMapsToRestore );
}

mComposition->sortZList();
Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposer.h
Expand Up @@ -321,7 +321,7 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
QUndoView* mUndoView;

//! We load composer map content from project xml only on demand. Therefore we need to store the real preview mode type
QMap< QgsComposerMap*, QgsComposerMap::PreviewMode > mMapsToRestore;
QMap< QgsComposerMap*, int > mMapsToRestore;

QDockWidget* mItemDock;
QDockWidget* mUndoDock;
Expand Down
35 changes: 35 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -625,6 +625,11 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
// request notification of FileOpen events (double clicking a file icon in Mac OS X Finder)
QgsApplication::setFileOpenEventReceiver( this );

#ifdef ANDROID
//add reacting to long click in android
grabGesture(Qt::TapAndHoldGesture);
#endif

// update windows
qApp->processEvents();

Expand Down Expand Up @@ -734,6 +739,12 @@ bool QgisApp::event( QEvent * event )
openFile( foe->file() );
done = true;
}
#ifdef ANDROID
else if (event->type() == QEvent::Gesture )
{
done = gestureEvent(static_cast<QGestureEvent*>(event));
}
#endif
else
{
// pass other events to base class
Expand Down Expand Up @@ -7265,3 +7276,27 @@ QMenu* QgisApp::createPopupMenu()

return menu;
}

#ifdef ANDROID
bool QgisApp::gestureEvent(QGestureEvent *event)
{
if (QGesture *tapAndHold = event->gesture(Qt::TapAndHoldGesture))
{
tapAndHoldTriggered(static_cast<QTapAndHoldGesture *>(tapAndHold));
}
return true;
}

void QgisApp::tapAndHoldTriggered(QTapAndHoldGesture *gesture)
{
if (gesture->state() == Qt::GestureFinished) {
QPoint pos = gesture->position().toPoint();
QWidget * receiver = QApplication::widgetAt( pos );
qDebug() << "tapAndHoldTriggered: LONG CLICK gesture happened at " << pos;
qDebug() << "widget under point of click: " << receiver;

QApplication::postEvent( receiver, new QMouseEvent( QEvent::MouseButtonPress, receiver->mapFromGlobal( pos ), Qt::RightButton, Qt::RightButton, Qt::NoModifier ) );
QApplication::postEvent( receiver, new QMouseEvent( QEvent::MouseButtonRelease, receiver->mapFromGlobal( pos ), Qt::RightButton, Qt::RightButton, Qt::NoModifier ) );
}
}
#endif
10 changes: 10 additions & 0 deletions src/app/qgisapp.h
Expand Up @@ -83,6 +83,11 @@ class QgsScaleComboBox;
#include <QPointer>
#include <QSslError>

#ifdef ANDROID
#include <QGestureEvent>
#include <QTapAndHoldGesture>
#endif

#include "qgsconfig.h"
#include "qgsfeature.h"
#include "qgspoint.h"
Expand Down Expand Up @@ -1154,6 +1159,11 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
bool cmpByText( QAction* a, QAction* b );

QString mOldScale;

#ifdef ANDROID
bool gestureEvent(QGestureEvent *event);
void tapAndHoldTriggered(QTapAndHoldGesture *gesture);
#endif
};

#ifdef ANDROID
Expand Down
30 changes: 23 additions & 7 deletions src/core/composer/qgscomposition.cpp
Expand Up @@ -16,7 +16,6 @@

#include "qgscomposition.h"
#include "qgscomposeritem.h"
#include "qgscomposermap.h"
#include "qgspaperitem.h"
#include "qgscomposerarrow.h"
#include "qgscomposerlabel.h"
Expand Down Expand Up @@ -261,7 +260,8 @@ bool QgsComposition::readXML( const QDomElement& compositionElem, const QDomDocu
return true;
}

void QgsComposition::addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, bool addUndoCommands, QPointF* pos )
void QgsComposition::addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore,
bool addUndoCommands, QPointF* pos )
{
QDomNodeList composerLabelList = elem.elementsByTagName( "ComposerLabel" );
for ( int i = 0; i < composerLabelList.size(); ++i )
Expand All @@ -286,11 +286,19 @@ void QgsComposition::addItemsFromXML( const QDomElement& elem, const QDomDocumen
QDomElement currentComposerMapElem = composerMapList.at( i ).toElement();
QgsComposerMap* newMap = new QgsComposerMap( this );
newMap->readXML( currentComposerMapElem, doc );

if ( mapsToRestore )
{
mapsToRestore->insert( newMap, ( int )( newMap->previewMode() ) );
newMap->setPreviewMode( QgsComposerMap::Rectangle );
}
addComposerMap( newMap, false );

if ( pos )
{
newMap->setItemPosition( pos->x(), pos->y() );
}
addComposerMap( newMap );

if ( addUndoCommands )
{
pushAddRemoveCommand( newMap, tr( "Map added" ) );
Expand Down Expand Up @@ -1000,12 +1008,20 @@ void QgsComposition::addComposerLabel( QgsComposerLabel* label )
emit selectedItemChanged( label );
}

void QgsComposition::addComposerMap( QgsComposerMap* map )
void QgsComposition::addComposerMap( QgsComposerMap* map, bool setDefaultPreviewStyle )
{
addItem( map );
//set default preview mode to cache. Must be done here between adding composer map to scene and emiting signal
map->setPreviewMode( QgsComposerMap::Cache );
map->cache();
if ( setDefaultPreviewStyle )
{
//set default preview mode to cache. Must be done here between adding composer map to scene and emiting signal
map->setPreviewMode( QgsComposerMap::Cache );
}

if ( map->previewMode() != QgsComposerMap::Rectangle )
{
map->cache();
}

emit composerMapAdded( map );
clearSelection();
map->setSelected( true );
Expand Down
6 changes: 4 additions & 2 deletions src/core/composer/qgscomposition.h
Expand Up @@ -144,9 +144,11 @@ class CORE_EXPORT QgsComposition: public QGraphicsScene
/**Add items from XML representation to the graphics scene (for project file reading, pasting items from clipboard)
@param elem items parent element, e.g. \verbatim <Composer> \endverbatim or \verbatim <ComposerItemClipboard> \endverbatim
@param doc xml document
@param mapsToRestore for reading from project file: set preview move 'rectangle' to all maps and save the preview states to show composer maps on demand
@param addUndoCommands insert AddItem commands if true (e.g. for copy/paste)
@param pos item position. Optional, take position from xml if 0*/
void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, bool addUndoCommands = false, QPointF* pos = 0 );
void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore = 0,
bool addUndoCommands = false, QPointF* pos = 0 );

/**Adds item to z list. Usually called from constructor of QgsComposerItem*/
void addItemToZList( QgsComposerItem* item );
Expand Down Expand Up @@ -194,7 +196,7 @@ class CORE_EXPORT QgsComposition: public QGraphicsScene
/**Adds label to the graphics scene and advices composer to create a widget for it (through signal)*/
void addComposerLabel( QgsComposerLabel* label );
/**Adds map to the graphics scene and advices composer to create a widget for it (through signal)*/
void addComposerMap( QgsComposerMap* map );
void addComposerMap( QgsComposerMap* map, bool setDefaultPreviewStyle = true );
/**Adds scale bar to the graphics scene and advices composer to create a widget for it (through signal)*/
void addComposerScaleBar( QgsComposerScaleBar* scaleBar );
/**Adds legend to the graphics scene and advices composer to create a widget for it (through signal)*/
Expand Down
6 changes: 4 additions & 2 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -1304,7 +1304,8 @@ void QgsVectorLayer::setRenderer( QgsRenderer *r )

if ( r != mRenderer )
{
setUsingRendererV2( false );
if ( r )
setUsingRendererV2( false );
delete mRenderer;
mRenderer = r;
}
Expand Down Expand Up @@ -4643,7 +4644,8 @@ void QgsVectorLayer::setRendererV2( QgsFeatureRendererV2 *r )

if ( r != mRendererV2 )
{
setUsingRendererV2( true );
if ( r )
setUsingRendererV2( true );
delete mRendererV2;
mRendererV2 = r;
}
Expand Down
27 changes: 27 additions & 0 deletions src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
Expand Up @@ -1017,6 +1017,33 @@ void QgsGraduatedSymbolRendererV2::setSourceColorRamp( QgsVectorColorRampV2* ram
mSourceColorRamp = ramp;
}

void QgsGraduatedSymbolRendererV2::updateColorRamp( QgsVectorColorRampV2 *ramp )
{
int i = 0;
foreach( QgsRendererRangeV2 range, mRanges )
{
QgsSymbolV2* symbol = range.symbol()->clone();
double colorValue = ( mRanges.count() > 1 ? ( double ) i / ( mRanges.count() - 1 ) : 0 );
symbol->setColor( ramp->color( colorValue ) );
updateRangeSymbol( i, symbol );
++i;
}
this->setSourceColorRamp( ramp );
}

void QgsGraduatedSymbolRendererV2::updateSymbols( QgsSymbolV2 *sym )
{
int i = 0;
foreach( QgsRendererRangeV2 range, mRanges )
{
QgsSymbolV2* symbol = sym->clone();
symbol->setColor( range.symbol()->color() );
updateRangeSymbol( i, symbol );
++i;
}
this->setSourceSymbol( sym->clone() );
}

void QgsGraduatedSymbolRendererV2::addClass( QgsSymbolV2* symbol )
{
QgsSymbolV2* newSymbol = symbol->clone();
Expand Down
8 changes: 8 additions & 0 deletions src/core/symbology-ng/qgsgraduatedsymbolrendererv2.h
Expand Up @@ -114,6 +114,14 @@ class CORE_EXPORT QgsGraduatedSymbolRendererV2 : public QgsFeatureRendererV2
QgsVectorColorRampV2* sourceColorRamp();
void setSourceColorRamp( QgsVectorColorRampV2* ramp );

/** Update the color ramp used. Also updates all symbols colors.
* Doesn't alter current breaks.
*/
void updateColorRamp( QgsVectorColorRampV2* ramp );

/** Update the all symbols but leave breaks and colors. */
void updateSymbols( QgsSymbolV2* sym );

//! @note added in 1.6
void setRotationField( QString fieldName ) { mRotationField = fieldName; }
//! @note added in 1.6
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgscomposerview.cpp
Expand Up @@ -480,7 +480,7 @@ void QgsComposerView::keyPressEvent( QKeyEvent * e )
if ( composition() )
{
QPointF pt = mapToScene( mapFromGlobal( QCursor::pos() ) );
composition()->addItemsFromXML( docElem, doc, true, &pt );
composition()->addItemsFromXML( docElem, doc, 0, true, &pt );
}
}
}
Expand Down

0 comments on commit 3334c9c

Please sign in to comment.