Skip to content

Commit

Permalink
Daily connectification
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 10, 2017
1 parent b0c88f1 commit fc2581c
Show file tree
Hide file tree
Showing 51 changed files with 464 additions and 468 deletions.
14 changes: 7 additions & 7 deletions src/plugins/coordinate_capture/coordinatecapture.cpp
Expand Up @@ -113,14 +113,14 @@ void CoordinateCapture::initGui()
// Set the what's this text
mQActionPointer->setWhatsThis( tr( "Click on the map to view coordinates and capture to clipboard." ) );
// Connect the action to the run
connect( mQActionPointer, SIGNAL( triggered() ), this, SLOT( showOrHide() ) );
connect( mQActionPointer, &QAction::triggered, this, &CoordinateCapture::showOrHide );
mQGisIface->addPluginToVectorMenu( tr( "&Coordinate Capture" ), mQActionPointer );
mQGisIface->addVectorToolBarIcon( mQActionPointer );

// create our map tool
mpMapTool = new CoordinateCaptureMapTool( mQGisIface->mapCanvas() );
connect( mpMapTool, SIGNAL( mouseMoved( QgsPoint ) ), this, SLOT( mouseMoved( QgsPoint ) ) );
connect( mpMapTool, SIGNAL( mouseClicked( QgsPoint ) ), this, SLOT( mouseClicked( QgsPoint ) ) );
connect( mpMapTool, &CoordinateCaptureMapTool::mouseMoved, this, &CoordinateCapture::mouseMoved );
connect( mpMapTool, &CoordinateCaptureMapTool::mouseClicked, this, &CoordinateCapture::mouseClicked );

// create a little widget with x and y display to put into our dock widget
QWidget *mypWidget = new QWidget();
Expand All @@ -130,7 +130,7 @@ void CoordinateCapture::initGui()

mypUserCrsToolButton = new QToolButton( mypWidget );
mypUserCrsToolButton->setToolTip( tr( "Click to select the CRS to use for coordinate display" ) );
connect( mypUserCrsToolButton, SIGNAL( clicked() ), this, SLOT( setCRS() ) );
connect( mypUserCrsToolButton, &QAbstractButton::clicked, this, &CoordinateCapture::setCRS );

mypCRSLabel = new QLabel( mypWidget );
mypCRSLabel->setGeometry( mypUserCrsToolButton->geometry() );
Expand All @@ -145,7 +145,7 @@ void CoordinateCapture::initGui()

QPushButton *mypCopyButton = new QPushButton( mypWidget );
mypCopyButton->setText( tr( "Copy to clipboard" ) );
connect( mypCopyButton, SIGNAL( clicked() ), this, SLOT( copy() ) );
connect( mypCopyButton, &QAbstractButton::clicked, this, &CoordinateCapture::copy );

mpTrackMouseButton = new QToolButton( mypWidget );
mpTrackMouseButton->setCheckable( true );
Expand All @@ -158,7 +158,7 @@ void CoordinateCapture::initGui()
mpCaptureButton->setToolTip( tr( "Click to enable coordinate capture" ) );
mpCaptureButton->setIcon( QIcon( ":/coordinate_capture/coordinate_capture.png" ) );
mpCaptureButton->setWhatsThis( tr( "Click on the map to view coordinates and capture to clipboard." ) );
connect( mpCaptureButton, SIGNAL( clicked() ), this, SLOT( run() ) );
connect( mpCaptureButton, &QAbstractButton::clicked, this, &CoordinateCapture::run );

// Set the icons
setCurrentTheme( QLatin1String( "" ) );
Expand All @@ -173,7 +173,7 @@ void CoordinateCapture::initGui()

// now add our custom widget to the dock - ownership of the widget is passed to the dock
mpDockWidget->setWidget( mypWidget );
connect( mpDockWidget, SIGNAL( visibilityChanged( bool ) ), mQActionPointer, SLOT( setChecked( bool ) ) );
connect( mpDockWidget.data(), &QDockWidget::visibilityChanged, mQActionPointer, &QAction::setChecked );
}

