Ejemplo n.º 1
0
    def __init__(self, handler):
        super(BaseDock, self).__init__('', handler)
        self.handler = handler
        self.config = config.get_config()
        self.advertised_actions = {}
        self.is_enabled = True

        self.init_data()
        self.init_actions()
        my_layout = self.create_layout()
        self.main_widget = QWidget()
        self.main_widget.setLayout(my_layout)
        self.needsUpdate.connect(self.refresh_data)
        self.setWidget(self.main_widget)

        self.config.optionChanged.connect(self.on_option_changed)

        self.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea | QtCore.Qt.RightDockWidgetArea | QtCore.Qt.BottomDockWidgetArea)
        self.setFeatures(QDockWidget.DockWidgetClosable | QDockWidget.DockWidgetMovable | QDockWidget.DockWidgetFloatable)
        self.setObjectName(self.tool_name)
        self.setWindowTitle(self.tool_name)
        self.setWhatsThis(self.description)

        self.augmenters = []
        for name in dir(self):
            if name in known_augmenters:
                self.augmenters.append(name)
Ejemplo n.º 2
0
 def __init__(self, tx=None, parent=None):
     super(OutputsModel, self).__init__(parent)
     if tx is None:
         tx = Transaction()
     self.tx = tx
     self.amount_format = config.get_config().get_option(
         'amount_format', 'coins')
Ejemplo n.º 3
0
    def __init__(self, handler):
        super(BaseDock, self).__init__('', handler)
        self.handler = handler
        self.config = config.get_config()
        self.advertised_actions = {}
        self.local_actions = {}
        self.is_enabled = True

        self.init_data()
        self.init_actions()
        my_layout = self.create_layout()
        self.main_widget = QWidget()
        self.main_widget.setLayout(my_layout)
        self.needsUpdate.connect(self.refresh_data)
        self.toggleViewAction().triggered.connect(self.visibility_toggled)
        self.setWidget(self.main_widget)

        self.config.optionChanged.connect(self.on_option_changed)

        self.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea
                             | QtCore.Qt.RightDockWidgetArea
                             | QtCore.Qt.BottomDockWidgetArea)
        self.setFeatures(QDockWidget.DockWidgetClosable
                         | QDockWidget.DockWidgetMovable
                         | QDockWidget.DockWidgetFloatable)
        self.setObjectName(self.tool_name)
        self.setWindowTitle(self.tool_name)
        self.setWhatsThis(self.description)

        self.augmenters = []
        for name in dir(self):
            if name in known_augmenters:
                self.augmenters.append(name)
Ejemplo n.º 4
0
    def __init__(self, handler):
        self.handler = handler
        self.config = config.get_config()
        self.config.optionChanged.connect(self.on_option_changed)
        self.is_enabled = True

        self.augmenters = []
        for name in dir(self):
            if name in known_augmenters:
                self.augmenters.append(name)
Ejemplo n.º 5
0
 def __init__(self, parent=None):
     super(OutputsTree, self).__init__(parent)
     self.model = OutputsModel()
     self.view = QTableView()
     self.view.setAlternatingRowColors(True)
     self.view.setModel(self.model)
     self.view.horizontalHeader().setResizeMode(0, QHeaderView.Interactive)
     self.view.horizontalHeader().setResizeMode(1, QHeaderView.Stretch)
     self.view.horizontalHeader().setHighlightSections(False)
     self.view.verticalHeader().setDefaultSectionSize(22)
     self.view.verticalHeader().setVisible(False)
     self.view.setSelectionMode(QAbstractItemView.SingleSelection)
     self.view.setSelectionBehavior(QAbstractItemView.SelectRows)
     self.view.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
     self.view.customContextMenuRequested.connect(self.customContextMenu)
     vbox = QVBoxLayout()
     vbox.setContentsMargins(0, 0, 0, 0)
     vbox.addWidget(self.view)
     self.setLayout(vbox)
     config.get_config().optionChanged.connect(self.on_option_changed)
Ejemplo n.º 6
0
 def __init__(self, parent=None):
     super(OutputsTree, self).__init__(parent)
     self.model = OutputsModel()
     self.view = QTableView()
     self.view.setAlternatingRowColors(True)
     self.view.setModel(self.model)
     self.view.horizontalHeader().setResizeMode(0, QHeaderView.Interactive)
     self.view.horizontalHeader().setResizeMode(1, QHeaderView.Stretch)
     self.view.horizontalHeader().setHighlightSections(False)
     self.view.verticalHeader().setDefaultSectionSize(22)
     self.view.verticalHeader().setVisible(False)
     self.view.setSelectionMode(QAbstractItemView.SingleSelection)
     self.view.setSelectionBehavior(QAbstractItemView.SelectRows)
     self.view.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
     self.view.customContextMenuRequested.connect(self.customContextMenu)
     vbox = QVBoxLayout()
     vbox.setContentsMargins(0, 0, 0, 0)
     vbox.addWidget(self.view)
     self.setLayout(vbox)
     config.get_config().optionChanged.connect(self.on_option_changed)
