Ejemplo n.º 1
0
    def _create_applications(self):
        """Creates all application classes that the MainLoop coordinates.  This does NOT start them-
    that's done later.
    WARNING: the gui assumes the apps exist!
    """
        #create the Bank application:
        Bank.start()
        self.bankApp = Bank.get()
        #create the Tor application:
        Tor.start()
        self.torApp = Tor.get()

        #create the pseudo applications for InnomiNet
        BitBlinder.start(self.torApp, self.bankApp)
        self.bbApp = BitBlinder.get()
        #create the applications:
        BitTorrentClient.start(self.torApp)
        self.btApp = BitTorrentClient.get()
        self.bbApp.add_application(self.btApp)
        if System.IS_WINDOWS:
            FirefoxPortable.start(self.torApp)
            self.ffApp = FirefoxPortable.get()
            self.bbApp.add_application(self.ffApp)

        self.gui.on_applications_created(self.bankApp, self.torApp, self.bbApp,
                                         self.btApp, self.ffApp)
Ejemplo n.º 2
0
 def _create_applications(self):
   """Creates all application classes that the MainLoop coordinates.  This does NOT start them-
   that's done later.
   WARNING: the gui assumes the apps exist!
   """
   #create the Bank application:
   Bank.start()
   self.bankApp = Bank.get()
   #create the Tor application:
   Tor.start()
   self.torApp = Tor.get()
   
   #create the pseudo applications for InnomiNet
   BitBlinder.start(self.torApp, self.bankApp)
   self.bbApp = BitBlinder.get()
   #create the applications:
   BitTorrentClient.start(self.torApp)
   self.btApp = BitTorrentClient.get()
   self.bbApp.add_application(self.btApp)
   if System.IS_WINDOWS:
     FirefoxPortable.start(self.torApp)
     self.ffApp = FirefoxPortable.get()
     self.bbApp.add_application(self.ffApp)
   
   self.gui.on_applications_created(self.bankApp, self.torApp, self.bbApp, self.btApp, self.ffApp)
Ejemplo n.º 3
0
 def create_file_menu(self):
   self.fileMenu = gtk.Menu()
   self.fileMenuRoot = gtk.MenuItem("File")
   
   def make_toggle_app_entry(app, is_running_func, toggle_func, name, stopEvent, startEvent):
     menuItem = GTKUtils.append_menu_item(self.fileMenu, " ", toggle_func)
     def on_toggled(app):
       if is_running_func():
         menuItem.child.set_text("Stop %s" % (name))
       else:
         menuItem.child.set_text("Start %s" % (name))
     on_toggled(app)
     self._start_listening_for_event(startEvent, app, on_toggled)
     self._start_listening_for_event(stopEvent, app, on_toggled)
     return menuItem
     
   self.serverMenuItem = make_toggle_app_entry(Tor.get(), Tor.get().is_server, 
     self.controller.toggle_relay, "Relay", "server_stopped", "server_started")
   self.bittorrentMenuItem = make_toggle_app_entry(BitTorrentClient.get(), BitTorrentClient.get().is_running, 
     self.controller.toggle_bittorrent, "BitTorrent", "stopped", "started")
   firefox = FirefoxPortable.get()
   if firefox:
     self.firefoxMenuItem = make_toggle_app_entry(firefox, firefox.is_running, 
       self.controller.toggle_firefox, "Browser", "stopped", "started")
   
   self.fileMenu.append(gtk.SeparatorMenuItem())
   GTKUtils.append_menu_item(self.fileMenu, "Update", self.controller.update_check)
   GTKUtils.append_menu_item(self.fileMenu, "Quit", self.controller.quit_cb)
   self.fileMenuRoot.set_submenu(self.fileMenu)
   self.fileMenuRoot.show()
   return self.fileMenu
Ejemplo n.º 4
0
 def launch_bit_twister(self, widget=None):
     """brings up the BT window"""
     #note, this is currently a bit stupid as we have to wait for tor, etc
     BitTorrentClient.get().start()
Ejemplo n.º 5
0
 def launch_bit_twister(self, widget=None):
   """brings up the BT window"""
   #note, this is currently a bit stupid as we have to wait for tor, etc
   BitTorrentClient.get().start()