//method defined in interface
Expand Down
Expand Up @@ -62,7 +62,7 @@ eVisDatabaseConnectionGui::eVisDatabaseConnectionGui( QList<QTemporaryFile *> *t

//Create a new instance of the file selector
mDatabaseLayerFieldSelector = new eVisDatabaseLayerFieldSelectionGui( this, fl );
connect( mDatabaseLayerFieldSelector, SIGNAL( eVisDatabaseLayerFieldsSelected( QString, QString, QString ) ), this, SLOT( drawNewVectorLayer( QString, QString, QString ) ) );
connect( mDatabaseLayerFieldSelector, &eVisDatabaseLayerFieldSelectionGui::eVisDatabaseLayerFieldsSelected, this, &eVisDatabaseConnectionGui::drawNewVectorLayer );

//Populate gui components
#ifdef Q_OS_WIN
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.cpp
Expand Up @@ -119,7 +119,7 @@ eVisGenericEventBrowserGui::~eVisGenericEventBrowserGui()
//Clean up, disconnect the highlighting routine and refresh the canvas to clear highlighting symbol
if ( mCanvas )
{
disconnect( mCanvas, SIGNAL( renderComplete( QPainter * ) ), this, SLOT( renderSymbol( QPainter * ) ) );
disconnect( mCanvas, &QgsMapCanvas::renderComplete, this, &eVisGenericEventBrowserGui::renderSymbol );
mCanvas->refresh();
}

Expand All @@ -139,7 +139,7 @@ bool eVisGenericEventBrowserGui::initBrowser()
//setup gui
setWindowTitle( tr( "Generic Event Browser" ) );

connect( treeEventData, SIGNAL( itemDoubleClicked( QTreeWidgetItem *, int ) ), this, SLOT( launchExternalApplication( QTreeWidgetItem *, int ) ) );
connect( treeEventData, &QTreeWidget::itemDoubleClicked, this, &eVisGenericEventBrowserGui::launchExternalApplication );

mHighlightSymbol.load( QStringLiteral( ":/evis/eVisHighlightSymbol.png" ) );
mPointerSymbol.load( QStringLiteral( ":/evis/eVisPointerSymbol.png" ) );
Expand Down Expand Up @@ -242,7 +242,7 @@ bool eVisGenericEventBrowserGui::initBrowser()
}

//Connect rendering routine for highlighting symbols and load symbols
connect( mCanvas, SIGNAL( renderComplete( QPainter * ) ), this, SLOT( renderSymbol( QPainter * ) ) );
connect( mCanvas, &QgsMapCanvas::renderComplete, this, &eVisGenericEventBrowserGui::renderSymbol );

mDataProvider = mVectorLayer->dataProvider();

