Skip to content

Commit

Permalink
modified topology checker mostly GUI overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
mach0 committed May 16, 2013
1 parent 2c7eff7 commit cfaa71c
Show file tree
Hide file tree
Showing 5 changed files with 177 additions and 172 deletions.
30 changes: 15 additions & 15 deletions src/plugins/topology/checkDock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ checkDock::checkDock( QgisInterface* qIface, QWidget* parent )
connect( mValidateAllButton, SIGNAL( clicked() ), this, SLOT( validateAll() ) );
//connect( mValidateSelectedButton, SIGNAL( clicked() ), this, SLOT( validateSelected() ) );
connect( mValidateExtentButton, SIGNAL( clicked() ), this, SLOT( validateExtent() ) );
connect( mToggleRubberbands, SIGNAL( clicked() ), this, SLOT( toggleErrorMarkers() ) );
connect( mToggleRubberband, SIGNAL( clicked() ), this, SLOT( toggleErrorMarker() ) );

connect( mFixButton, SIGNAL( clicked() ), this, SLOT( fix() ) );
connect( mErrorTableView, SIGNAL( clicked( const QModelIndex & ) ), this, SLOT( errorListClicked( const QModelIndex & ) ) );
Expand Down Expand Up @@ -380,6 +380,7 @@ void checkDock::runTests( ValidateType type )
mErrorList << errors;
}
mMarkersVisible = true;
mToggleRubberband->setChecked( true );
mErrorListModel->resetModel();
}

Expand All @@ -406,6 +407,7 @@ void checkDock::validate( ValidateType type )
clearVertexMarkers();

mErrorTableView->resizeColumnsToContents();
mToggleRubberband->setChecked( true );
}

void checkDock::validateExtent()
Expand All @@ -423,21 +425,19 @@ void checkDock::validateSelected()
validate( ValidateSelected );
}

void checkDock::toggleErrorMarkers()
void checkDock::toggleErrorMarker()
{
QList<QgsRubberBand*>::const_iterator it;
for ( it = mRbErrorMarkers.begin(); it != mRbErrorMarkers.end(); ++it )
{
QgsRubberBand* rb = *it;
if ( mMarkersVisible == true )
{
rb->hide();
}
else
QList<QgsRubberBand*>::const_iterator it;
for ( it = mRbErrorMarkers.begin(); it != mRbErrorMarkers.end(); ++it )
{
rb->show();
QgsRubberBand* rb = *it;
if ( mToggleRubberband->isChecked() )
{
rb->show();
}
else
{
rb->hide();
}
}
}
mMarkersVisible = !mMarkersVisible;

}
2 changes: 1 addition & 1 deletion src/plugins/topology/checkDock.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class checkDock : public QDockWidget, public Ui::checkDock
/**
* toggles the visibility of rubber band error markers
*/
void toggleErrorMarkers();
void toggleErrorMarker();
/**
* Handles error selection
* @param index clicked index in the table
Expand Down
108 changes: 61 additions & 47 deletions src/plugins/topology/checkDock.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,65 @@
<rect>
<x>0</x>
<y>0</y>
<width>436</width>
<height>439</height>
<width>307</width>
<height>280</height>
</rect>
</property>
<property name="windowTitle">
<string>Topology Checker</string>
</property>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QGridLayout" name="gridLayout">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="mValidateAllButton">
<property name="text">
<string>Validate All</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="mValidateExtentButton">
<property name="text">
<string>Validate Extent</string>
</property>
</widget>
</item>
</layout>
<widget class="QTableView" name="mErrorTableView"/>
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QPushButton" name="mToggleRubberbands">
<widget class="QPushButton" name="mConfigureButton">
<property name="text">
<string>Toggle Error Markers</string>
<string>Configure</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QTableView" name="mErrorTableView"/>
<widget class="QPushButton" name="mValidateAllButton">
<property name="text">
<string>Validate All</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="mValidateExtentButton">
<property name="text">
<string>Validate Extent</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QCheckBox" name="mToggleRubberband">
<property name="toolTip">
<string>Show topology errors</string>
</property>
<property name="text">
<string>Show errors</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="mComment">
Expand All @@ -52,32 +73,25 @@
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="mConfigureButton">
<property name="text">
<string>Configure</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="mFixBox">
<item>
<property name="text">
<string>Select automatic fix</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="4" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QComboBox" name="mFixBox">
<item>
<widget class="QPushButton" name="mFixButton">
<property name="text">
<string>Fix!</string>
</property>
</widget>
<property name="text">
<string>Select automatic fix</string>
</property>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="mFixButton">
<property name="text">
<string>Fix!</string>
</property>
</widget>
</item>
</layout>
</item>
Expand Down
Loading

0 comments on commit cfaa71c

Please sign in to comment.