from vialectrum.address_synchronizer import TX_HEIGHT_LOCAL
from vialectrum.i18n import _
from vialectrum.util import (block_explorer_URL, profiler, TxMinedInfo,
                               OrderedDictWithIndex, timestamp_to_datetime)
from vialectrum.logging import get_logger, Logger

from .util import (read_QIcon, MONOSPACE_FONT, Buttons, CancelButton, OkButton,
                   filename_field, MyTreeView, AcceptFileDragDrop, WindowModalDialog,
                   CloseButton)

if TYPE_CHECKING:
    from vialectrum.wallet import Abstract_Wallet


_logger = get_logger(__name__)


try:
    from vialectrum.plot import plot_history, NothingToPlotException
except:
    _logger.info("could not import vialectrum.plot. This feature needs matplotlib to be installed.")
    plot_history = None

# note: this list needs to be kept in sync with another in kivy
TX_ICONS = [
    "unconfirmed.png",
    "warning.png",
    "unconfirmed.png",
    "offline_tx.png",
    "clock1.png",
Exemple #2
0
from PyQt5.QtCore import Qt, pyqtSignal, QThread
from PyQt5.QtWidgets import (QTreeWidget, QTreeWidgetItem, QMenu, QGridLayout,
                             QComboBox, QLineEdit, QDialog, QVBoxLayout,
                             QHeaderView, QCheckBox, QTabWidget, QWidget,
                             QLabel)

from vialectrum.i18n import _
from vialectrum import constants, blockchain
from vialectrum.interface import serialize_server, deserialize_server
from vialectrum.network import Network
from vialectrum.logging import get_logger

from .util import Buttons, CloseButton, HelpButton, read_QIcon

_logger = get_logger(__name__)

protocol_names = ['TCP', 'SSL']
protocol_letters = 'ts'


class NetworkDialog(QDialog):
    def __init__(self, network, config, network_updated_signal_obj):
        QDialog.__init__(self)
        self.setWindowTitle(_('Network'))
        self.setMinimumSize(500, 300)
        self.nlayout = NetworkChoiceLayout(network, config)
        self.network_updated_signal_obj = network_updated_signal_obj
        vbox = QVBoxLayout(self)
        vbox.addLayout(self.nlayout.layout())
        vbox.addLayout(Buttons(CloseButton(self)))