Ejemplo n.º 1
0
class ClientMain:
   def __init__(self, event_dispatcher, sock_AF, sock_path):
      self.event_dispatcher = event_dispatcher
      self.sock_AF = sock_AF
      self.sock_path = sock_path
      self.connection_init()
      
      self.main_window = main_window = QMainWindow()
      self.main_window.show()
      self.main_window.setWindowIcon(QIcon("/usr/share/icons/nuvola/128x128/filesystems/network.png")) # FIXME: put this somewhere liasis-specific
      self.ui = Ui_main_window()
      self.ui.setupUi(main_window)
      self.tlm = TorrentListModel()
      self.ui.torrent_list.setModel(self.tlm)

   def connection_init(self):
      self.sock = self.event_dispatcher.BTCCGQT(self)
      self.sock.connection_init(self.sock_path, self.sock_AF)
      self.sock.data_update()

   @classmethod
   def run_standalone(cls, *args):
      """Execute this client in a blocking fashion"""
      qtapp = QApplication(sys.argv)
      ed = EventDispatcherQT()
      cm = cls(ed, *args)
      
      ed.event_loop(qtapp)
Ejemplo n.º 2
0
 def __init__(self, event_dispatcher, sock_AF, sock_path):
    self.event_dispatcher = event_dispatcher
    self.sock_AF = sock_AF
    self.sock_path = sock_path
    self.connection_init()
    
    self.main_window = main_window = QMainWindow()
    self.main_window.show()
    self.main_window.setWindowIcon(QIcon("/usr/share/icons/nuvola/128x128/filesystems/network.png")) # FIXME: put this somewhere liasis-specific
    self.ui = Ui_main_window()
    self.ui.setupUi(main_window)
    self.tlm = TorrentListModel()
    self.ui.torrent_list.setModel(self.tlm)