Example #1
0
 def downloadMap(self, link):
     link = urllib2.unquote(link)
     name = maps.link2name(link)
     if not maps.isMapAvailable(name):
         maps.downloadMap(name)  
         maps.existMaps(True)
     else:
         show = QtGui.QMessageBox.question(self.client, "Already got the Map", "Seems like you already have that map!<br/><b>Would you like to see it?</b>", QtGui.QMessageBox.Yes, QtGui.QMessageBox.No)
         if show == QtGui.QMessageBox.Yes:
             util.showInExplorer(maps.folderForMap(name))
Example #2
0
 def downloadMap(self, link):
     link = urllib2.unquote(link)
     name = maps.link2name(link)
     if not maps.isMapAvailable(name):
         maps.downloadMap(name)
         maps.existMaps(True)
     else:
         show = QtGui.QMessageBox.question(
             self.client, "Already got the Map",
             "Seems like you already have that map!<br/><b>Would you like to see it?</b>",
             QtGui.QMessageBox.Yes, QtGui.QMessageBox.No)
         if show == QtGui.QMessageBox.Yes:
             util.showInExplorer(maps.folderForMap(name))
Example #3
0
    def myTreePressed(self, item):
        if QtGui.QApplication.mouseButtons() != QtCore.Qt.RightButton:
            return

        if item.isDisabled():
            return

        if self.myTree.indexOfTopLevelItem(item) != -1:
            return

        menu = QtGui.QMenu(self.myTree)

        # Actions for Games and Replays
        actionReplay = QtGui.QAction("Replay", menu)
        actionExplorer = QtGui.QAction("Show in Explorer", menu)

        # Adding to menu
        menu.addAction(actionReplay)
        menu.addAction(actionExplorer)

        # Triggers
        actionReplay.triggered.connect(
            lambda: self.myTreeDoubleClicked(item, 0))
        actionExplorer.triggered.connect(
            lambda: util.showInExplorer(item.filename))

        # Adding to menu
        menu.addAction(actionReplay)
        menu.addAction(actionExplorer)

        #Finally: Show the popup
        menu.popup(QtGui.QCursor.pos())
Example #4
0
    def myTreePressed(self, item):
        if QtGui.QApplication.mouseButtons() != QtCore.Qt.RightButton:
            return
                    
        if item.isDisabled():
            return

        if self.myTree.indexOfTopLevelItem(item) != -1:
            return
        
        menu = QtGui.QMenu(self.myTree)
        
        # Actions for Games and Replays
        actionReplay = QtGui.QAction("Replay", menu)
        actionExplorer = QtGui.QAction("Show in Explorer", menu)
        
        # Adding to menu
        menu.addAction(actionReplay)
        menu.addAction(actionExplorer)
            
        # Triggers
        actionReplay.triggered.connect(lambda : self.myTreeDoubleClicked(item, 0))
        actionExplorer.triggered.connect(lambda : util.showInExplorer(item.filename))
      
        # Adding to menu
        menu.addAction(actionReplay)
        menu.addAction(actionExplorer)

        #Finally: Show the popup
        menu.popup(QtGui.QCursor.pos())