Ejemplo n.º 7
0
    def __init__(self, parent=None):
        super(TxWidget, self).__init__(parent)
        self.config = config.get_config()
        self.config.optionChanged.connect(self.on_option_changed)
        # Widgets for tx fields
        self.field_widgets = OrderedDict()

        form = QFormLayout()

        self.tx_id = QLineEdit()
        self.tx_id.setReadOnly(True)
        self.tx_id.setToolTip('Transaction ID')
        self.tx_id.setWhatsThis(
            'The ID (hash) of the transaction is displayed here.')

        self.version_edit = QLineEdit()
        self.version_edit.setReadOnly(True)
        self.inputs_tree = inputs = InputsTree()
        self.outputs_tree = outputs = OutputsTree()
        self.locktime_edit = LockTimeWidget()

        self.field_widgets.update({'nVersion': self.version_edit})
        self.field_widgets.update({'vin': self.inputs_tree})
        self.field_widgets.update({'vout': self.outputs_tree})
        self.field_widgets.update({'nLockTime': self.locktime_edit})

        self.tx_properties = TxProperties()

        self.tx_fields_layout = QFormLayout()
        self.tx_fields_layout.setContentsMargins(0, 0, 0, 0)
        self.tx_fields_layout.addRow(QLabel('Version:'), self.version_edit)
        self.tx_fields_layout.addRow(QLabel('Inputs:'), inputs)
        self.tx_fields_layout.addRow(QLabel('Outputs:'), outputs)
        self.tx_fields_layout.addRow(QLabel('LockTime:'), self.locktime_edit)

        form.addRow('Tx ID:', self.tx_id)
        form.addRow(self.tx_fields_layout)
        form.addRow('Metadata:', self.tx_properties)

        self.adjust_field_widgets()

        self.setLayout(form)
Ejemplo n.º 8
0
    def __init__(self, parent=None):
        super(TxWidget, self).__init__(parent)
        self.config = config.get_config()
        self.config.optionChanged.connect(self.on_option_changed)
        # Widgets for tx fields
        self.field_widgets = OrderedDict()

        form = QFormLayout()

        self.tx_id = QLineEdit()
        self.tx_id.setReadOnly(True)
        self.tx_id.setToolTip('Transaction ID')
        self.tx_id.setWhatsThis('The ID (hash) of the transaction is displayed here.')

        self.version_edit = QLineEdit()
        self.version_edit.setReadOnly(True)
        self.inputs_tree = inputs = InputsTree()
        self.outputs_tree = outputs = OutputsTree()
        self.locktime_edit = LockTimeWidget()

        self.field_widgets.update({'nVersion': self.version_edit})
        self.field_widgets.update({'vin': self.inputs_tree})
        self.field_widgets.update({'vout': self.outputs_tree})
        self.field_widgets.update({'nLockTime': self.locktime_edit})

        self.tx_properties = TxProperties()

        self.tx_fields_layout = QFormLayout()
        self.tx_fields_layout.setContentsMargins(0, 0, 0, 0)
        self.tx_fields_layout.addRow(QLabel('Version:'), self.version_edit)
        self.tx_fields_layout.addRow(QLabel('Inputs:'), inputs)
        self.tx_fields_layout.addRow(QLabel('Outputs:'), outputs)
        self.tx_fields_layout.addRow(QLabel('LockTime:'), self.locktime_edit)

        form.addRow('Tx ID:', self.tx_id)
        form.addRow(self.tx_fields_layout)
        form.addRow('Metadata:', self.tx_properties)

        self.adjust_field_widgets()

        self.setLayout(form)
Ejemplo n.º 9
0
    def __init__(self, handler):
        super(BaseDock, self).__init__('', handler)
        self.handler = handler
        self.tool_name = ''
        self.description = ''
        self.config = config.get_config()

        self.init_metadata()
        self.init_data()
        my_layout = self.create_layout()
        self.main_widget = QWidget()
        self.main_widget.setLayout(my_layout)
        self.needsUpdate.connect(self.refresh_data)
        self.setWidget(self.main_widget)

        self.config.optionChanged.connect(self.on_option_changed)

        self.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea | QtCore.Qt.RightDockWidgetArea | QtCore.Qt.BottomDockWidgetArea)
        self.setFeatures(QDockWidget.DockWidgetClosable | QDockWidget.DockWidgetMovable | QDockWidget.DockWidgetFloatable)
        self.setObjectName(self.tool_name)
        self.setWindowTitle(self.tool_name)
        self.setWhatsThis(self.description)
Ejemplo n.º 10
0
 def on_option_changed(self, key):
     if key == 'amount_format':
         self.model.amount_format = config.get_config().get_option('amount_format', 'coins')
         self.model.amount_format_changed()
Ejemplo n.º 11
0
 def __init__(self, parent=None):
     super(OutputsModel, self).__init__(parent)
     self.vout = []
     self.amount_format = config.get_config().get_option('amount_format', 'coins')
Ejemplo n.º 12
0
 def on_option_changed(self, key):
     if key == 'amount_format':
         self.model.amount_format = config.get_config().get_option(
             'amount_format', 'coins')
         self.model.amount_format_changed()
Ejemplo n.º 13
0
 def __init__(self, parent=None):
     super(OutputsModel, self).__init__(parent)
     self.vout = []
     self.amount_format = config.get_config().get_option(
         'amount_format', 'coins')
Ejemplo n.º 14
0
 def __init__(self, tx=None, parent=None):
     super(OutputsModel, self).__init__(parent)
     if tx is None:
         tx = Transaction()
     self.tx = tx
     self.amount_format = config.get_config().get_option('amount_format', 'coins')