def __init__(self, gui, wallet, *args, **kwargs): QTabWidget.__init__(self, *args, **kwargs) self.tab_bar = Dip3TabBar(self) self.setTabBar(self.tab_bar) self.setTabPosition(QTabWidget.East) self.gui = gui self.wallet = wallet self.manager = wallet.protx_manager self.mn_list = gui.network.mn_list if gui.network else None self.reg_cur_protx = '' self.w_cur_alias = '' self.w_cur_state = '' self.w_cur_idx = None self.wallet_mn_tab = self.create_wallet_mn_tab() if self.mn_list: self.registerd_mn_tab = self.create_registered_mn_tab() self.searchable_list = self.w_model self.currentChanged.connect(self.on_tabs_current_changed) if self.mn_list: self.tab_bar.update_stats(self.get_stats()) self.mn_list.register_callback(self.on_mn_list_diff_updated, ['mn-list-diff-updated']) self.mn_list.register_callback(self.on_mn_list_info_updated, ['mn-list-info-updated']) if self.gui.network: util.register_callback(self.on_cb_network_updated, ['network_updated']) self.manager.register_callback(self.on_manager_alias_updated, ['manager-alias-updated']) self.alias_updated.connect(self.on_alias_updated) self.diff_updated.connect(self.on_diff_updated) self.info_updated.connect(self.on_info_updated) self.network_updated.connect(self.on_network_updated)
def open(self, *args, **kwargs): super(ProTxStatsDialog, self).open(*args, **kwargs) net = self.dn_dlg.net mn_list = net.mn_list mn_list.register_callback( self.update_cb, ['mn-list-diff-updated', 'mn-list-info-updated']) util.register_callback(self.update_cb, ['network_updated'])
def __init__(self, config, daemon, plugins): colorama.init() self.config = config self.network = network = daemon.network if config.get('tor_auto_on', True): if network: proxy_modifiable = config.is_modifiable('proxy') if not proxy_modifiable or not network.detect_tor_proxy(): print(network.TOR_WARN_MSG_TXT) c = '' while c != 'y': c = input("Continue without Tor (y/n)?") if c == 'n': exit() storage = WalletStorage(config.get_wallet_path()) if not storage.file_exists: print("Wallet not found. try 'electrum-dash create'") exit() if storage.is_encrypted(): password = getpass.getpass('Password:'******'Can not open unfinished multisig wallet') exit() if getattr(storage, 'backup_message', None): print(f'{storage.backup_message}\n') input('Press Enter to continue...') self.done = 0 self.last_balance = "" self.str_recipient = "" self.str_description = "" self.str_amount = "" self.str_fee = "" self.wallet = Wallet(db, storage, config=config) self.wallet.start_network(self.network) self.contacts = self.wallet.contacts util.register_callback(self.on_network, ['wallet_updated', 'network_updated', 'banner']) self.commands = [_("[h] - displays this help text"), \ _("[i] - display transaction history"), \ _("[o] - enter payment order"), \ _("[p] - print stored payment order"), \ _("[s] - send stored payment order"), \ _("[r] - show own receipt addresses"), \ _("[c] - display contacts"), \ _("[b] - print server banner"), \ _("[M] - start PrivateSend mixing"), _("[S] - stop PrivateSend mixing"), _("[l][f][a] - print PrivateSend log (filtered/all)"), _("[q] - quit")] self.num_commands = len(self.commands)
def show(self): super(DashNetDialog, self).show() if self.network: util.register_callback(self.on_dash_net, ['dash-peers-updated', 'dash-net-activity', 'sporks-activity', 'dash-banlist-updated'])
def open(self): super(PSDialog, self).open() util.register_callback(self.on_ps_callback, [ 'ps-log-changes', 'ps-wfl-changes', 'ps-keypairs-changes', 'ps-reserved-changes', 'ps-data-changes', 'ps-state-changes' ]) if self.psman.show_warn_electrumx: mixing_tab = self.mixing_tab Clock.schedule_once(lambda dt: mixing_tab.show_warn_electrumx())
def __init__(self, network, config, network_updated_signal_obj): QDialog.__init__(self) self.setWindowTitle(_('Electrum Network')) self.setMinimumSize(500, 500) 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))) self.network_updated_signal_obj.network_updated_signal.connect( self.on_update) util.register_callback(self.on_network, ['network_updated'])
def open(self, *args, **kwargs): super(DashNetDialog, self).open(*args, **kwargs) self.dash_net.register_callback(self.on_dash_net_activity_cb, ['dash-net-activity']) self.dash_net.register_callback(self.on_sporks_activity_cb, ['sporks-activity']) self.dash_net.register_callback(self.on_dash_peers_updated_cb, ['dash-peers-updated']) self.dash_net.register_callback(self.on_dash_banlist_updated_cb, ['dash-banlist-updated']) self.mn_list.register_callback(self.on_mn_list_diff_updated_cb, ['mn-list-diff-updated']) self.mn_list.register_callback(self.on_mn_list_info_updated_cb, ['mn-list-info-updated']) util.register_callback(self.on_network_updated_cb, ['network_updated'])
def __init__(self, config: 'SimpleConfig', daemon: 'Daemon', plugins: 'Plugins'): self.config = config self.network = network = daemon.network if config.get('tor_auto_on', True): if network: proxy_modifiable = config.is_modifiable('proxy') if not proxy_modifiable or not network.detect_tor_proxy(): print(network.TOR_WARN_MSG_TXT) c = '' while c != 'y': c = input("Continue without Tor (y/n)?") if c == 'n': exit() storage = WalletStorage(config.get_wallet_path()) if not storage.file_exists(): print("Wallet not found. try 'electrum-dash create'") exit() if storage.is_encrypted(): password = getpass.getpass('Password:'******'') self.encoding = locale.getpreferredencoding() self.stdscr = curses.initscr() curses.noecho() curses.cbreak() curses.start_color() curses.use_default_colors() curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLUE) curses.init_pair(2, curses.COLOR_WHITE, curses.COLOR_CYAN) curses.init_pair(3, curses.COLOR_BLACK, curses.COLOR_WHITE) self.stdscr.keypad(1) if getattr(storage, 'backup_message', None): msg_key = 'Press any key to continue...' self.stdscr.addstr(f'{storage.backup_message}\n\n{msg_key}') self.stdscr.getch() self.stdscr.border(0) self.maxy, self.maxx = self.stdscr.getmaxyx() self.set_cursor(0) self.w = curses.newwin(10, 50, 5, 5) console_stderr_handler.setLevel(logging.CRITICAL) self.tab = 0 self.pos = 0 self.popup_pos = 0 self.str_recipient = "" self.str_description = "" self.str_amount = "" self.str_fee = "" self.history = None def_dip2 = not self.wallet.psman.unsupported self.show_dip2 = self.config.get('show_dip2_tx_type', def_dip2) util.register_callback(self.update, ['wallet_updated', 'network_updated']) self.tab_names = [_("History"), _("Send"), _("Receive"), _("Addresses"), _("Contacts"), _("Banner")] self.num_tabs = len(self.tab_names)
def __init__(self, parent, protx_hash=None, alias=None): ''' Show information about registred Masternodes with given prot_hash, or Masternodes in manager with given alias. ''' super(Dip3MNInfoDialog, self).__init__(parent) self.setMinimumSize(950, 450) self.setWindowIcon(read_QIcon('electrum-dash.png')) self.parent = parent self.gui = parent.gui self.manager = parent.manager self.mn_list = parent.mn_list self.diff_updated.connect(self.on_diff_updated) self.info_updated.connect(self.on_info_updated) if alias: self.mn = self.manager.mns.get(alias) else: self.mn = None if self.mn: self.protx_hash = self.mn.protx_hash self.setWindowTitle(_('%s Masternode Info') % alias) elif protx_hash: self.protx_hash = protx_hash self.setWindowTitle(_('%s... Masternode Info') % protx_hash[:32]) if self.mn_list and self.protx_hash: mn_list = self.mn_list sml_entry = mn_list.protx_mns.get(self.protx_hash, {}) self.diff_info = sml_entry.as_dict() if sml_entry else {} util.register_callback(self.on_mn_list_diff_updated, ['mn-list-diff-updated']) util.register_callback(self.on_mn_list_info_updated, ['mn-list-info-updated']) self.info = mn_list.protx_info.get(self.protx_hash, {}) if not self.info and self.gui.network.is_connected(): self.gui.network.run_from_another_thread( self.gui.network.request_protx_info(self.protx_hash) ) else: self.diff_info = {} self.info = {} layout = QGridLayout() self.setLayout(layout) self.tabs = QTabWidget(self) self.close_btn = b = QPushButton(_('Close')) b.setDefault(True) b.clicked.connect(self.close) layout.addWidget(self.tabs, 0, 0, 1, -1) layout.setColumnStretch(0, 1) layout.addWidget(b, 1, 1) if self.mn: self.mn_tab = QWidget() self.mn_label = QLabel(_('Wallet Masternode: %s') % self.mn.alias) self.mn_view = QTextEdit() self.mn_view.setReadOnly(True) self.mn_view.setText(pformat(self.mn.as_dict())) mn_vbox = QVBoxLayout() mn_vbox.addWidget(self.mn_label) mn_vbox.addWidget(self.mn_view) self.mn_tab.setLayout(mn_vbox) self.tabs.addTab(self.mn_tab, _('Wallet')) if self.protx_hash: self.diff_info_tab = QWidget() self.diff_info_view = QTextEdit() self.diff_info_view.setReadOnly(True) self.diff_info_view.setText(pformat(self.diff_info)) diff_info_vbox = QVBoxLayout() diff_info_vbox.addWidget(self.diff_info_view) self.diff_info_tab.setLayout(diff_info_vbox) self.tabs.addTab(self.diff_info_tab, _('protx.diff data (merkle ' 'root verified)')) self.info_tab = QWidget() self.info_view = QTextEdit() self.info_view.setReadOnly(True) self.info_view.setText(pformat(self.info)) info_vbox = QVBoxLayout() info_vbox.addWidget(self.info_view) self.info_tab.setLayout(info_vbox) self.tabs.addTab(self.info_tab, _('protx.info data (unverified)'))
def open(self, *args, **kwargs): super(DashNetDataFlowDialog, self).open(*args, **kwargs) util.register_callback(self.update_cb, ['dash-net-activity', 'dash-peers-updated'])