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@11331 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rugginoso
rugginoso committed Aug 10, 2009
1 parent 5eb0467 commit 60a8f73b9da2a8c4ee50800fb4e5c0af1e696a91
@@ -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 60a8f73

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