示例#1
0
        def __init__(self):
                super(GameRoomPanel, self).__init__()
                layout = QVBoxLayout(self)
                layout.setAlignment(Qt.AlignTop)

                self.gameName = QLineEdit()
                self.gameName.setAlignment(Qt.AlignCenter)
                self.gameName.setFrame(False)
                self.gameName.setPlaceholderText('Game Name')
                self.gameName.setFocusPolicy(Qt.ClickFocus)
                layout.addWidget(self.gameName)

                self.playerList = PlayerList()
                layout.addWidget(self.playerList)
示例#2
0
文件: shop.py 项目: wushin/manachat
def init(config):
    for cmd, action in shop_commands.items():
        chatbot.add_command(cmd, action)

    global trade_timeout
    global shop_admins

    trade_timeout = config.getint('shop', 'timeout')

    shop_admins_file = config.get('shop', 'admins_file')
    if os.path.isfile(shop_admins_file):
        shop_admins = PlayerList(shop_admins_file)

    load_shop_list(config)
    logicmanager.logic_manager.add_logic(shop_logic)
示例#3
0
 def slotPlayers(self):
     """show the player list"""
     if not self.playerWindow:
         self.playerWindow = PlayerList(self)
     self.playerWindow.show()
示例#4
0
 def __init__(self):
     """
     Constructor
     """
     gtk.VBox.__init__(self)
     
     fm = FileManager()
     config = fm.getConfiguration()
     
     if cfgvalues.BASIC_FILTER == config[cfgkey.OPT_FILTER]:        
         self.filter = ServerListFilter(self)
     else:
         self.filter = AdvancedFilter(self)
     self.filter.show()
     
     self.pack_start(self.filter, False, False)
     
    
     
     # top pane area 
     paned = gtk.VPaned() 
     paned.show()
     self.pack_start(paned)   
     
     # bottom add a statusbar
     self.statusbar = StatusBar(self)
     self.pack_start(self.statusbar, False, False)
     
     
     # serverlist window
     self.serverlist = ServerList(self)
     paned.pack1(self.serverlist, True, False)
     #paned.add1(self.serverlist)
     
     
     # bottom panearea
     bottompane = gtk.HPaned()
     paned.pack2(bottompane, True, False)
     #paned.add2(bottompane)
     
     #left box
     self.playerlist = PlayerList()
     bottompane.pack1(self.playerlist, False, False)
     
     
     
     #right box
     self.detailsbox = ServerDetailBox()
     vbox = gtk.VBox()
     
     
     bottompane.pack2(vbox, True, False)
     
   
     buttonbox = gtk.HBox()
     
     #self.detailsbox.pack_start(buttonbox, False, False)
     vbox.pack_start(buttonbox, False, False)
     vbox.pack_start(self.detailsbox)
     
     
     refresh_button = gtk.Button('Refresh')
     refreshimage = gtk.Image()
     refreshimage.set_from_stock(gtk.STOCK_REFRESH, gtk.ICON_SIZE_BUTTON)
     refresh_button.set_image(refreshimage)
     
     connect_button = gtk.Button('Connect')
     connectimage = gtk.Image()
     connectimage.set_from_stock(gtk.STOCK_CONNECT, gtk.ICON_SIZE_BUTTON)
     connect_button.set_image(connectimage)
     
     addfav_button = gtk.Button('Add to Favorites')
     favimage = gtk.Image()
     favimage.set_from_stock(gtk.STOCK_ADD, gtk.ICON_SIZE_BUTTON)
     addfav_button.set_image(favimage)
     
     
     buttonbox.pack_start(refresh_button, True, True)
     buttonbox.pack_start(connect_button, True, True)
     buttonbox.pack_start(addfav_button, True, True)
     refresh_button.connect("clicked", self.onRefreshButtonClicked)
     addfav_button.connect("clicked", self.onAddFavButtonClicked)
     connect_button.connect("clicked", self.connect_button_clicked)
     
     self.show_all()
示例#5
0
    def __init__(self):
        """
        Constructor
        """
        gtk.VBox.__init__(self)

        self.filter = RecentSeversFilter()
        self.filter.show()
        self.pack_start(self.filter, False, False)

        # top pane area
        paned = gtk.VPaned()
        paned.show()
        self.pack_start(paned)

        # bottom add a statusbar
        self.statusbar = StatusBar(self)
        self.pack_start(self.statusbar, False, False)

        # serverlist window
        self.serverlist = RecentServersList(self)
        paned.pack1(self.serverlist, True, False)
        #paned.add1(self.serverlist)

        # bottom panearea
        bottompane = gtk.HPaned()
        paned.pack2(bottompane, True, False)
        #paned.add2(bottompane)

        #left box
        self.playerlist = PlayerList()
        bottompane.pack1(self.playerlist, False, False)

        #right box
        self.detailsbox = ServerDetailBox()
        vbox = gtk.VBox()
        bottompane.pack2(vbox, True, False)

        buttonbox = gtk.HBox()
        vbox.pack_start(buttonbox, False, False)
        vbox.pack_start(self.detailsbox)

        refresh_button = gtk.Button('Refresh')
        refreshimage = gtk.Image()
        refreshimage.set_from_stock(gtk.STOCK_REFRESH, gtk.ICON_SIZE_BUTTON)
        refresh_button.set_image(refreshimage)

        connect_button = gtk.Button('Connect')
        connectimage = gtk.Image()
        connectimage.set_from_stock(gtk.STOCK_CONNECT, gtk.ICON_SIZE_BUTTON)
        connect_button.set_image(connectimage)

        addfav_button = gtk.Button('Add to Favorites')
        favimage = gtk.Image()
        favimage.set_from_stock(gtk.STOCK_ADD, gtk.ICON_SIZE_BUTTON)
        addfav_button.set_image(favimage)

        removerecent_button = gtk.Button('Remove Server from List')
        removeimage = gtk.Image()
        removeimage.set_from_stock(gtk.STOCK_DELETE, gtk.ICON_SIZE_BUTTON)
        removerecent_button.set_image(removeimage)

        buttonbox.pack_start(refresh_button, True, True)
        buttonbox.pack_start(connect_button, True, True)
        buttonbox.pack_start(addfav_button, True, True)
        buttonbox.pack_start(removerecent_button, True, True)

        refresh_button.connect("clicked", self.onRefreshButtonClicked)
        connect_button.connect("clicked", self.connect_button_clicked)
        removerecent_button.connect("clicked", self.onRemoveRecentClicked)
        addfav_button.connect("clicked", self.onAddFavButtonClicked)

        self.show_all()