Skip to content

Commit

Permalink
[attrtable] Fix button checked state
Browse files Browse the repository at this point in the history
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 d002423
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/qgsattributetabledialog.cpp
Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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 )
Expand Down
9 changes: 9 additions & 0 deletions src/app/qgsattributetabledialog.h
Expand Up @@ -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
*/
Expand Down

0 comments on commit d002423

Please sign in to comment.