Expand Down
6 changes: 3 additions & 3 deletions src/plugins/evis/eventbrowser/evisimagedisplaywidget.cpp
Expand Up @@ -63,9 +63,9 @@ eVisImageDisplayWidget::eVisImageDisplayWidget( QWidget *parent, Qt::WindowFlags
pbtnZoomIn->setIcon( QIcon( QPixmap( myThemePath + "/mActionZoomIn.svg" ) ) );
pbtnZoomOut->setIcon( QIcon( QPixmap( myThemePath + "/mActionZoomOut.svg" ) ) );
pbtnZoomFull->setIcon( QIcon( QPixmap( myThemePath + "/mActionZoomFullExtent.svg" ) ) );
connect( pbtnZoomIn, SIGNAL( clicked() ), this, SLOT( on_pbtnZoomIn_clicked() ) );
connect( pbtnZoomOut, SIGNAL( clicked() ), this, SLOT( on_pbtnZoomOut_clicked() ) );
connect( pbtnZoomFull, SIGNAL( clicked() ), this, SLOT( on_pbtnZoomFull_clicked() ) );
connect( pbtnZoomIn, &QAbstractButton::clicked, this, &eVisImageDisplayWidget::on_pbtnZoomIn_clicked );
connect( pbtnZoomOut, &QAbstractButton::clicked, this, &eVisImageDisplayWidget::on_pbtnZoomOut_clicked );
connect( pbtnZoomFull, &QAbstractButton::clicked, this, &eVisImageDisplayWidget::on_pbtnZoomFull_clicked );

//Setup zoom button layout
QWidget *myButtonBar = new QWidget();
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/evis/evis.cpp
Expand Up @@ -116,9 +116,9 @@ void eVis::initGui()
mEventBrowserActionPointer->setWhatsThis( tr( "Open an Event Browser to explore the current layer's features" ) );

// Connect the action to the runmQGisIface->mapCanvas()
connect( mDatabaseConnectionActionPointer, SIGNAL( triggered() ), this, SLOT( launchDatabaseConnection() ) );
connect( mEventIdToolActionPointer, SIGNAL( triggered() ), this, SLOT( launchEventIdTool() ) );
connect( mEventBrowserActionPointer, SIGNAL( triggered() ), this, SLOT( launchEventBrowser() ) );
connect( mDatabaseConnectionActionPointer, &QAction::triggered, this, &eVis::launchDatabaseConnection );
connect( mEventIdToolActionPointer, &QAction::triggered, this, &eVis::launchEventIdTool );
connect( mEventBrowserActionPointer, &QAction::triggered, this, &eVis::launchEventBrowser );


// Add the icon to the toolbar
Expand All @@ -144,7 +144,7 @@ void eVis::launchDatabaseConnection()
eVisDatabaseConnectionGui *myPluginGui = new eVisDatabaseConnectionGui( &mTemporaryFileList, mQGisIface->mainWindow(), QgisGui::ModalDialogFlags );
myPluginGui->setAttribute( Qt::WA_DeleteOnClose );

connect( myPluginGui, SIGNAL( drawVectorLayer( QString, QString, QString ) ), this, SLOT( drawVectorLayer( QString, QString, QString ) ) );
connect( myPluginGui, &eVisDatabaseConnectionGui::drawVectorLayer, this, &eVis::drawVectorLayer );
myPluginGui->show();
}

Expand Down
6 changes: 3 additions & 3 deletions src/plugins/geometry_checker/qgsgeometrychecker.cpp
Expand Up @@ -61,9 +61,9 @@ QFuture<void> QgsGeometryChecker::execute( int *totalSteps )
QFutureWatcher<void> *watcher = new QFutureWatcher<void>();
watcher->setFuture( future );
QTimer *timer = new QTimer();
connect( timer, SIGNAL( timeout() ), this, SLOT( emitProgressValue() ) );
connect( watcher, SIGNAL( finished() ), timer, SLOT( deleteLater() ) );
connect( watcher, SIGNAL( finished() ), watcher, SLOT( deleteLater() ) );
connect( timer, &QTimer::timeout, this, &QgsGeometryChecker::emitProgressValue );
connect( watcher, &QFutureWatcherBase::finished, timer, &QObject::deleteLater );
connect( watcher, &QFutureWatcherBase::finished, watcher, &QObject::deleteLater );
timer->start( 500 );

return future;
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/geometry_checker/qgsgeometrycheckerplugin.cpp
Expand Up @@ -31,8 +31,8 @@ void QgsGeometryCheckerPlugin::initGui()
mDialog = new QgsGeometryCheckerDialog( mIface, mIface->mainWindow() );
mDialog->setWindowModality( Qt::NonModal );
mMenuAction = new QAction( QIcon( ":/geometrychecker/icons/geometrychecker.png" ), QApplication::translate( "QgsGeometryCheckerPlugin", "Check Geometries" ), this );
connect( mMenuAction, SIGNAL( triggered() ), mDialog, SLOT( show() ) );
connect( mMenuAction, SIGNAL( triggered() ), mDialog, SLOT( raise() ) );
connect( mMenuAction, &QAction::triggered, mDialog, &QWidget::show );
connect( mMenuAction, &QAction::triggered, mDialog, &QWidget::raise );
mIface->addPluginToVectorMenu( QApplication::translate( "QgsGeometryCheckerPlugin", "G&eometry Tools" ), mMenuAction );
}

