Пример #1
0
 def __init__(self, parent):
     QAbstractItemModel.__init__(self, parent)
     Logger.__init__(self)
     self.parent = parent
     self.view = None  # type: HistoryList
     self.transactions = OrderedDictWithIndex()
     self.tx_status_cache = {}  # type: Dict[str, Tuple[int, str]]
     self.summary = None
Пример #2
0
    def __init__(self, main_window, exctype, value, tb):
        BaseCrashReporter.__init__(self, exctype, value, tb)
        self.main_window = main_window

        QWidget.__init__(self)
        self.setWindowTitle('Electrum - ' + _('An Error Occurred'))
        self.setMinimumSize(600, 300)

        Logger.__init__(self)

        main_box = QVBoxLayout()

        heading = QLabel('<h2>' + BaseCrashReporter.CRASH_TITLE + '</h2>')
        main_box.addWidget(heading)
        main_box.addWidget(QLabel(BaseCrashReporter.CRASH_MESSAGE))

        main_box.addWidget(QLabel(BaseCrashReporter.REQUEST_HELP_MESSAGE))

        collapse_info = QPushButton(_("Show report contents"))
        collapse_info.clicked.connect(
            lambda: self.msg_box(QMessageBox.NoIcon,
                                 self,
                                 _("Report contents"),
                                 self.get_report_string(),
                                 rich_text=True))

        main_box.addWidget(collapse_info)

        main_box.addWidget(QLabel(BaseCrashReporter.DESCRIBE_ERROR_MESSAGE))

        self.description_textfield = QTextEdit()
        self.description_textfield.setFixedHeight(50)
        self.description_textfield.setPlaceholderText(
            _("Do not enter sensitive/private information here. "
              "The report will be visible on the public issue tracker."))
        main_box.addWidget(self.description_textfield)

        main_box.addWidget(QLabel(BaseCrashReporter.ASK_CONFIRM_SEND))

        buttons = QHBoxLayout()

        report_button = QPushButton(_('Send Bug Report'))
        report_button.clicked.connect(self.send_report)
        report_button.setIcon(read_QIcon("tab_send.png"))
        buttons.addWidget(report_button)

        never_button = QPushButton(_('Never'))
        never_button.clicked.connect(self.show_never)
        buttons.addWidget(never_button)

        close_button = QPushButton(_('Not Now'))
        close_button.clicked.connect(self.close)
        buttons.addWidget(close_button)

        main_box.addLayout(buttons)

        self.setLayout(main_box)
        self.show()
Пример #3
0
 def __init__(self, main_window, *args, **kwargs):
     QObject.__init__(self, *args, **kwargs)
     Logger.__init__(self)
     if not main_window.config.get(BaseCrashReporter.config_key,
                                   default=True):
         return
     self.main_window = main_window
     sys.excepthook = self.handler
     self._report_exception.connect(_show_window)
Пример #4
0
 def __init__(self, imap_server, username, password, callback):
     threading.Thread.__init__(self)
     Logger.__init__(self)
     self.daemon = True
     self.username = username
     self.password = password
     self.imap_server = imap_server
     self.on_receive = callback
     self.M = None
     self.reset_connect_wait()
Пример #5
0
 def __init__(self, handler, plugin, proto):
     assert hasattr(self, 'tx_api')  # ProtocolMixin already constructed?
     self.proto = proto
     self.device = plugin.device
     self.handler = handler
     self.tx_api = plugin
     self.types = plugin.types
     self.msg = None
     self.creating_wallet = False
     Logger.__init__(self)
     self.used()
Пример #6
0
 def __init__(self, main_window):
     base.ExceptionHandler.__init__(self)
     Logger.__init__(self)
     self.main_window = main_window
     if not main_window.electrum_config.get(BaseCrashReporter.config_key,
                                            default=True):
         return
     # For exceptions in Kivy:
     base.ExceptionManager.add_handler(self)
     # For everything else:
     sys.excepthook = lambda exctype, value, tb: self.handle_exception(value
                                                                       )
Пример #7
0
    def __init__(self, transport, handler, plugin):
        if plugin.is_outdated_fw_ignored():
            TrezorClient.is_outdated = lambda *args, **kwargs: False
        self.client = TrezorClient(transport, ui=self)
        self.plugin = plugin
        self.device = plugin.device
        self.handler = handler
        Logger.__init__(self)

        self.msg = None
        self.creating_wallet = False

        self.in_flow = False

        self.used()
