Пример #1
0
 def go(self, code):
     self.reset()
     self.invite_code_widget.hide()
     self.progressbar.show()
     if self.invite_code_widget.tor_checkbox.isChecked():
         use_tor = True
         self.tor_label.show()
         self.progressbar.setStyleSheet(
             'QProgressBar::chunk {{ background-color: {}; }}'.format(
                 TOR_PURPLE))
     else:
         use_tor = False
     self.update_progress("Verifying invitation...")  # 1
     self.invite_receiver = InviteReceiver(self.gateways, use_tor)
     self.invite_receiver.got_welcome.connect(self.got_welcome)
     self.invite_receiver.got_message.connect(self.got_message)
     self.invite_receiver.grid_already_joined.connect(
         self.on_grid_already_joined)
     self.invite_receiver.update_progress.connect(self.update_progress)
     self.invite_receiver.got_icon.connect(self.on_got_icon)
     self.invite_receiver.joined_folders.connect(self.set_joined_folders)
     self.invite_receiver.done.connect(self.on_done)
     d = self.invite_receiver.receive(code)
     d.addErrback(self.handle_failure)
     reactor.callLater(30, d.cancel)
Пример #2
0
 def go(self, code, settings=None):
     if self.tor_checkbox.isChecked():
         self.use_tor = True
         self.page_2.tor_label.show()
         self.progressbar.setStyleSheet(
             "QProgressBar::chunk {{ background-color: {}; }}".format(
                 TOR_PURPLE))
     self.setCurrentIndex(1)
     self.progressbar.setValue(1)
     self.update_progress("Verifying invitation code...")
     invite_receiver = InviteReceiver(self.known_gateways, self.use_tor)
     invite_receiver.grid_already_joined.connect(self.on_already_joined)
     invite_receiver.update_progress.connect(self.update_progress)
     invite_receiver.got_icon.connect(self.load_service_icon)
     invite_receiver.client_started.connect(
         lambda gateway: self.gui.populate([gateway]))
     invite_receiver.done.connect(self.on_done)
     d = invite_receiver.receive(code, settings)
     d.addErrback(self.handle_failure)
     reactor.callLater(30, d.cancel)