Expand Down
9 changes: 5 additions & 4 deletions src/plugins/geometry_checker/ui/qgsgeometrycheckerdialog.cpp
Expand Up @@ -17,7 +17,8 @@
#include "qgsgeometrycheckerdialog.h"
#include "qgsgeometrycheckersetuptab.h"
#include "qgsgeometrycheckerresulttab.h"

#include "../qgsgeometrychecker.h"
#include "../utils/qgsfeaturepool.h"
#include "qgssettings.h"

#include <QCloseEvent>
Expand All @@ -44,9 +45,9 @@ QgsGeometryCheckerDialog::QgsGeometryCheckerDialog( QgisInterface *iface, QWidge
mTabWidget->addTab( new QWidget(), tr( "Result" ) );
mTabWidget->setTabEnabled( 1, false );

connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
connect( mTabWidget->widget( 0 ), SIGNAL( checkerStarted( QgsGeometryChecker *, QgsFeaturePool * ) ), this, SLOT( onCheckerStarted( QgsGeometryChecker *, QgsFeaturePool * ) ) );
connect( mTabWidget->widget( 0 ), SIGNAL( checkerFinished( bool ) ), this, SLOT( onCheckerFinished( bool ) ) );
connect( mButtonBox, &QDialogButtonBox::rejected, this, &QDialog::reject );
connect( dynamic_cast< QgsGeometryCheckerSetupTab * >( mTabWidget->widget( 0 ) ), &QgsGeometryCheckerSetupTab::checkerStarted, this, &QgsGeometryCheckerDialog::onCheckerStarted );
connect( dynamic_cast< QgsGeometryCheckerSetupTab * >( mTabWidget->widget( 0 ) ), &QgsGeometryCheckerSetupTab::checkerFinished, this, &QgsGeometryCheckerDialog::onCheckerFinished );
}

QgsGeometryCheckerDialog::~QgsGeometryCheckerDialog()
Expand Down
Expand Up @@ -109,7 +109,7 @@ void QgsGeometryCheckerFixSummaryDialog::setupTable( QTableWidget *table )
table->horizontalHeader()->setSortIndicator( 0, Qt::AscendingOrder );
table->setSortingEnabled( true );

connect( table->selectionModel(), SIGNAL( selectionChanged( QItemSelection, QItemSelection ) ), this, SLOT( onTableSelectionChanged( QItemSelection, QItemSelection ) ) );
connect( table->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsGeometryCheckerFixSummaryDialog::onTableSelectionChanged );
}

void QgsGeometryCheckerFixSummaryDialog::onTableSelectionChanged( const QItemSelection &newSel, const QItemSelection & /*oldSel*/ )
Expand Down
44 changes: 22 additions & 22 deletions src/plugins/geometry_checker/ui/qgsgeometrycheckerresulttab.cpp
Expand Up @@ -59,18 +59,18 @@ QgsGeometryCheckerResultTab::QgsGeometryCheckerResultTab( QgisInterface *iface,
ui.comboBoxMergeAttribute->addItem( mFeaturePool->getLayer()->fields().at( i ).name() );
}

