예제 #1
0
class SuperPeerListWindow(HIGWindow):
    def __init__(self):
        HIGWindow.__init__(self, type=gtk.WINDOW_TOPLEVEL)
        self.set_title(_('Super Peers List'))
        self.set_position(gtk.WIN_POS_CENTER_ALWAYS)

        self.__create_widgets()
        self.__pack_widgets()
        self.__load_super_peers()

    def __create_widgets(self):
        self.main_vbox = HIGVBox()
        self.add(self.main_vbox)
        self.btn_box = gtk.HButtonBox()
        self.ok_button = gtk.Button(stock=gtk.STOCK_SAVE)
        self.ok_button.connect('clicked', lambda x: self.__save_super_peers())
        self.cancel_button = gtk.Button(stock=gtk.STOCK_CANCEL)
        self.cancel_button.connect('clicked', lambda x: self.destroy())

        self.SuperPeersBox_vbox = HIGVBox()
        self.SuperPeersBox_hbox1 = HIGHBox()
        self.SuperPeersBox_hbox2 = HIGHBox()
        self.SuperPeersBox_subbox = SuperPeersBox()
        self.SuperPeersBox_hbox1.add(self.SuperPeersBox_subbox)

    def __pack_widgets(self):
        self.main_vbox._pack_expand_fill(self.SuperPeersBox_hbox1)

        self.btn_box.set_layout(gtk.BUTTONBOX_END)
        self.btn_box.set_spacing(3)
        self.btn_box.pack_start(self.ok_button)
        self.btn_box.pack_start(self.cancel_button)
        self.main_vbox.pack_start(self.btn_box)
        self.main_vbox.set_border_width(8)

        self.SuperPeersBox_vbox.pack_start(self.SuperPeersBox_hbox1, True,
                                           True, 5)
        self.SuperPeersBox_vbox.pack_start(self.SuperPeersBox_hbox2, True,
                                           True, 5)

    def __save_super_peers(self):
        self.destroy()

    def __load_super_peers(self):
        text = ""
        for peer_entry in theApp.peer_manager.super_peers.values():
            text = text + "%s:%d\n" % (peer_entry.IP, peer_entry.Port)
        self.SuperPeersBox_subbox.textbuffer.set_text(text)
class  SuperPeerListWindow(HIGWindow):
    def __init__(self):
        HIGWindow.__init__(self, type=gtk.WINDOW_TOPLEVEL)
        self.set_title(_('Super Peers List'))
        self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
        
        self.__create_widgets()
        self.__pack_widgets()
        self.__load_super_peers()

    def __create_widgets(self):
        self.main_vbox = HIGVBox()
        self.add(self.main_vbox)
        self.btn_box = gtk.HButtonBox()
        self.ok_button = gtk.Button(stock=gtk.STOCK_SAVE)
        self.ok_button.connect('clicked', lambda x: self.__save_super_peers())
        self.cancel_button = gtk.Button(stock=gtk.STOCK_CANCEL)
        self.cancel_button.connect('clicked', lambda x: self.destroy())

        self.SuperPeersBox_vbox = HIGVBox()
        self.SuperPeersBox_hbox1 = HIGHBox()
        self.SuperPeersBox_hbox2 = HIGHBox()
        self.SuperPeersBox_subbox = SuperPeersBox()
        self.SuperPeersBox_hbox1.add(self.SuperPeersBox_subbox)

    def __pack_widgets(self):
        self.main_vbox._pack_expand_fill(self.SuperPeersBox_hbox1)

        self.btn_box.set_layout(gtk.BUTTONBOX_END)
        self.btn_box.set_spacing(3)
        self.btn_box.pack_start(self.ok_button)
        self.btn_box.pack_start(self.cancel_button)
        self.main_vbox.pack_start(self.btn_box)
        self.main_vbox.set_border_width(8)

        self.SuperPeersBox_vbox.pack_start(self.SuperPeersBox_hbox1, True, True, 5)
        self.SuperPeersBox_vbox.pack_start(self.SuperPeersBox_hbox2, True, True, 5)

    def __save_super_peers(self):
        self.destroy()

    def __load_super_peers(self):
        text = ""
        for peer_entry in theApp.peer_manager.super_peers.values():
            text = text + "%s:%d\n" % (peer_entry.IP, peer_entry.Port)
        self.SuperPeersBox_subbox.textbuffer.set_text(text)
예제 #3
0
class TestPage(HIGVBox):
    """"""

    #----------------------------------------------------------------------
    def __init__(self):
        """Constructor"""
        HIGVBox.__init__(self)
        self.__create_widgets()
        self.__pack_widgets()

    def __create_widgets(self):
        self.hbox1 = HIGHBox()
        self.hbox2 = HIGHBox()
        self.subbox = Tests()
        self.hbox1.add(self.subbox)
        self.checkbtn = gtk.CheckButton(_("Update tests module automatically"))
        self.checkbtn_throttled = gtk.CheckButton(
            _("Load HTTP Throttled Test"))

    def __pack_widgets(self):
        #self.tests_hbox.set_border_width(12)
        self.pack_start(self.hbox1, True, True, 5)
        self.pack_start(self.hbox2, True, True, 5)

        self.checkbtn.set_border_width(8)
        self.checkbtn_throttled.set_border_width(8)
        self.hbox2.add(self.checkbtn)
        self.hbox2.add(self.checkbtn_throttled)
예제 #4
0
class TestPage(HIGVBox):
    """"""

    #----------------------------------------------------------------------
    def __init__(self):
        """Constructor"""
        HIGVBox.__init__(self)
        self.__create_widgets()
        self.__pack_widgets()

    def __create_widgets(self):
        self.hbox1 = HIGHBox()
        self.hbox2 = HIGHBox()
        self.subbox = Tests()
        self.hbox1.add(self.subbox)
        self.checkbtn = gtk.CheckButton(_("Update tests module automatically"))
        self.checkbtn_throttled = gtk.CheckButton(_("Load HTTP Throttled Test"))

    def __pack_widgets(self):
        #self.tests_hbox.set_border_width(12)
        self.pack_start(self.hbox1, True, True, 5)
        self.pack_start(self.hbox2, True, True, 5)

        self.checkbtn.set_border_width(8)
        self.checkbtn_throttled.set_border_width(8)
        self.hbox2.add(self.checkbtn)
        self.hbox2.add(self.checkbtn_throttled)