Skip to content

Commit

Permalink
merge from trunk r10900:10950
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/branches/symbology-ng-branch@11132 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Jul 21, 2009
1 parent 93e6b07 commit c1379b5
Show file tree
Hide file tree
Showing 855 changed files with 4,772 additions and 3,978 deletions.
8 changes: 8 additions & 0 deletions cmake/FindGRASS.cmake
Expand Up @@ -66,7 +66,15 @@ ENDIF (WITH_GRASS)

IF (GRASS_FOUND)
FILE(READ ${GRASS_INCLUDE_DIR}/grass/version.h VERSIONFILE)
# We can avoid the following block using version_less version_equal and
# version_greater. Are there compatibility problems?
STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[^ ]+" GRASS_VERSION ${VERSIONFILE})
STRING(REGEX REPLACE "^([0-9]*)\\.[0-9]*\\..*$" "\\1" GRASS_MAJOR_VERSION ${GRASS_VERSION})
STRING(REGEX REPLACE "^[0-9]*\\.([0-9]*)\\..*$" "\\1" GRASS_MINOR_VERSION ${GRASS_VERSION})
STRING(REGEX REPLACE "^[0-9]*\\.[0-9]*\\.(.*)$" "\\1" GRASS_MICRO_VERSION ${GRASS_VERSION})
# Add micro version too?
# How to numerize RC versions?
MATH( EXPR GRASS_NUM_VERSION "${GRASS_MAJOR_VERSION}*10000 + ${GRASS_MINOR_VERSION}*100")

IF (NOT GRASS_FIND_QUIETLY)
MESSAGE(STATUS "Found GRASS: ${GRASS_PREFIX} (${GRASS_VERSION})")
Expand Down
1,271 changes: 706 additions & 565 deletions i18n/qgis_es.ts

Large diffs are not rendered by default.

Binary file added images/themes/default/mActionRedo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/mActionUndo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4,757 changes: 1,651 additions & 3,106 deletions mac/xcode/Qgis.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions python/core/qgsmaplayer.sip
Expand Up @@ -249,6 +249,9 @@ public:
*/
virtual QString saveNamedStyle( const QString theURI, bool & theResultFlag );

/** Return pointer to layer's undo stack */
QUndoStack* undoStack();

public slots:

/** Event handler for when a coordinate transform fails due to bad vertex error */
Expand Down
7 changes: 7 additions & 0 deletions python/core/qgsvectordataprovider.sip
Expand Up @@ -146,6 +146,13 @@ class QgsVectorDataProvider : QgsDataProvider
*/
virtual void uniqueValues(int index, QList<QVariant> &uniqueValues /Out/);

/**Returns the possible enum values of an attribute. Returns an empty stringlist if a provider does not support enum types
or if the given attribute is not an enum type.
* @param index the index of the attribute
* @param enumList reference to the list to fill
@note: added in version 1.2*/
virtual void enumValues( int index, QStringList& enumList /Out/);

/**
* Adds a list of features
* @return true in case of success and false in case of failure
Expand Down
19 changes: 19 additions & 0 deletions python/core/qgsvectorlayer.sip
Expand Up @@ -401,6 +401,25 @@ public:
*/
QgsVectorOverlay* findOverlayByType( const QString& typeName );


/**
* Create edit command for undo/redo operations
* @param text text which is to be displayed in undo window
*/
void beginEditCommand(QString text);

/** Finish edit command and add it to undo/redo stack */
void endEditCommand();

/** Destroy active command and deletes all changes in it */
void destroyEditCommand();

/** Execute undo operation. To be called only from QgsVectorLayerUndoCommand. */
// (not necessary) void undoEditCommand(QgsUndoCommand* cmd);

/** Execute redo operation. To be called only from QgsVectorLayerUndoCommand. */
// (not necessary) void redoEditCommand(QgsUndoCommand* cmd);

public slots:

/** Select feature by its ID, optionally emit signal selectionChanged() */
Expand Down
4 changes: 4 additions & 0 deletions python/gui/qgsmapcanvasmap.sip
Expand Up @@ -48,5 +48,9 @@ class QgsMapCanvasMap : QGraphicsRectItem

