Skip to content
Permalink
Browse files

open attribute dialogs non-modal when not in editing mode

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12796 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Jan 19, 2010
1 parent 55a4530 commit 094709112d7a977da5fb79b55e2322a1a1303e81
Showing with 33 additions and 12 deletions.
  1. +10 −0 src/app/qgsattributedialog.cpp
  2. +1 −0 src/app/qgsattributedialog.h
  3. +22 −12 src/app/qgsidentifyresults.cpp
@@ -273,6 +273,16 @@ int QgsAttributeDialog::exec()
}
}

void QgsAttributeDialog::show()
{
if ( mDialog )
{
mDialog->setAttribute( Qt::WA_DeleteOnClose );
mDialog->show();
mDialog = 0;
}
}

void QgsAttributeDialog::saveGeometry()
{
if ( mDialog )
@@ -54,6 +54,7 @@ class QgsAttributeDialog : public QObject
void accept();

int exec();
void show();

void dialogDestroyed();

@@ -293,7 +293,7 @@ void QgsIdentifyResults::show()
// (saves the current window size/position)
void QgsIdentifyResults::close()
{
clear();
clear();

delete mActionPopup;
mActionPopup = 0;
@@ -761,7 +761,9 @@ void QgsIdentifyResults::featureForm()

QgsAttributeMap src = f.attributeMap();

vlayer->beginEditCommand( tr( "Attribute changed" ) );
if ( vlayer->isEditable() )
vlayer->beginEditCommand( tr( "Attribute changed" ) );

QgsAttributeDialog *ad = new QgsAttributeDialog( vlayer, &f );

if ( !vlayer->isEditable() && vlayer->actions()->size() > 0 )
@@ -789,25 +791,33 @@ void QgsIdentifyResults::featureForm()
}
}

if ( ad->exec() )
if ( vlayer->isEditable() )
{
const QgsAttributeMap &dst = f.attributeMap();
for ( QgsAttributeMap::const_iterator it = dst.begin(); it != dst.end(); it++ )
if ( ad->exec() )
{
if ( !src.contains( it.key() ) || it.value() != src[it.key()] )
const QgsAttributeMap &dst = f.attributeMap();
for ( QgsAttributeMap::const_iterator it = dst.begin(); it != dst.end(); it++ )
{
vlayer->changeAttributeValue( f.id(), it.key(), it.value() );
if ( !src.contains( it.key() ) || it.value() != src[it.key()] )
{
vlayer->changeAttributeValue( f.id(), it.key(), it.value() );
}
}
vlayer->endEditCommand();
}
else
{
vlayer->destroyEditCommand();
}
vlayer->endEditCommand();

delete ad;

mCanvas->refresh();
}
else
{
vlayer->destroyEditCommand();
ad->show();
}

delete ad;
mCanvas->refresh();
}

void QgsIdentifyResults::highlightAll()

0 comments on commit 0947091

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