connect( checker, SIGNAL( errorAdded( QgsGeometryCheckError * ) ), this, SLOT( addError( QgsGeometryCheckError * ) ) );
connect( checker, SIGNAL( errorUpdated( QgsGeometryCheckError *, bool ) ), this, SLOT( updateError( QgsGeometryCheckError *, bool ) ) );
connect( ui.comboBoxMergeAttribute, SIGNAL( currentIndexChanged( int ) ), checker, SLOT( setMergeAttributeIndex( int ) ) );
connect( ui.tableWidgetErrors->selectionModel(), SIGNAL( selectionChanged( QItemSelection, QItemSelection ) ), this, SLOT( onSelectionChanged( QItemSelection, QItemSelection ) ) );
connect( ui.buttonGroupSelectAction, SIGNAL( buttonClicked( int ) ), this, SLOT( highlightErrors() ) );
connect( ui.pushButtonOpenAttributeTable, SIGNAL( clicked() ), this, SLOT( openAttributeTable() ) );
connect( ui.pushButtonFixWithDefault, SIGNAL( clicked() ), this, SLOT( fixErrorsWithDefault() ) );
connect( ui.pushButtonFixWithPrompt, SIGNAL( clicked() ), this, SLOT( fixErrorsWithPrompt() ) );
connect( ui.pushButtonErrorResolutionSettings, SIGNAL( clicked() ), this, SLOT( setDefaultResolutionMethods() ) );
connect( ui.checkBoxHighlight, SIGNAL( clicked() ), this, SLOT( highlightErrors() ) );
connect( QgsProject::instance(), SIGNAL( layersWillBeRemoved( QStringList ) ), this, SLOT( checkRemovedLayer( QStringList ) ) );
connect( ui.pushButtonExport, SIGNAL( clicked() ), this, SLOT( exportErrors() ) );
connect( checker, &QgsGeometryChecker::errorAdded, this, &QgsGeometryCheckerResultTab::addError );
connect( checker, &QgsGeometryChecker::errorUpdated, this, &QgsGeometryCheckerResultTab::updateError );
connect( ui.comboBoxMergeAttribute, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), checker, &QgsGeometryChecker::setMergeAttributeIndex );
connect( ui.tableWidgetErrors->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsGeometryCheckerResultTab::onSelectionChanged );
connect( ui.buttonGroupSelectAction, static_cast<void ( QButtonGroup::* )( int )>( &QButtonGroup::buttonClicked ), this, &QgsGeometryCheckerResultTab::highlightErrors );
connect( ui.pushButtonOpenAttributeTable, &QAbstractButton::clicked, this, &QgsGeometryCheckerResultTab::openAttributeTable );
connect( ui.pushButtonFixWithDefault, &QAbstractButton::clicked, this, &QgsGeometryCheckerResultTab::fixErrorsWithDefault );
connect( ui.pushButtonFixWithPrompt, &QAbstractButton::clicked, this, &QgsGeometryCheckerResultTab::fixErrorsWithPrompt );
connect( ui.pushButtonErrorResolutionSettings, &QAbstractButton::clicked, this, &QgsGeometryCheckerResultTab::setDefaultResolutionMethods );
connect( ui.checkBoxHighlight, &QAbstractButton::clicked, this, &QgsGeometryCheckerResultTab::highlightErrors );
connect( QgsProject::instance(), static_cast<void ( QgsProject::* )( const QStringList & )>( &QgsProject::layersWillBeRemoved ), this, &QgsGeometryCheckerResultTab::checkRemovedLayer );
connect( ui.pushButtonExport, &QAbstractButton::clicked, this, &QgsGeometryCheckerResultTab::exportErrors );