QRectF boundingRect() const;

//! Update contents - can be called while drawing to show the status.
//! Added in version 1.2
void updateContents();

};

2 changes: 1 addition & 1 deletion python/plugins/mapserver_export/ms_export.py
Expand Up @@ -213,7 +213,7 @@ def writeWebSection(self):
# TODO allow user to configure this
self.outFile.write(" # WMS server settings\n")
self.outFile.write(" METADATA\n")
self.outFile.write(" 'wms_title' '" + self.mapName + "'\n")
self.outFile.write(" 'wms_title' '\"" + self.mapName + "\"'\n")
self.outFile.write(" 'wms_onlineresource' 'http://my.host.com/cgi-bin/mapserv?map=wms.map&'\n")
self.outFile.write(" 'wms_srs' 'EPSG:4326'\n")
self.outFile.write(" END\n\n")
Expand Down
3 changes: 3 additions & 0 deletions src/app/CMakeLists.txt
Expand Up @@ -60,6 +60,7 @@ SET(QGIS_APP_SRCS
qgsshortcutsmanager.cpp
qgssinglesymboldialog.cpp
qgssnappingdialog.cpp
qgsundowidget.cpp
qgsuniquevaluedialog.cpp
qgsvectorlayerproperties.cpp

Expand Down Expand Up @@ -126,6 +127,7 @@ SET (QGIS_APP_MOC_HDRS
qgsmaptooladdisland.h
qgsmaptooladdring.h
qgsmaptoolmovefeature.h
qgsmaptoolnodetool.h
qgsmaptoolselect.h
qgsmaptoolsimplify.h

Expand All @@ -148,6 +150,7 @@ SET (QGIS_APP_MOC_HDRS
qgsvectorlayerproperties.h
qgsdbtablemodel.h
qgsspatialitetablemodel.h
qgsundowidget.h

composer/qgscomposer.h
composer/qgscomposeritemwidget.h
Expand Down
5 changes: 3 additions & 2 deletions src/app/attributetable/qgsattributetabledialog.cpp
Expand Up @@ -114,6 +114,7 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid

QgsAttributeTableDialog::~QgsAttributeTableDialog()
{
delete mSelectionModel;
}

void QgsAttributeTableDialog::closeEvent( QCloseEvent* event )
Expand Down Expand Up @@ -279,7 +280,7 @@ void QgsAttributeTableDialog::updateRowSelection( int index )
// map index to filter model
//index = mFilterModel->mapFromSource(mModel->index(index, 0)).row();

if ( mView->shiftPressed )
if ( mView->shiftPressed() )
{
QgsDebugMsg( "shift" );
// get the first and last index of the rows to be selected/deselected
Expand Down Expand Up @@ -307,7 +308,7 @@ void QgsAttributeTableDialog::updateRowSelection( int index )

mLastClickedHeaderIndex = last;
}
else if ( mView->ctrlPressed )
else if ( mView->ctrlPressed() )
{
QgsDebugMsg( "ctrl" );
// update the single row selection, without starting a new selection
Expand Down
2 changes: 2 additions & 0 deletions src/app/attributetable/qgsattributetablememorymodel.cpp
Expand Up @@ -120,7 +120,9 @@ bool QgsAttributeTableMemoryModel::setData( const QModelIndex &index, const QVar
// QgsDebugMsg(mFeatureMap[rowToId(index.row())].id());
mFeatureMap[rowToId( index.row() )].changeAttribute( mAttributes[ index.column()], value );
// propagate back to the layer
mLayer->beginEditCommand( tr("Attribute changed") );
mLayer->changeAttributeValue( rowToId( index.row() ), mAttributes[ index.column()], value, true );
mLayer->endEditCommand();
}

if ( !mLayer->isModified() )
Expand Down
3 changes: 2 additions & 1 deletion src/app/attributetable/qgsattributetablemodel.cpp
Expand Up @@ -393,8 +393,9 @@ bool QgsAttributeTableModel::setData( const QModelIndex &index, const QVariant &
{
mLastRowId = rowToId( index.row() );
mLastRow = ( QgsAttributeMap * )( &( mFeat.attributeMap() ) );

mLayer->beginEditCommand( tr("Attribute changed") );
mLayer->changeAttributeValue( rowToId( index.row() ), mAttributes[ index.column()], value, true );
mLayer->endEditCommand();
}

if ( !mLayer->isModified() )
Expand Down
27 changes: 13 additions & 14 deletions src/app/attributetable/qgsattributetableview.cpp
Expand Up @@ -42,27 +42,26 @@ QgsAttributeTableView::QgsAttributeTableView( QWidget* parent )
setSelectionMode( QAbstractItemView::NoSelection );
setSortingEnabled( true );

shiftPressed = false;
ctrlPressed = false;
mShiftPressed = false;
mCtrlPressed = false;
}

void QgsAttributeTableView::setLayer( QgsVectorLayer* layer )
{
QgsAttributeTableModel *bModel;

if ( layer->dataProvider()->capabilities() & QgsVectorDataProvider::RandomSelectGeometryAtId )
bModel = new QgsAttributeTableModel( layer );
mModel = new QgsAttributeTableModel( layer );
else
bModel = new QgsAttributeTableMemoryModel( layer );

QgsAttributeTableFilterModel* bfModel = new QgsAttributeTableFilterModel( layer );
bfModel->setSourceModel( bModel );
mModel = new QgsAttributeTableMemoryModel( layer );

setModel( bfModel );
mFilterModel = new QgsAttributeTableFilterModel( layer );
mFilterModel->setSourceModel( mModel );
setModel( mFilterModel );
}

QgsAttributeTableView::~QgsAttributeTableView()
{
delete mModel;
delete mFilterModel;
}

void QgsAttributeTableView::closeEvent( QCloseEvent *event )
Expand All @@ -75,9 +74,9 @@ void QgsAttributeTableView::keyPressEvent( QKeyEvent *event )
{
// shift pressed
if ( event->key() == Qt::Key_Shift )// && event->modifiers() & Qt::ShiftModifier)
shiftPressed = true;
mShiftPressed = true;
else if ( event->key() == Qt::Key_Control )
ctrlPressed = true;
mCtrlPressed = true;
else
QTableView::keyPressEvent( event );
}
Expand All @@ -86,9 +85,9 @@ void QgsAttributeTableView::keyReleaseEvent( QKeyEvent *event )
{
// workaround for some Qt bug
if ( event->key() == Qt::Key_Shift || event->key() == -1 )
shiftPressed = false;
mShiftPressed = false;
else if ( event->key() == Qt::Key_Control )
ctrlPressed = false;
mCtrlPressed = false;
else
QTableView::keyReleaseEvent( event );
}
17 changes: 11 additions & 6 deletions src/app/attributetable/qgsattributetableview.h
Expand Up @@ -18,14 +18,14 @@

#include <QTableView>

class QgsAttributeTableModel;
class QgsAttributeTableFilterModel;

class QgsVectorLayer;


class QgsAttributeTableView: public QTableView
{
//private slots:
//void setRows(int rows);

public:
QgsAttributeTableView( QWidget* parent = NULL );
virtual ~QgsAttributeTableView();
Expand All @@ -35,10 +35,15 @@ class QgsAttributeTableView: public QTableView
void closeEvent( QCloseEvent *event );
void keyPressEvent( QKeyEvent *event );
void keyReleaseEvent( QKeyEvent *event );
bool shiftPressed() { return mShiftPressed; }
bool ctrlPressed() { return mCtrlPressed; }

private:
bool mShiftPressed;
bool mCtrlPressed;

//make those private
bool shiftPressed;
bool ctrlPressed;
QgsAttributeTableModel* mModel;
QgsAttributeTableFilterModel* mFilterModel;
};

#endif

0 comments on commit c1379b5

Please sign in to comment.