# Path: ngcccbase/sanitize.py
# class InvalidInput(Exception): pass
# class AssetNotFound(InvalidInput):
# class SchemeNotFound(InvalidInput):
#     def __init__(self, moniker):
#     def __init__(scheme):
# def asset(model, _moniker):
# def decimal(decimal):
# def quantity(quantity): # asset unknown
# def assetamount(asset, amount):
# def unit(unit):
# def scheme(scheme):
# def integer(number):
# def flag(flag):
# def moniker(moniker):
# def cfgkey(key):
# def cfgvalue(value):
# def colordesc(colordesc):
# def jsonasset(data):
# def coloraddress(model, asset, coloraddress):
# def sendmanyjson(model, data):
# def sendmanycsv(model, path):
# def _sanitize_csv_input(model, csvvalues, row):


import collections
from PyQt4 import QtGui, uic
from wallet import wallet
from decimal import Decimal
from ngcccbase import sanitize
    def edtAmountValidate(self):
        valid = True
        if self.edtAmount.value() == 0:
            valid = False
            self.edtAmount.setStyleSheet('background:#FF8080')
        else:
            self.edtAmount.setStyleSheet('')
        return valid

    def isValid(self):
        return all([self.edtAddressValidate(), self.edtAmountValidate()])

    def getData(self):
        moniker = str(self.cbMoniker.currentText())
        asset = wallet.get_asset_definition(moniker)
        value = asset.parse_value(str(self.edtAmount.value()))
        return {
            'address': str(self.edtAddress.text()),
            'value':  value,
            'moniker': moniker,
        }


class SendcoinsPage(QtGui.QWidget):
    def __init__(self, parent):
        QtGui.QWidget.__init__(self, parent)
        uic.loadUi(uic.getUiPath('sendcoinspage.ui'), self)

        # FIXME self.btnAddRecipient.clicked.connect(self.btnAddRecipientClicked)
        self.btnClearAll.clicked.connect(self.btnClearAllClicked)

# Path: ngcccbase/sanitize.py
# class InvalidInput(Exception): pass
# class AssetNotFound(InvalidInput):
# class SchemeNotFound(InvalidInput):
#     def __init__(self, moniker):
#     def __init__(scheme):
# def asset(model, _moniker):
# def decimal(decimal):
# def quantity(quantity): # asset unknown
# def assetamount(asset, amount):
# def unit(unit):
# def scheme(scheme):
# def integer(number):
# def flag(flag):
# def moniker(moniker):
# def cfgkey(key):
# def cfgvalue(value):
# def colordesc(colordesc):
# def jsonasset(data):
# def coloraddress(model, asset, coloraddress):
# def sendmanyjson(model, data):
# def sendmanycsv(model, path):
# def _sanitize_csv_input(model, csvvalues, row):


# Path: ui/sendcoinspage.py
import collections
from PyQt4 import QtGui, uic
from wallet import wallet
from decimal import Decimal
from ngcccbase import sanitize

    def edtAmountValidate(self):
        valid = True
        if self.edtAmount.value() == 0:
            valid = False
            self.edtAmount.setStyleSheet('background:#FF8080')
        else:
            self.edtAmount.setStyleSheet('')
        return valid

    def isValid(self):
        return all([self.edtAddressValidate(), self.edtAmountValidate()])

    def getData(self):
        moniker = str(self.cbMoniker.currentText())
        asset = wallet.get_asset_definition(moniker)
        value = asset.parse_value(str(self.edtAmount.value()))
        return {
            'address': str(self.edtAddress.text()),
            'value':  value,
            'moniker': moniker,
        }


class SendcoinsPage(QtGui.QWidget):
    def __init__(self, parent):
        QtGui.QWidget.__init__(self, parent)
        uic.loadUi(uic.getUiPath('sendcoinspage.ui'), self)

        # FIXME self.btnAddRecipient.clicked.connect(self.btnAddRecipientClicked)
        self.btnClearAll.clicked.connect(self.btnClearAllClicked)

        self.btnSend.clicked.connect(self.btnSendClicked)