Skip to content

Commit 3334c9c

Browse files
committed
Merge branch 'master' of github.com:qgis/Quantum-GIS
2 parents c1b268c + cda3693 commit 3334c9c

40 files changed

+1295
-974
lines changed

debian/changelog

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ qgis (1.9.90) UNRELEASED; urgency=low
55
* include heatmap plugin
66
* drop extra include path for QtWebkit on oneiric and natty
77
* add translations for desktop link
8+
* add browser desktop entry
89

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

1112
qgis (1.8.0) UNRELEASED; urgency=low
1213

debian/qbrowser.desktop

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
[Desktop Entry]
2+
Type=Application
3+
Name=Quantum GIS Browser
4+
Version=1.0
5+
GenericName=Geographic Information System
6+
GenericName[ar]=نظام المعلومات الجغرافي
7+
GenericName[az]=Coğrafi informasiya sistemi
8+
GenericName[bg]=Географска информационна система
9+
GenericName[bs]=Geografski informacioni sistem
10+
GenericName[ca]=Sistema d'informació geogràfica
11+
GenericName[cs]=Geografický Informační Systém
12+
GenericName[de]=Geographisches Informationssystem
13+
GenericName[el]=Σύστημα Γεωγραφικών Πληροφοριών
14+
GenericName[es]=Sistema de Información Geográfica
15+
GenericName[et]=Geoinfosüsteem
16+
GenericName[eu]=Geografia-informazioko sistemen
17+
GenericName[fa]=سامانه اطلاعات مکانی
18+
GenericName[fi]=Maantieteellinen Tietojärjestelmä
19+
GenericName[fr]=Système d'Information Géographique
20+
GenericName[gl]=Sistema de información xeográfica
21+
GenericName[he]=מערכת מידע גאוגרפית
22+
GenericName[hi]=भूगोलीय_सूचना_प्रणाली
23+
GenericName[hr]=Geografski informacijski sustav
24+
GenericName[hu]=Földrajzi információs rendszer
25+
GenericName[hy]=Աշխարհագրական տեղեկատվական համակարգ
26+
GenericName[id]=Sistem informasi geografis
27+
GenericName[is]=Landfræðilegt upplýsingakerfi
28+
GenericName[it]=Sistema Informativo Geografico
29+
GenericName[ka]=გეოინფორმაციული სისტემა
30+
GenericName[lt]=Geografinė informacinė sistema
31+
GenericName[lv]=Ģeogrāfiskā informācijas sistēma
32+
GenericName[mk]=Географски информационен систем
33+
GenericName[ml]=ജി.ഐ.എസ്.
34+
GenericName[nl]=Geografisch informatiesysteem
35+
GenericName[nn]=Geografiske informasjonssystem
36+
GenericName[no]=Geografiske informasjonssystemer
37+
GenericName[pl]=System Informacji Geograficznej
38+
GenericName[pt]=Sistema de Informação Geográfica
39+
GenericName[ro]=Sistem Informatic Geografic
40+
GenericName[ru]=Геоинформационная система
41+
GenericName[sh]=Geografski informacijski sistem
42+
GenericName[sk]=Geografický informačný systém
43+
GenericName[sl]=Geografski informacijski sistem
44+
GenericName[sr]=Географски информациони систем
45+
GenericName[sv]=Geografiskt Informationssystem
46+
GenericName[th]=ระบบสารสนเทศภูมิศาสตร์
47+
GenericName[tr]=Coğrafi bilgi sistemi
48+
GenericName[uk]=Геоінформаційна система
49+
GenericName[uz]=Geografik axborot tizimi
50+
Icon=qgis-icon
51+
TryExec=/usr/bin/qbrowser
52+
Exec=/usr/bin/qbrowser %F
53+
Terminal=false
54+
StartupNotify=false
55+
Categories=Qt;Education;Science;Geography;

