Skip to content
Permalink
Browse files

merge from trunk r10900:10950

git-svn-id: http://svn.osgeo.org/qgis/branches/symbology-ng-branch@11132 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Jul 21, 2009
1 parent 93e6b07 commit c1379b53e669d5ef61f623858e9861f8d1413a53
Showing 855 changed files with 4,772 additions and 3,978 deletions.
@@ -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})")

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

@@ -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 */
@@ -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
@@ -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() */
@@ -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();

};

@@ -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")
@@ -60,6 +60,7 @@ SET(QGIS_APP_SRCS
qgsshortcutsmanager.cpp
qgssinglesymboldialog.cpp
qgssnappingdialog.cpp
qgsundowidget.cpp
qgsuniquevaluedialog.cpp
qgsvectorlayerproperties.cpp

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

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

composer/qgscomposer.h
composer/qgscomposeritemwidget.h
@@ -114,6 +114,7 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid

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

void QgsAttributeTableDialog::closeEvent( QCloseEvent* event )
@@ -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
@@ -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
@@ -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() )
@@ -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() )
@@ -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 )
@@ -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 );
}
@@ -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 );
}
@@ -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();
@@ -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.
You can’t perform that action at this time.