Пример #8
0
 def __init__(self, win, device):
     QObject.__init__(self)
     Logger.__init__(self)
     self.clear_signal.connect(self.clear_dialog)
     self.error_signal.connect(self.error_dialog)
     self.message_signal.connect(self.message_dialog)
     self.passphrase_signal.connect(self.passphrase_dialog)
     self.word_signal.connect(self.word_dialog)
     self.query_signal.connect(self.win_query_choice)
     self.yes_no_signal.connect(self.win_yes_no_question)
     self.status_signal.connect(self._update_status)
     self.win = win
     self.device = device
     self.dialog = None
     self.done = threading.Event()
Пример #9
0
    def __init__(self, config, daemon, plugins):
        set_language(config.get('language', get_default_language()))
        Logger.__init__(self)
        # Uncomment this call to verify objects are being properly
        # GC-ed when windows are closed
        #network.add_jobs([DebugMem([Abstract_Wallet, SPV, Synchronizer,
        #                            ElectrumWindow], interval=5)])
        QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_X11InitThreads)
        if hasattr(QtCore.Qt, "AA_ShareOpenGLContexts"):
            QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_ShareOpenGLContexts)
        if hasattr(QGuiApplication, 'setDesktopFileName'):
            QGuiApplication.setDesktopFileName('electrum-xzc.desktop')
        self.gui_thread = threading.current_thread()
        self.config = config
        self.daemon = daemon
        self.plugins = plugins
        self.windows = []
        self.efilter = OpenFileEventFilter(self.windows)
        self.app = QElectrumApplication(sys.argv)
        self.app.installEventFilter(self.efilter)
        self.app.setWindowIcon(read_QIcon("electrum-xzc.png"))
        # timer
        self.timer = QTimer(self.app)
        self.timer.setSingleShot(False)
        self.timer.setInterval(500)  # msec

        self.nd = None
        self.dash_net_dialog = None
        self.network_updated_signal_obj = QNetworkUpdatedSignalObject()
        self.dash_net_sobj = QDashNetSignalsObject()
        self._num_wizards_in_progress = 0
        self._num_wizards_lock = threading.Lock()
        # init tray
        self.dark_icon = self.config.get("dark_icon", False)
        self.tray = QSystemTrayIcon(self.tray_icon(), None)
        self.tray.setToolTip('Electrum-XZC')
        self.tray.activated.connect(self.tray_activated)
        self.build_tray_menu()
        self.tray.show()
        self.app.new_window_signal.connect(self.start_new_window)
        self.set_dark_theme_if_needed()
        run_hook('init_qt', self)
Пример #10
0
    def __init__(self, win):
        CompletionTextEdit.__init__(self)
        ScanQRTextEdit.__init__(self)
        Logger.__init__(self)
        self.win = win
        self.amount_edit = win.amount_e
        self.document().contentsChanged.connect(self.update_size)
        self.heightMin = 0
        self.heightMax = 150
        self.c = None
        self.textChanged.connect(self.check_text)
        self.outputs = []
        self.errors = []
        self.is_pr = False
        self.is_alias = False
        self.scan_f = win.pay_to_URI
        self.update_size()
        self.payto_address = None

        self.previous_payto = ''
Пример #11
0
    def __init__(self, manager, parent):
        super(MasternodeDialog, self).__init__(parent)
        Logger.__init__(self)
        self.gui = parent
        self.manager = manager
        self.setWindowTitle(_('Znode Manager'))

        self.waiting_dialog = None
        self.create_layout()
        # Create a default masternode if none are present.
        if len(self.manager.masternodes) == 0:
            self.masternodes_widget.add_masternode(MasternodeAnnounce(alias='default'), save=False)

        mn_list = self.gui.dip3_tab.mn_list
        if mn_list:
            mn_list.register_callback(self.on_mn_list_diff_updated,
                                      ['mn-list-diff-updated'])
        self.diff_updated.connect(self.on_diff_updated)

        self.mn_status_updater = QTimer(self)
        self.mn_status_updater.timeout.connect(self.mn_status_update)
Пример #12
0
 def __init__(self, main_window):
     QThread.__init__(self)
     Logger.__init__(self)
     self.main_window = main_window
Пример #13
0
 def __init__(self, user_agent=None, base_url='https://api.trustedcoin.com/2/'):
     self.base_url = base_url
     self.debug = False
     self.user_agent = user_agent
     Logger.__init__(self)
Пример #14
0
 def __init__(self, plugin, window):
     QObject.__init__(self)
     self.plugin = plugin
     self.window = window
     Logger.__init__(self)