debian/qgis.desktop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[Desktop Entry]
22
Type=Application
3-
Name=Quantum GIS
3+
Name=Quantum GIS Desktop
44
Version=1.0
5-
GenericName=Geographical Information System
5+
GenericName=Geographic Information System
66
GenericName[ar]=نظام المعلومات الجغرافي
77
GenericName[az]=Coğrafi informasiya sistemi
88
GenericName[bg]=Географска информационна система

debian/qgis.install

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ usr/share/pixmaps/qgis-icon.xpm
1919
usr/share/pixmaps/qgis-mime-icon.png
2020
usr/share/pixmaps/qgis-mime-icon.png usr/share/icons/crystalsvg/128x128/mimetypes
2121
../qgis.desktop usr/share/applications
22+
../qbrowser.desktop usr/share/applications
2223
../qgis.xml usr/share/mime/packages
2324
../mime/application/x-esri-shape.desktop usr/share/mimelnk/application
2425
../mime/application/x-mapinfo-mif.desktop usr/share/mimelnk/application

i18n/qgis_de.ts

Lines changed: 982 additions & 922 deletions
Large diffs are not rendered by default.

i18n/qgis_it.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,7 +1806,7 @@ Il plugin non sarà installato.</translation>
18061806
</message>
18071807
<message>
18081808
<source>Miscellaneous</source>
1809-
<translation>MIscellanea</translation>
1809+
<translation>Miscellanea</translation>
18101810
</message>
18111811
<message>
18121812
<source>GdalTools settings</source>
@@ -12921,7 +12921,6 @@ Database:%2</source>
1292112921
<comment>number of rows</comment>
1292212922
<translation type="unfinished">
1292312923
<numerusform></numerusform>
12924-
<numerusform></numerusform>
1292512924
</translation>
1292612925
</message>
1292712926
<message>

python/core/qgscomposition.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class QgsComposition: QGraphicsScene
107107
@param doc xml document
108108
@param addUndoCommands insert AddItem commands if true (e.g. for copy/paste)
109109
@param pos item position. Optional, take position from xml if 0*/
110-
void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, bool addUndoCommands = false, QPointF* pos = 0 );
110+
//void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore, bool addUndoCommands = false, QPointF* pos = 0 );
111111

112112
/**Adds item to z list. Usually called from constructor of QgsComposerItem*/
113113
void addItemToZList( QgsComposerItem* item );

