def settings_dialog(self, window): print "window:", window d = QDialog(window) vbox = QVBoxLayout(d) layout = QGridLayout() vbox.addLayout(layout) layout.addWidget(QLabel("Label sync options: "), 2, 0) self.upload = ThreadedButton("Force upload", partial(self.push_thread, window), self.done_processing) layout.addWidget(self.upload, 2, 1) self.download = ThreadedButton("Force download", partial(self.pull_thread, window, True), self.done_processing) layout.addWidget(self.download, 2, 2) self.accept = OkButton(d, _("Done")) vbox.addLayout(Buttons(CancelButton(d), self.accept)) if d.exec_(): return True else: return False
def settings_dialog(self, window): d = WindowModalDialog(window, _("Email settings")) d.setMinimumSize(500, 200) vbox = QVBoxLayout(d) vbox.addWidget(QLabel(_('Server hosting your email account'))) grid = QGridLayout() vbox.addLayout(grid) grid.addWidget(QLabel('Server (IMAP)'), 0, 0) server_e = QLineEdit() server_e.setText(self.imap_server) grid.addWidget(server_e, 0, 1) grid.addWidget(QLabel('Username'), 1, 0) username_e = QLineEdit() username_e.setText(self.username) grid.addWidget(username_e, 1, 1) grid.addWidget(QLabel('Password'), 2, 0) password_e = QLineEdit() password_e.setText(self.password) grid.addWidget(password_e, 2, 1) vbox.addStretch() vbox.addLayout(Buttons(CloseButton(d), OkButton(d))) if not d.exec_(): return server = str(server_e.text()) self.config.set_key('email_server', server) self.imap_server = server username = str(username_e.text()) self.config.set_key('email_username', username) self.username = username password = str(password_e.text()) self.config.set_key('email_password', password) self.password = password check_connection = CheckConnectionThread(server, username, password) check_connection.connection_error_signal.connect( lambda e: window.show_message( _("Unable to connect to mail server:\n {}").format(e) + "\n" + _("Please check your connection and credentials."))) check_connection.start()
def settings_dialog(self, window): wallet = window.parent().wallet d = WindowModalDialog(window, _("Label Settings")) vbox = QVBoxLayout(d) layout = QGridLayout() vbox.addLayout(layout) layout.addWidget(QLabel("Label sync options: "), 2, 0) self.upload = ThreadedButton("Force upload", partial(self.push_thread, wallet), self.done_processing) layout.addWidget(self.upload, 2, 1) self.download = ThreadedButton("Force download", partial(self.pull_thread, wallet, True), self.done_processing) layout.addWidget(self.download, 2, 2) self.accept = OkButton(d, _("Done")) vbox.addLayout(Buttons(CancelButton(d), self.accept)) return bool(d.exec_())
def settings_dialog(self, window): wallet = window.parent().wallet d = WindowModalDialog(window, _("Label Settings")) hbox = QHBoxLayout() hbox.addWidget(QLabel("Label sync options:")) upload = ThreadedButton("Force upload", partial(self.push_thread, wallet), partial(self.done_processing, d)) download = ThreadedButton("Force download", partial(self.pull_thread, wallet, True), partial(self.done_processing, d)) vbox = QVBoxLayout() vbox.addWidget(upload) vbox.addWidget(download) hbox.addLayout(vbox) vbox = QVBoxLayout(d) vbox.addLayout(hbox) vbox.addSpacing(20) vbox.addLayout(Buttons(OkButton(d))) return bool(d.exec_())
def settings_dialog(self, x): from electrum_gui.qt.util import Buttons, CloseButton, OkButton d = QDialog(self.settings_window) d.setWindowTitle("Email settings") d.setMinimumSize(500, 200) vbox = QVBoxLayout(d) vbox.addWidget(QLabel(_('Server hosting your email acount'))) grid = QGridLayout() vbox.addLayout(grid) grid.addWidget(QLabel('Server (IMAP)'), 0, 0) server_e = QLineEdit() server_e.setText(self.imap_server) grid.addWidget(server_e, 0, 1) grid.addWidget(QLabel('Username'), 1, 0) username_e = QLineEdit() username_e.setText(self.username) grid.addWidget(username_e, 1, 1) grid.addWidget(QLabel('Password'), 2, 0) password_e = QLineEdit() password_e.setText(self.password) grid.addWidget(password_e, 2, 1) vbox.addStretch() vbox.addLayout(Buttons(CloseButton(d), OkButton(d))) if not d.exec_(): return server = str(server_e.text()) self.config.set_key('email_server', server) username = str(username_e.text()) self.config.set_key('email_username', username) password = str(password_e.text()) self.config.set_key('email_password', password)
def settings_dialog(self, window): d = WindowModalDialog(window, _("Email settings")) d.setMinimumSize(500, 200) vbox = QVBoxLayout(d) vbox.addWidget(QLabel(_('Server hosting your email acount'))) grid = QGridLayout() vbox.addLayout(grid) grid.addWidget(QLabel('Server (IMAP)'), 0, 0) server_e = QLineEdit() server_e.setText(self.imap_server) grid.addWidget(server_e, 0, 1) grid.addWidget(QLabel('Username'), 1, 0) username_e = QLineEdit() username_e.setText(self.username) grid.addWidget(username_e, 1, 1) grid.addWidget(QLabel('Password'), 2, 0) password_e = QLineEdit() password_e.setText(self.password) grid.addWidget(password_e, 2, 1) vbox.addStretch() vbox.addLayout(Buttons(CloseButton(d), OkButton(d))) if not d.exec_(): return server = str(server_e.text()) self.config.set_key('email_server', server) self.imap_server = server username = str(username_e.text()) self.config.set_key('email_username', username) self.username = username password = str(password_e.text()) self.config.set_key('email_password', password) self.password = password
def settings_dialog(self, window): d = WindowModalDialog(window, _("AutoExport settings")) d.setMinimumSize(500, 200) layout = QVBoxLayout(d) # Initialize tab screen tabs = QTabWidget() tab0 = QWidget() tab1 = QWidget() tab2 = QWidget() tabs.resize(500, 200) # Add tabs tabs.addTab(tab0, _('Interval')) tabs.addTab(tab1, _('Local')) tabs.addTab(tab2, _('FTP')) # Create Interval tab grid = QGridLayout() tab0.layout = grid grid.addWidget(QLabel('Interval to auto export in seconds'), 0, 0) export_interval_seconds = QLineEdit() export_interval_seconds.setValidator(QIntValidator()) try: default_value = str(int(self.autoexport_interval_seconds)) except: default_value = '0' export_interval_seconds.setText(default_value) grid.addWidget(export_interval_seconds, 0, 1) tab0.setLayout(tab0.layout) # Create LocalExport tab grid = QGridLayout() tab1.layout = grid grid.addWidget(QLabel('Need export to local path'), 0, 0) export_need_export_to_local = QCheckBox() try: default_value = bool(self.autoexport_need_export_to_local) except: default_value = False export_need_export_to_local.setChecked(default_value) grid.addWidget(export_need_export_to_local, 0, 1) grid.addWidget(QLabel('Local path'), 1, 0) export_local_path = QLineEdit() try: default_value = str(self.autoexport_local_path) except: default_value = '' export_local_path.setText(default_value) grid.addWidget(export_local_path, 1, 1) tab1.setLayout(tab1.layout) # Create FTPExport tab grid = QGridLayout() tab2.layout = grid grid.addWidget(QLabel('Need export to ftp'), 0, 0) export_need_export_to_ftp = QCheckBox() try: default_value = bool(self.autoexport_need_export_to_ftp) except: default_value = False export_need_export_to_ftp.setChecked(default_value) grid.addWidget(export_need_export_to_ftp, 0, 1) grid.addWidget(QLabel('FTP Host'), 1, 0) export_ftp_host = QLineEdit() try: default_value = str(self.autoexport_ftp_host) except: default_value = '' export_ftp_host.setText(default_value) grid.addWidget(export_ftp_host, 1, 1) grid.addWidget(QLabel('FTP port'), 1, 2) export_ftp_port = QLineEdit() export_ftp_port.setValidator(QIntValidator()) try: default_value = str(int(self.autoexport_ftp_port)) except: default_value = '21' export_ftp_port.setText(default_value) grid.addWidget(export_ftp_port, 1, 3) grid.addWidget(QLabel('FTP user'), 2, 0) export_ftp_user = QLineEdit() try: default_value = str(self.autoexport_ftp_user) except: default_value = '' export_ftp_user.setText(default_value) grid.addWidget(export_ftp_user, 2, 1) grid.addWidget(QLabel('FTP password'), 2, 2) export_ftp_password = QLineEdit() try: default_value = str(self.autoexport_ftp_password) except: default_value = '' export_ftp_password.setEchoMode(QLineEdit.Password) export_ftp_password.setText(default_value) grid.addWidget(export_ftp_password, 2, 3) grid.addWidget(QLabel('FTP path'), 3, 0) export_ftp_dir = QLineEdit() try: default_value = str(self.autoexport_ftp_dir) except: default_value = '' export_ftp_dir.setText(default_value) grid.addWidget(export_ftp_dir, 3, 1) tab2.setLayout(tab2.layout) # Add tabs to widget layout.addWidget(tabs) layout.addStretch() layout.addLayout(Buttons(CloseButton(d), OkButton(d))) if not d.exec_(): return try: int_export_interval_seconds = int(export_interval_seconds.text()) except: int_export_interval_seconds = 0 self.config.set_key('autoexport_interval_seconds', int_export_interval_seconds) self.config.set_key('autoexport_need_export_to_ftp', export_need_export_to_ftp.isChecked()) self.config.set_key('autoexport_need_export_to_local', export_need_export_to_local.isChecked()) self.config.set_key('autoexport_local_path', export_local_path.text()) self.config.set_key('autoexport_ftp_host', export_ftp_host.text()) self.config.set_key('autoexport_ftp_port', export_ftp_port.text()) self.config.set_key('autoexport_ftp_user', export_ftp_user.text()) self.config.set_key('autoexport_ftp_password', export_ftp_password.text()) self.config.set_key('autoexport_ftp_dir', export_ftp_dir.text()) self.update_settings()