Skip to content
Permalink
Browse files

[attrtable] Fix button checked state

The wrong button was checked, when the view mode was not changed with a button click but another event.
  • Loading branch information
m-kuhn committed Jun 16, 2013
1 parent d0d381a commit d0024238feae0c28a3ab55b50a42ef47232605fd
Showing with 16 additions and 0 deletions.
  1. +7 −0 src/app/qgsattributetabledialog.cpp
  2. +9 −0 src/app/qgsattributetabledialog.h
@@ -119,6 +119,8 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
// info from table to application
connect( this, SIGNAL( saveEdits( QgsMapLayer * ) ), QgisApp::instance(), SLOT( saveEdits( QgsMapLayer * ) ) );

connect( mMainView, SIGNAL( currentChanged( int ) ), mMainViewButtonGroup, SLOT() );

bool myDockFlag = settings.value( "/qgis/dockAttributeTable", false ).toBool();
if ( myDockFlag )
{
@@ -421,6 +423,11 @@ void QgsAttributeTableDialog::on_mDeleteSelectedButton_clicked()
QgisApp::instance()->deleteSelected( mLayer, this );
}

void QgsAttributeTableDialog::on_mMainView_currentChanged( int viewMode )
{
mMainViewButtonGroup->button( viewMode )->click();
}

void QgsAttributeTableDialog::on_mToggleEditingButton_toggled()
{
if ( !mLayer )
@@ -121,6 +121,15 @@ class QgsAttributeTableDialog : public QDialog, private Ui::QgsAttributeTableDia
*/
void on_mDeleteSelectedButton_clicked();

/**
* Called when the current index changes in the main view
* i.e. when the view mode is switched from table to form view
* or vice versa.
*
* Will adjust the button state
*/
void on_mMainView_currentChanged( int );

/**
* add feature
*/

0 comments on commit d002423

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