src/app/composer/qgscomposer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,10 +1126,10 @@ void QgsComposer::showEvent( QShowEvent* event )
11261126
if ( event->spontaneous() ) //event from the window system
11271127
{
11281128
//go through maps and restore original preview modes (show on demand after loading from project file)
1129-
QMap< QgsComposerMap*, QgsComposerMap::PreviewMode >::iterator mapIt = mMapsToRestore.begin();
1129+
QMap< QgsComposerMap*, int >::iterator mapIt = mMapsToRestore.begin();
11301130
for ( ; mapIt != mMapsToRestore.end(); ++mapIt )
11311131
{
1132-
mapIt.key()->setPreviewMode( mapIt.value() );
1132+
mapIt.key()->setPreviewMode(( QgsComposerMap::PreviewMode )( mapIt.value() ) );
11331133
mapIt.key()->cache();
11341134
mapIt.key()->update();
11351135
}
@@ -1186,10 +1186,10 @@ void QgsComposer::writeXML( QDomNode& parentNode, QDomDocument& doc )
11861186
composerElem.setAttribute( "title", mTitle );
11871187

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

@@ -1281,7 +1281,7 @@ void QgsComposer::readXML( const QDomElement& composerElem, const QDomDocument&
12811281
//read and restore all the items
12821282
if ( mComposition )
12831283
{
1284-
mComposition->addItemsFromXML( composerElem, doc );
1284+
mComposition->addItemsFromXML( composerElem, doc, &mMapsToRestore );
12851285
}
12861286

12871287
mComposition->sortZList();

src/app/composer/qgscomposer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
321321
QUndoView* mUndoView;
322322

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

326326
QDockWidget* mItemDock;
327327
QDockWidget* mUndoDock;

src/app/qgisapp.cpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,11 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
625625
// request notification of FileOpen events (double clicking a file icon in Mac OS X Finder)
626626
QgsApplication::setFileOpenEventReceiver( this );
627627

628+
#ifdef ANDROID
629+
//add reacting to long click in android
630+
grabGesture(Qt::TapAndHoldGesture);
631+
#endif
632+
628633
// update windows
629634
qApp->processEvents();
630635

@@ -734,6 +739,12 @@ bool QgisApp::event( QEvent * event )
734739
openFile( foe->file() );
735740
done = true;
736741
}
742+
#ifdef ANDROID
743+
else if (event->type() == QEvent::Gesture )
744+
{
745+
done = gestureEvent(static_cast<QGestureEvent*>(event));
746+
}
747+
#endif
737748
else
738749
{
739750
// pass other events to base class
@@ -7265,3 +7276,27 @@ QMenu* QgisApp::createPopupMenu()
72657276

72667277
return menu;
72677278
}
7279+
7280+
#ifdef ANDROID
7281+
bool QgisApp::gestureEvent(QGestureEvent *event)
7282+
{
7283+
if (QGesture *tapAndHold = event->gesture(Qt::TapAndHoldGesture))
7284+
{
7285+
tapAndHoldTriggered(static_cast<QTapAndHoldGesture *>(tapAndHold));
7286+
}
7287+
return true;
7288+
}
7289+
7290+
void QgisApp::tapAndHoldTriggered(QTapAndHoldGesture *gesture)
7291+
{
7292+
if (gesture->state() == Qt::GestureFinished) {
7293+
QPoint pos = gesture->position().toPoint();
7294+
QWidget * receiver = QApplication::widgetAt( pos );
7295+
qDebug() << "tapAndHoldTriggered: LONG CLICK gesture happened at " << pos;
7296+
qDebug() << "widget under point of click: " << receiver;
7297+
7298+
QApplication::postEvent( receiver, new QMouseEvent( QEvent::MouseButtonPress, receiver->mapFromGlobal( pos ), Qt::RightButton, Qt::RightButton, Qt::NoModifier ) );
7299+
QApplication::postEvent( receiver, new QMouseEvent( QEvent::MouseButtonRelease, receiver->mapFromGlobal( pos ), Qt::RightButton, Qt::RightButton, Qt::NoModifier ) );
7300+
}
7301+
}
7302+
#endif

src/app/qgisapp.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ class QgsScaleComboBox;
8383
#include <QPointer>
8484
#include <QSslError>
8585

86+
#ifdef ANDROID
87+
#include <QGestureEvent>
88+
#include <QTapAndHoldGesture>
89+
#endif
90+
8691
#include "qgsconfig.h"
8792
#include "qgsfeature.h"
8893
#include "qgspoint.h"
@@ -1154,6 +1159,11 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
11541159
bool cmpByText( QAction* a, QAction* b );
11551160

11561161
QString mOldScale;
1162+
1163+
#ifdef ANDROID
1164+
bool gestureEvent(QGestureEvent *event);
1165+
void tapAndHoldTriggered(QTapAndHoldGesture *gesture);
1166+
#endif
11571167
};
11581168

11591169
#ifdef ANDROID

src/core/composer/qgscomposition.cpp

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#include "qgscomposition.h"
1818
#include "qgscomposeritem.h"
19-
#include "qgscomposermap.h"
2019
#include "qgspaperitem.h"
2120
#include "qgscomposerarrow.h"
2221
#include "qgscomposerlabel.h"
@@ -261,7 +260,8 @@ bool QgsComposition::readXML( const QDomElement& compositionElem, const QDomDocu
261260
return true;
262261
}
263262

