# -*- coding: utf-8 -*-
"""
/***************************************************************************
 CreateGraphDialog
                                 A QGIS plugin
 This is a new feature of the Graphab plugin that allow you to rasterize
 vector files and merge them into one raster file. You can also merge
 direct raster files.
 Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
                             -------------------
        begin                : 2021-04-07
        git sha              : $Format:%H$
        copyright            : (C) 2021 by ThéMA
        email                : robin.marlinl@gmail.com
        author               : Robin Marlin-Lefebvre
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
"""

from qgis.core import QgsProcessingFeedback


class MyFeedBack(QgsProcessingFeedback):
    def setOsRaster(self, osraster):
        self.osraster = osraster

    def setProgressText(self, text):
        self.osraster.logTextEdit.insertPlainText(text + '\n')

    def pushInfo(self, info):
        self.osraster.logTextEdit.insertPlainText(info + '\n')

    def pushCommandInfo(self, info):
        self.osraster.logTextEdit.insertPlainText(info + '\n')

    def pushDebugInfo(self, info):
        self.osraster.logTextEdit.insertPlainText(info + '\n')

    """def pushConsoleInfo(self, info):
        self.osraster.logTextEdit.insertPlainText(info + '\n')"""

    def reportError(self, error, fatalError=False):
        self.osraster.logTextEdit.insertPlainText(error + '\n')
