TUFLOW-Support / QGIS-TUFLOW-Plugin

TUFLOW related QGIS Plugins
9 stars 7 forks source link

Unnecessary message boxes when incrementing layer. #12

Closed duncan-r closed 5 years ago

duncan-r commented 5 years ago

When using the increment layer form there is an option to keep the existing style for the layer. If it is selected it causes two message boxes to be displayed "Creating QML" and "Done". I guess these were for debugging at some point, but seem to be unnecessary in production? Could they be removed please? This is present in both the qgis2 and qgis3 versions of the plugin.

The code that displays the boxes is in the tuflowqgis_duplicate_file function in tuflowqgis_library.py:

# create qml from input layer
if keepform:
    qml = savename.replace('.shp','.qml')

    if QFile(qml).exists():
        return "QML File for output already exists."

    else:
        QMessageBox.information(qgis.mainWindow(),"Info", "Creating QML")
        layer.saveNamedStyle(qml)
        QMessageBox.information(qgis.mainWindow(),"Info", "Done")

I imagine that most people have specific setups for styles for their layers as well, perhaps it would be better to have the "Keep source formatting" option selected by default?

I'm happy to fix this and put in a pull request if that would help?

TUFLOW-Support commented 5 years ago

Hi Duncan, that's a good point- they're probably not needed. I'll remove them from the code (for both QGIS 2 and QGIS 3).

Cheers, Ellis