264-
void QgsComposition::addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, bool addUndoCommands, QPointF* pos )
263+
void QgsComposition::addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore,
264+
bool addUndoCommands, QPointF* pos )
265265
{
266266
QDomNodeList composerLabelList = elem.elementsByTagName( "ComposerLabel" );
267267
for ( int i = 0; i < composerLabelList.size(); ++i )
@@ -286,11 +286,19 @@ void QgsComposition::addItemsFromXML( const QDomElement& elem, const QDomDocumen
286286
QDomElement currentComposerMapElem = composerMapList.at( i ).toElement();
287287
QgsComposerMap* newMap = new QgsComposerMap( this );
288288
newMap->readXML( currentComposerMapElem, doc );
289+
290+
if ( mapsToRestore )
291+
{
292+
mapsToRestore->insert( newMap, ( int )( newMap->previewMode() ) );
293+
newMap->setPreviewMode( QgsComposerMap::Rectangle );
294+
}
295+
addComposerMap( newMap, false );
296+
289297
if ( pos )
290298
{
291299
newMap->setItemPosition( pos->x(), pos->y() );
292300
}
293-
addComposerMap( newMap );
301+
294302
if ( addUndoCommands )
295303
{
296304
pushAddRemoveCommand( newMap, tr( "Map added" ) );
@@ -1000,12 +1008,20 @@ void QgsComposition::addComposerLabel( QgsComposerLabel* label )
10001008
emit selectedItemChanged( label );
10011009
}
10021010

1003-
void QgsComposition::addComposerMap( QgsComposerMap* map )
1011+
void QgsComposition::addComposerMap( QgsComposerMap* map, bool setDefaultPreviewStyle )
10041012
{
10051013
addItem( map );
1006-
//set default preview mode to cache. Must be done here between adding composer map to scene and emiting signal
1007-
map->setPreviewMode( QgsComposerMap::Cache );
1008-
map->cache();
1014+
if ( setDefaultPreviewStyle )
1015+
{
1016+
//set default preview mode to cache. Must be done here between adding composer map to scene and emiting signal
1017+
map->setPreviewMode( QgsComposerMap::Cache );
1018+
}
1019+
1020+
if ( map->previewMode() != QgsComposerMap::Rectangle )
1021+
{
1022+
map->cache();
1023+
}
1024+
10091025
emit composerMapAdded( map );
10101026
clearSelection();
10111027
map->setSelected( true );

src/core/composer/qgscomposition.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,11 @@ class CORE_EXPORT QgsComposition: public QGraphicsScene
144144
/**Add items from XML representation to the graphics scene (for project file reading, pasting items from clipboard)
145145
@param elem items parent element, e.g. \verbatim <Composer> \endverbatim or \verbatim <ComposerItemClipboard> \endverbatim
146146
@param doc xml document
147+
@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
147148
@param addUndoCommands insert AddItem commands if true (e.g. for copy/paste)
148149
@param pos item position. Optional, take position from xml if 0*/
149-
void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, bool addUndoCommands = false, QPointF* pos = 0 );
150+
void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore = 0,
151+
bool addUndoCommands = false, QPointF* pos = 0 );
150152

151153
/**Adds item to z list. Usually called from constructor of QgsComposerItem*/
152154
void addItemToZList( QgsComposerItem* item );
@@ -194,7 +196,7 @@ class CORE_EXPORT QgsComposition: public QGraphicsScene
194196
/**Adds label to the graphics scene and advices composer to create a widget for it (through signal)*/
195197
void addComposerLabel( QgsComposerLabel* label );
196198
/**Adds map to the graphics scene and advices composer to create a widget for it (through signal)*/
197-
void addComposerMap( QgsComposerMap* map );
199+
void addComposerMap( QgsComposerMap* map, bool setDefaultPreviewStyle = true );
198200
/**Adds scale bar to the graphics scene and advices composer to create a widget for it (through signal)*/
199201
void addComposerScaleBar( QgsComposerScaleBar* scaleBar );
200202
/**Adds legend to the graphics scene and advices composer to create a widget for it (through signal)*/

src/core/qgsvectorlayer.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,8 @@ void QgsVectorLayer::setRenderer( QgsRenderer *r )
13041304

13051305
if ( r != mRenderer )
13061306
{
1307-
setUsingRendererV2( false );
1307+
if ( r )
1308+
setUsingRendererV2( false );
13081309
delete mRenderer;
13091310
mRenderer = r;
13101311
}
@@ -4643,7 +4644,8 @@ void QgsVectorLayer::setRendererV2( QgsFeatureRendererV2 *r )
46434644

46444645
if ( r != mRendererV2 )
46454646
{
4646-
setUsingRendererV2( true );
4647+
if ( r )
4648+
setUsingRendererV2( true );
46474649
delete mRendererV2;
46484650
mRendererV2 = r;
46494651
}

src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,33 @@ void QgsGraduatedSymbolRendererV2::setSourceColorRamp( QgsVectorColorRampV2* ram
10171017
mSourceColorRamp = ramp;
10181018
}
10191019

1020+
void QgsGraduatedSymbolRendererV2::updateColorRamp( QgsVectorColorRampV2 *ramp )
1021+
{
1022+
int i = 0;
1023+
foreach( QgsRendererRangeV2 range, mRanges )
1024+
{
1025+
QgsSymbolV2* symbol = range.symbol()->clone();
1026+
double colorValue = ( mRanges.count() > 1 ? ( double ) i / ( mRanges.count() - 1 ) : 0 );
1027+
symbol->setColor( ramp->color( colorValue ) );
1028+
updateRangeSymbol( i, symbol );
1029+
++i;
1030+
}
1031+
this->setSourceColorRamp( ramp );
1032+
}
1033+
1034+
void QgsGraduatedSymbolRendererV2::updateSymbols( QgsSymbolV2 *sym )
1035+
{
1036+
int i = 0;
1037+
foreach( QgsRendererRangeV2 range, mRanges )
1038+
{
1039+
QgsSymbolV2* symbol = sym->clone();
1040+
symbol->setColor( range.symbol()->color() );
1041+
updateRangeSymbol( i, symbol );
1042+
++i;
1043+
}
1044+
this->setSourceSymbol( sym->clone() );
1045+
}
1046+
10201047
void QgsGraduatedSymbolRendererV2::addClass( QgsSymbolV2* symbol )
10211048
{
10221049
QgsSymbolV2* newSymbol = symbol->clone();

src/core/symbology-ng/qgsgraduatedsymbolrendererv2.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@ class CORE_EXPORT QgsGraduatedSymbolRendererV2 : public QgsFeatureRendererV2
114114
QgsVectorColorRampV2* sourceColorRamp();
115115
void setSourceColorRamp( QgsVectorColorRampV2* ramp );
116116

117+
/** Update the color ramp used. Also updates all symbols colors.
118+
* Doesn't alter current breaks.
119+
*/
120+
void updateColorRamp( QgsVectorColorRampV2* ramp );
121+
122+
/** Update the all symbols but leave breaks and colors. */
123+
void updateSymbols( QgsSymbolV2* sym );
124+
117125
//! @note added in 1.6
118126
void setRotationField( QString fieldName ) { mRotationField = fieldName; }
119127
//! @note added in 1.6

src/gui/qgscomposerview.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ void QgsComposerView::keyPressEvent( QKeyEvent * e )
480480
if ( composition() )
481481
{
482482
QPointF pt = mapToScene( mapFromGlobal( QCursor::pos() ) );
483-
composition()->addItemsFromXML( docElem, doc, true, &pt );
483+
composition()->addItemsFromXML( docElem, doc, 0, true, &pt );
484484
}
485485
}
486486
}

0 commit comments

Comments
 (0)