if ( ( mFeaturePool->getLayer()->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeGeometries ) == 0 )
{
Expand Down Expand Up @@ -105,8 +105,8 @@ void QgsGeometryCheckerResultTab::finalize()
dialog.layout()->addWidget( new QPlainTextEdit( mChecker->getMessages().join( QStringLiteral( "\n" ) ) ) );
QDialogButtonBox *bbox = new QDialogButtonBox( QDialogButtonBox::Close, Qt::Horizontal );
dialog.layout()->addWidget( bbox );
connect( bbox, SIGNAL( accepted() ), &dialog, SLOT( accept() ) );
connect( bbox, SIGNAL( rejected() ), &dialog, SLOT( reject() ) );
connect( bbox, &QDialogButtonBox::accepted, &dialog, &QDialog::accept );
connect( bbox, &QDialogButtonBox::rejected, &dialog, &QDialog::reject );
dialog.setWindowTitle( tr( "Check errors occurred" ) );
dialog.exec();
}
Expand Down Expand Up @@ -442,11 +442,11 @@ void QgsGeometryCheckerResultTab::openAttributeTable()
}
if ( mAttribTableDialog )
{
disconnect( mAttribTableDialog, SIGNAL( destroyed() ), this, SLOT( clearAttribTableDialog() ) );
disconnect( mAttribTableDialog, &QObject::destroyed, this, &QgsGeometryCheckerResultTab::clearAttribTableDialog );
mAttribTableDialog->close();
}
mAttribTableDialog = mIface->showAttributeTable( mFeaturePool->getLayer(), expr.join( QStringLiteral( " or " ) ) );
connect( mAttribTableDialog, SIGNAL( destroyed() ), this, SLOT( clearAttribTableDialog() ) );
connect( mAttribTableDialog, &QObject::destroyed, this, &QgsGeometryCheckerResultTab::clearAttribTableDialog );
}

void QgsGeometryCheckerResultTab::fixErrors( bool prompt )
Expand Down Expand Up @@ -489,8 +489,8 @@ void QgsGeometryCheckerResultTab::fixErrors( bool prompt )
{
QgsGeometryCheckerFixDialog fixdialog( mChecker, errors, mIface, mIface->mainWindow() );
QEventLoop loop;
connect( &fixdialog, SIGNAL( currentErrorChanged( QgsGeometryCheckError * ) ), this, SLOT( highlightError( QgsGeometryCheckError * ) ) );
connect( &fixdialog, SIGNAL( finished( int ) ), &loop, SLOT( quit() ) );
connect( &fixdialog, &QgsGeometryCheckerFixDialog::currentErrorChanged, this, &QgsGeometryCheckerResultTab::highlightError );
connect( &fixdialog, &QDialog::finished, &loop, &QEventLoop::quit );
fixdialog.show();
parentWidget()->parentWidget()->parentWidget()->setEnabled( false );
loop.exec();
Expand Down Expand Up @@ -519,8 +519,8 @@ void QgsGeometryCheckerResultTab::fixErrors( bool prompt )
{
QgsGeometryCheckerFixSummaryDialog summarydialog( mIface, mFeaturePool->getLayer(), mStatistics, mChecker->getMessages(), mIface->mainWindow() );
QEventLoop loop;
connect( &summarydialog, SIGNAL( errorSelected( QgsGeometryCheckError * ) ), this, SLOT( highlightError( QgsGeometryCheckError * ) ) );
connect( &summarydialog, SIGNAL( finished( int ) ), &loop, SLOT( quit() ) );
connect( &summarydialog, &QgsGeometryCheckerFixSummaryDialog::errorSelected, this, &QgsGeometryCheckerResultTab::highlightError );
connect( &summarydialog, &QDialog::finished, &loop, &QEventLoop::quit );
summarydialog.show();
parentWidget()->parentWidget()->parentWidget()->setEnabled( false );
loop.exec();
Expand Down Expand Up @@ -578,14 +578,14 @@ void QgsGeometryCheckerResultTab::setDefaultResolutionMethods()
groupBoxLayout->addWidget( radio );
radioGroup->addButton( radio, id++ );
}
connect( radioGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( storeDefaultResolutionMethod( int ) ) );
connect( radioGroup, static_cast<void ( QButtonGroup::* )( int )>( &QButtonGroup::buttonClicked ), this, &QgsGeometryCheckerResultTab::storeDefaultResolutionMethod );

scrollAreaLayout->addWidget( groupBox );
}
scrollArea->setWidget( scrollAreaContents );

QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok, Qt::Horizontal, &dialog );
connect( buttonBox, SIGNAL( accepted() ), &dialog, SLOT( accept() ) );
connect( buttonBox, &QDialogButtonBox::accepted, &dialog, &QDialog::accept );
layout->addWidget( buttonBox );
dialog.exec();
}
Expand Down

0 comments on commit fc2581c

Please sign in to comment.