Skip to content
Permalink
Browse files

Changed the behaviour of attribute editor as described into the discu…

…ssion of ticker #289 to fix it.

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11331 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rugginoso
rugginoso committed Aug 10, 2009
1 parent d143e5f commit 388440e2ede1415e20654bc160ec41f8c6438fe8
@@ -15,7 +15,6 @@
***************************************************************************/

#include "qgsgrassattributes.h"
#include "qgsgrassedit.h"
#include "qgsgrassprovider.h"

#include "qgslogger.h"
@@ -352,3 +351,12 @@ void QgsGrassAttributes::columnSizeChanged( int section, int oldSize, int newSiz
QgsDebugMsg( QString( "path = %1 newSize = %2" ).arg( path ).arg( newSize ) );
settings.setValue( path, newSize );
}

void QgsGrassAttributes::setCategoryMode(QgsGrassEdit::CatMode mode, const QString &cat)
{
if (mode == QgsGrassEdit::CAT_MODE_NOCAT || (mode == QgsGrassEdit::CAT_MODE_MANUAL && cat.isEmpty())){
newButton->setEnabled(false);
} else {
newButton->setEnabled(true);
}
}
@@ -19,6 +19,7 @@
/* First attribute in the table is always field, second attribute is category */

#include "ui_qgsgrassattributesbase.h"
#include "qgsgrassedit.h"

class QgsGrassProvider;
class QgsGrassEdit;
@@ -105,6 +106,9 @@ class QgsGrassAttributes: public QDialog, private Ui::QgsGrassAttributesBase
//! Remove all tabs
void clear();

//! Enable/disable buttons depending on the category mode
void setCategoryMode(QgsGrassEdit::CatMode mode, const QString &cat);

private:
//! Pointer to vector provider
QgsGrassProvider *mProvider;
@@ -916,4 +916,6 @@ void QgsGrassEditAttributes::mouseClick( QgsPoint & point, Qt::MouseButton butto
e->mAttributes->show();
e->mAttributes->raise();
}

e->mAttributes->setCategoryMode(static_cast<QgsGrassEdit::CatMode>(e->mCatModeBox->currentIndex()), e->mCatEntry->text());
}

0 comments on commit 388440e

Please sign in to comment.
You can’t perform that action at this time.