import logging
from qrutilities.imageutils import ImageUtils
from PyQt4.QtGui import QColor
logger = logging.getLogger('console')

class WellPlotStyleHandler(object):
    '''
    classdocs
    '''


    def saveDataState(self, wellPlotData, wellPlotStyleWidget):   
        if wellPlotStyleWidget.plotTitleOnCheckBox.isChecked():
            wellPlotData.title_on = True
        else:
            wellPlotData.title_on = False
        wellPlotData.title = wellPlotStyleWidget.plotTitleLineEdit.text()
        r,g,b,a = QColor(wellPlotStyleWidget.trackBackgroundColorPushButton.color()).getRgb()
        rgbString = ImageUtils.rgbToString(r,g,b)
        wellPlotData.plot_background_rgb = rgbString
        wellPlotData.plot_background_alpha = wellPlotStyleWidget.trackBackgroundOpacitySpinBox.value()
        
        r,g,b,a = QColor(wellPlotStyleWidget.labelBackgroundColorPushButton.color()).getRgb()
        rgbString = ImageUtils.rgbToString(r,g,b)
        wellPlotData.label_background_rgb = rgbString
        wellPlotData.label_background_alpha = wellPlotStyleWidget.labelBackgroundOpacitySpinBox.value()
        
        r,g,b,a = QColor(wellPlotStyleWidget.labelForegroundColorPushButton.color()).getRgb()
        rgbString = ImageUtils.rgbToString(r,g,b)
        wellPlotData.label_foreground_rgb = rgbString
        wellPlotData.label_foreground_alpha = wellPlotStyleWidget.labelForegroundOpacitySpinBox.value()
        
        if wellPlotStyleWidget.singleRowLabelsCheckBox.isChecked():
            wellPlotData.single_row_header_labels = True
        else:
            wellPlotData.single_row_header_labels = False
[((4, 9, 4, 37), 'logging.getLogger', 'logging.getLogger', ({(4, 27, 4, 36): '"""console"""'}, {}), "('console')", False, 'import logging\n'), ((19, 20, 19, 49), 'qrutilities.imageutils.ImageUtils.rgbToString', 'ImageUtils.rgbToString', ({(19, 43, 19, 44): 'r', (19, 45, 19, 46): 'g', (19, 47, 19, 48): 'b'}, {}), '(r, g, b)', False, 'from qrutilities.imageutils import ImageUtils\n'), ((24, 20, 24, 49), 'qrutilities.imageutils.ImageUtils.rgbToString', 'ImageUtils.rgbToString', ({(24, 43, 24, 44): 'r', (24, 45, 24, 46): 'g', (24, 47, 24, 48): 'b'}, {}), '(r, g, b)', False, 'from qrutilities.imageutils import ImageUtils\n'), ((29, 20, 29, 49), 'qrutilities.imageutils.ImageUtils.rgbToString', 'ImageUtils.rgbToString', ({(29, 43, 29, 44): 'r', (29, 45, 29, 46): 'g', (29, 47, 29, 48): 'b'}, {}), '(r, g, b)', False, 'from qrutilities.imageutils import ImageUtils\n')]