Exemplo n.º 1
0
    def __init__(self, client, *args, **kwargs):
        
        BaseClass.__init__(self, *args, **kwargs)        
        
        self.setupUi(self)

        self.client = client
        self.client.coopTab.layout().addWidget(self)
        
        #Dictionary containing our actual games.
        self.games = {}
        
        #Ranked search UI
        self.ispassworded = False
        self.loaded = False
        
        self.coop = {}
        self.cooptypes = {}
        
        self.canChooseMap = False
        self.options = []
        
        self.client.showCoop.connect(self.coopChanged)
        self.client.coopInfo.connect(self.processCoopInfo)
        self.client.gameInfo.connect(self.processGameInfo)
        self.coopList.header().setResizeMode(0, QtGui.QHeaderView.ResizeToContents)
        self.coopList.setItemDelegate(CoopMapItemDelegate(self))
        
        
        self.gameList.setItemDelegate(GameItemDelegate(self))
        self.gameList.itemDoubleClicked.connect(self.gameDoubleClicked)

        self.coopList.itemDoubleClicked.connect(self.coopListDoubleClicked)
        self.coopList.itemClicked.connect(self.coopListClicked)
        
        self.client.coopLeaderBoard.connect(self.processLeaderBoardInfos)
        self.tabLeaderWidget.currentChanged.connect(self.askLeaderBoard)
        
        self.linkButton.clicked.connect(self.linkVanilla)
        #Load game name from settings (yay, it's persistent!)        
        self.loadGameName()
        self.loadPassword()
        self.leaderBoard.setVisible(0)
        self.stylesheet              = util.readstylesheet("coop/formatters/style.css")
        self.FORMATTER_LADDER        = unicode(util.readfile("coop/formatters/ladder.qthtml"))
        self.FORMATTER_LADDER_HEADER = unicode(util.readfile("coop/formatters/ladder_header.qthtml"))

        self.leaderBoard.setStyleSheet(self.stylesheet)
        
        self.leaderBoardTextGeneral.anchorClicked.connect(self.openUrl)
        self.leaderBoardTextOne.anchorClicked.connect(self.openUrl)
        self.leaderBoardTextTwo.anchorClicked.connect(self.openUrl)
        self.leaderBoardTextThree.anchorClicked.connect(self.openUrl)
        self.leaderBoardTextFour.anchorClicked.connect(self.openUrl)

        self.replayDownload = QNetworkAccessManager()
        self.replayDownload.finished.connect(self.finishRequest)

    
        self.selectedItem = None
Exemplo n.º 2
0
    def __init__(self, client, *args, **kwargs):
        BaseClass.__init__(self, *args, **kwargs)        
        
        self.setupUi(self)

        self.client = client
        self.client.tourneyTab.layout().addWidget(self)
        
        #tournament server
        self.tourneyServer = secondaryServer.SecondaryServer("Tournament", 11001, self)
        self.tourneyServer.setInvisible()

        #Dictionary containing our actual tournaments.
        self.tourneys = {}
  
        self.tourneyList.setItemDelegate(TourneyItemDelegate(self))
        
        self.tourneyList.itemDoubleClicked.connect(self.tourneyDoubleClicked)
        
        self.tourneysTab = {}

        #Special stylesheet       
        self.setStyleSheet(util.readstylesheet("tournaments/formatters/style.css"))

        self.updateTimer = QtCore.QTimer(self)
        self.updateTimer.timeout.connect(self.updateTournaments)
        self.updateTimer.start(600000)
Exemplo n.º 3
0
    def __init__(self, client, *args, **kwargs):
        BaseClass.__init__(self, *args, **kwargs)

        self.setupUi(self)

        self.client = client
        self.client.tourneyTab.layout().addWidget(self)

        #tournament server
        self.tourneyServer = secondaryServer.SecondaryServer(
            "Tournament", 11001, self)
        self.tourneyServer.setInvisible()

        #Dictionary containing our actual tournaments.
        self.tourneys = {}

        self.tourneyList.setItemDelegate(TourneyItemDelegate(self))

        self.tourneyList.itemDoubleClicked.connect(self.tourneyDoubleClicked)

        self.tourneysTab = {}

        #Special stylesheet
        self.setStyleSheet(
            util.readstylesheet("tournaments/formatters/style.css"))

        self.updateTimer = QtCore.QTimer(self)
        self.updateTimer.timeout.connect(self.updateTournaments)
        self.updateTimer.start(600000)
Exemplo n.º 4
0
 def handle_logged_in(self, message):
    
     self.handle_player_info(message)
     if self.faction != None :
         self.client.galacticwarTab.setStyleSheet(util.readstylesheet("galacticwar/galacticwar.css").replace("%FACTION%", FACTIONS[self.faction]))   
         
     self.attacksUpdated.emit()
