예제 #1
0
 def addServer(self, server):
     """
     Adds a server to the serverlist.
     
     @param server - the server to add
     """
     
     # map needsPassword boolean to a image
     needpw = self.not_locked_pixbuf  # default for don't know 
     if server.needsPassword() != None:
         if server.needsPassword():
             needpw = self.lock_pixbuf
         else:
             needpw = self.not_locked_pixbuf # just leave the cell blank if no pw required
     
     
     flagmanager = FlagManager() 
     flag = flagmanager.get_flag(server.get_location())
     
     self.liststore.append([needpw, flag, server.getName(), server.getaddress()
                         , server.getPing(), server.getPlayerString()
                         , server.getMap(), server.getGameTypeName()
                         , server, server.getConnections(), server.getLastConnect()]) 
     
     # default hardcoded sorting by last connection descending
     self.liststore.set_sort_column_id(10, gtk.SORT_DESCENDING)
     
             
     
예제 #2
0
    def addServer(self, server):
        """
        Adds a server to the serverlist.
        
        @param server - the server to add
        """

        # map needsPassword boolean to a image
        needpw = self.not_locked_pixbuf  # default for don't know
        if server.needsPassword() != None:
            if server.needsPassword():
                needpw = self.lock_pixbuf
            else:
                needpw = self.not_locked_pixbuf  # just leave the cell blank if no pw required

        flagmanager = FlagManager()
        flag = flagmanager.get_flag(server.get_location())

        self.liststore.append([
            needpw, flag,
            server.getName(),
            server.getVersionString(),
            server.getaddress(),
            server.getPing(),
            server.getPlayerString(),
            server.getMap(),
            server.getGameTypeName(), server
        ])

        # default hardcoded sorting by ping ascending
        self.liststore.set_sort_column_id(self.sortcolumn, self.sortorder)
예제 #3
0
    def setServerDetails(self, server):
        """
        Set the details of a certain server.
        
        @param server - the server which data is used to fill
                        the details
        """
        #detailstable
        self.current_server = server
        self.namelabel.set_markup('<b>' +
                                  glib.markup_escape_text(server.getName()) +
                                  '</b>')
        self.addressvaluelabel.set_text(server.getaddress())
        self.mapvaluelabel.set_text(server.getMap())
        self.gametypevaluelabel.set_text(server.getGameTypeName())
        self.playersvaluelabel.set_text(server.getPlayerString())

        self.locationvaluelabel.set_text('  (' + server.get_location() + ') '+\
                                         server.get_location_name())
        flagmanager = FlagManager()
        self.flag.set_from_pixbuf(flagmanager.get_flag(server.get_location()))

        self.pingvaluelabel.set_text(str(server.getPing()))
        if (server.needsPassword()):
            self.passvaluelabel.set_text('Yes')
        else:
            self.passvaluelabel.set_text('No')

        vars = server.getServerVars()
        if 'g_gear' in vars:
            self.geavaluelabel.set_text(vars['g_gear'])

        #server vars treeview
        self.varliststore.clear()

        vars = server.getServerVars()
        if vars:
            for key in vars.iterkeys():
                self.varliststore.append([key, vars[key]])
예제 #4
0
 def setServerDetails(self, server):
     """
     Set the details of a certain server.
     
     @param server - the server which data is used to fill
                     the details
     """
     #detailstable
     self.current_server = server
     self.namelabel.set_markup('<b>' + glib.markup_escape_text(server.getName()) + '</b>')
     self.addressvaluelabel.set_text(server.getaddress())
     self.mapvaluelabel.set_text(server.getMap())
     self.gametypevaluelabel.set_text(server.getGameTypeName())
     self.playersvaluelabel.set_text(server.getPlayerString())
     
     self.locationvaluelabel.set_text('  (' + server.get_location() + ') '+\
                                      server.get_location_name())
     flagmanager = FlagManager()
     self.flag.set_from_pixbuf(flagmanager.get_flag(server.get_location()))
     
     
     self.pingvaluelabel.set_text(str(server.getPing()))
     if(server.needsPassword()):
         self.passvaluelabel.set_text('Yes')
     else: 
         self.passvaluelabel.set_text('No')
     
     vars = server.getServerVars()
     if 'g_gear' in vars:
         self.geavaluelabel.set_text(vars['g_gear'])
     
     #server vars treeview           
     self.varliststore.clear()
     
     vars = server.getServerVars()
     if vars:
         for key in vars.iterkeys():
             self.varliststore.append([key, vars[key]])