Exemplo n.º 5
0
    def __init__(self, client, *args, **kwargs):

        BaseClass.__init__(self, *args, **kwargs)

        self.setupUi(self)

        self.client = client
        self.client.coopTab.layout().addWidget(self)

        #Dictionary containing our actual games.
        self.games = {}

        #Ranked search UI
        self.ispassworded = False
        self.loaded = False

        self.coop = {}
        self.cooptypes = {}

        self.canChooseMap = False
        self.options = []

        self.client.showCoop.connect(self.coopChanged)
        self.client.coopInfo.connect(self.processCoopInfo)
        self.client.gameInfo.connect(self.processGameInfo)
        self.coopList.header().setResizeMode(
            0, QtGui.QHeaderView.ResizeToContents)
        self.coopList.setItemDelegate(CoopMapItemDelegate(self))

        self.gameList.setItemDelegate(GameItemDelegate(self))
        self.gameList.itemDoubleClicked.connect(self.gameDoubleClicked)

        self.coopList.itemDoubleClicked.connect(self.coopListDoubleClicked)
        self.coopList.itemClicked.connect(self.coopListClicked)

        self.client.coopLeaderBoard.connect(self.processLeaderBoardInfos)
        self.tabLeaderWidget.currentChanged.connect(self.askLeaderBoard)

        self.linkButton.clicked.connect(self.linkVanilla)
        #Load game name from settings (yay, it's persistent!)
        self.load_last_hosted_settings()
        self.leaderBoard.setVisible(0)
        self.stylesheet = util.readstylesheet("coop/formatters/style.css")
        self.FORMATTER_LADDER = unicode(
            util.readfile("coop/formatters/ladder.qthtml"))
        self.FORMATTER_LADDER_HEADER = unicode(
            util.readfile("coop/formatters/ladder_header.qthtml"))

        self.leaderBoard.setStyleSheet(self.stylesheet)

        self.leaderBoardTextGeneral.anchorClicked.connect(self.openUrl)
        self.leaderBoardTextOne.anchorClicked.connect(self.openUrl)
        self.leaderBoardTextTwo.anchorClicked.connect(self.openUrl)
        self.leaderBoardTextThree.anchorClicked.connect(self.openUrl)
        self.leaderBoardTextFour.anchorClicked.connect(self.openUrl)

        self.replayDownload = QNetworkAccessManager()
        self.replayDownload.finished.connect(self.finishRequest)

        self.selectedItem = None
Exemplo n.º 6
0
    def handle_logged_in(self, message):

        self.handle_player_info(message)
        if self.faction != None:
            self.client.galacticwarTab.setStyleSheet(
                util.readstylesheet("galacticwar/galacticwar.css").replace(
                    "%FACTION%", FACTIONS[self.faction]))

        self.attacksUpdated.emit()
Exemplo n.º 7
0
    def __init__(self, client):
        super(BaseClass, self).__init__()

        self.setupUi(self)

        self.client = client
        client.ladderTab.layout().addWidget(self)

        self.client.statsInfo.connect(self.processStatsInfos)

        self.client = client

        self.webview = QtWebKit.QWebView()

        self.LadderRatings.layout().addWidget(self.webview)

        self.loaded = False
        self.client.showLadder.connect(self.updating)
        self.webview.loadFinished.connect(self.webview.show)
        self.leagues.currentChanged.connect(self.leagueUpdate)
        self.pagesDivisions = {}
        self.pagesDivisionsResults = {}
        self.pagesAllLeagues = {}

        self.floodtimer = time.time()

        self.currentLeague = 0
        self.currentDivision = 0

        self.FORMATTER_LADDER = unicode(
            util.readfile("stats/formatters/ladder.qthtml"))
        self.FORMATTER_LADDER_HEADER = unicode(
            util.readfile("stats/formatters/ladder_header.qthtml"))
        self.stylesheet = util.readstylesheet("stats/formatters/style.css")

        self.leagues.setStyleSheet(self.stylesheet)

        #setup other tabs
        self.mapstat = mapstat.LadderMapStat(self.client, self)
Exemplo n.º 8
0
    def __init__(self, client):
        super(BaseClass, self).__init__()

        self.setupUi(self)

        self.client = client
        client.ladderTab.layout().addWidget(self)
        
        self.client.statsInfo.connect(self.processStatsInfos)

        self.client = client

        self.webview = QtWebKit.QWebView()
        
        self.globalTab.layout().addWidget(self.webview)
        
        self.loaded = False
        self.client.showLadder.connect(self.updating)
        self.webview.loadFinished.connect(self.webview.show)
        self.leagues.currentChanged.connect(self.leagueUpdate)
        self.pagesDivisions = {}
        self.pagesDivisionsResults = {}
        self.pagesAllLeagues = {}
        
        self.floodtimer = time.time()
        
        self.currentLeague = 0
        self.currentDivision = 0
        
        self.FORMATTER_LADDER        = unicode(util.readfile("stats/formatters/ladder.qthtml"))
        self.FORMATTER_LADDER_HEADER = unicode(util.readfile("stats/formatters/ladder_header.qthtml"))
        self.stylesheet              = util.readstylesheet("stats/formatters/style.css")

        self.leagues.setStyleSheet(self.stylesheet)
    
   
        #setup other tabs
        self.mapstat = mapstat.LadderMapStat(self.client, self)