Example #1
0
    def __init__(self,
                 parent,
                 style,
                 prefix,
                 minid,
                 maxid,
                 exclude=[],
                 rightalign=[],
                 centeralign=[]):
        self.parent = parent
        self.utility = parent.utility
        self.prefix = prefix
        ManagedList.__init__(self, parent, style, prefix, minid, maxid,
                             exclude, rightalign, centeralign)

        self.data = []
        self.lastcolumnsorted, self.reversesort = self.columns.getSortedColumn(
        )
        self.info_dict = {}  # use infohash as the key, used for update
        self.num = self.getMaxNum()  # max num of lines to show
        self.curr_pos = -1

        self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.OnRightClick)
        self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnActivated)
        self.Bind(wx.EVT_LIST_COL_CLICK, self.OnColClick)
        self.Bind(wx.EVT_KEY_DOWN, self.onKeyDown)

        # for search
        self.Bind(wx.EVT_FIND, self.OnFind)
        self.Bind(wx.EVT_FIND_NEXT, self.OnFind)
        self.Bind(wx.EVT_FIND_CLOSE, self.OnFindClose)

        #self.loadList()
        self.DeleteAllItems()
        self.loading()
Example #2
0
    def __init__(self, parent):
        style = wx.LC_REPORT | wx.LC_VRULES | wx.CLIP_CHILDREN

        prefix = 'column'
        minid = 4
        maxid = 26
        exclude = []
        rightalign = [
            COL_PROGRESS, COL_SIZE, COL_DLSPEED, COL_ULSPEED, COL_RATIO,
            COL_PEERPROGRESS, COL_DLSIZE, COL_ULSIZE, COL_TOTALSPEED
        ]

        ManagedList.__init__(self, parent, style, prefix, minid, maxid,
                             exclude, rightalign)

        dragdroplist = FileDropTarget(self.utility)
        self.SetDropTarget(dragdroplist)

        self.lastcolumnsorted = -1
        self.reversesort = False

        self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
        self.Bind(wx.EVT_LIST_COL_CLICK, self.OnColLeftClick)

        self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.OnItemSelected)

        # Bring up advanced details on left double click
        self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDClick)

        # Bring up local settings on middle double click
        self.Bind(wx.EVT_MIDDLE_DCLICK,
                  self.utility.actions[ACTION_LOCALUPLOAD].action)
Example #3
0
File: abc.py Project: WoLpH/tribler
    def __init__(self, parent):
        style = wx.LC_REPORT|wx.LC_VRULES|wx.CLIP_CHILDREN
        
        prefix = 'column'
        minid = 4
        maxid = 26
        exclude = []
        rightalign = [COL_PROGRESS, 
                      COL_SIZE, 
                      COL_DLSPEED, 
                      COL_ULSPEED, 
                      COL_RATIO, 
                      COL_PEERPROGRESS, 
                      COL_DLSIZE, 
                      COL_ULSIZE, 
                      COL_TOTALSPEED]

        ManagedList.__init__(self, parent, style, prefix, minid, maxid, exclude, rightalign)
        
        dragdroplist = FileDropTarget(self.utility)
        self.SetDropTarget(dragdroplist)
        
        self.lastcolumnsorted = -1
        self.reversesort = False

        self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
        self.Bind(wx.EVT_LIST_COL_CLICK, self.OnColLeftClick)

        self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.OnItemSelected)
        
        # Bring up advanced details on left double click
        self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDClick)
        
        # Bring up local settings on middle double click
        self.Bind(wx.EVT_MIDDLE_DCLICK, self.utility.actions[ACTION_LOCALUPLOAD].action)
Example #4
0
    def __init__(self, parent, style, prefix, minid, maxid, exclude = [], rightalign = [], centeralign = []):
        self.parent = parent
        self.utility = parent.utility
        self.prefix = prefix
        ManagedList.__init__(self, parent, style, prefix, minid, maxid, exclude, rightalign, centeralign)
        
        self.data = []
        self.lastcolumnsorted, self.reversesort = self.columns.getSortedColumn()
        self.info_dict = {}            # use infohash as the key, used for update
        self.num = self.getMaxNum()    # max num of lines to show
        self.curr_pos = -1

        self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.OnRightClick)
        self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnActivated)
        self.Bind(wx.EVT_LIST_COL_CLICK, self.OnColClick)
        self.Bind(wx.EVT_KEY_DOWN, self.onKeyDown)
        
        # for search
        self.Bind(wx.EVT_FIND, self.OnFind)
        self.Bind(wx.EVT_FIND_NEXT, self.OnFind)
        self.Bind(wx.EVT_FIND_CLOSE, self.OnFindClose)
        
        #self.loadList()
        self.DeleteAllItems()
        self.loading()
Example #5
0
    def __init__(self, parent):
        style = wx.LC_REPORT

        prefix = 'fileinfo'
        minid = 0
        maxid = 7
        rightalign = [FILEINFO_SIZE, FILEINFO_PROGRESS]
        centeralign = []

        exclude = []

        ManagedList.__init__(self, parent, style, prefix, minid, maxid,
                             exclude, rightalign, centeralign)

        self.torrent = parent.torrent

        self.priorityIDs = [wx.NewId(), wx.NewId(), wx.NewId(), wx.NewId()]
        self.prioritycolors = [
            wx.Colour(160, 160, 160),
            wx.Colour(255, 64, 0),
            wx.Colour(0, 0, 0),
            wx.Colour(64, 64, 255)
        ]

        self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.onItemSelected)
        self.Bind(wx.EVT_LEFT_DCLICK, self.onOpenFileDest)
        self.Bind(wx.EVT_KEY_DOWN, self.onKeyDown)
Example #6
0
    def __init__(self, parent):
        style = wx.LC_REPORT | wx.LC_HRULES | wx.LC_VRULES

        prefix = 'spew'
        minid = 0
        maxid = 14
        rightalign = [
            SPEW_UP, SPEW_DOWN, SPEW_DLSIZE, SPEW_ULSIZE, SPEW_PEERPROGRESS,
            SPEW_PEERSPEED
        ]
        centeralign = [
            SPEW_UNCHOKE, SPEW_LR, SPEW_INTERESTED, SPEW_CHOKING,
            SPEW_INTERESTING, SPEW_CHOKED, SPEW_SNUBBED
        ]

        exclude = []

        ManagedList.__init__(self, parent, style, prefix, minid, maxid,
                             exclude, rightalign, centeralign)
Example #7
0
    def __init__(self, parent):
        style = wx.LC_REPORT|wx.LC_HRULES|wx.LC_VRULES
        
        prefix = 'spew'
        minid = 0
        maxid = 14
        rightalign = [SPEW_UP, 
                      SPEW_DOWN, 
                      SPEW_DLSIZE, 
                      SPEW_ULSIZE, 
                      SPEW_PEERPROGRESS, 
                      SPEW_PEERSPEED]
        centeralign = [SPEW_UNCHOKE, 
                       SPEW_LR, 
                       SPEW_INTERESTED, 
                       SPEW_CHOKING, 
                       SPEW_INTERESTING, 
                       SPEW_CHOKED, 
                       SPEW_SNUBBED]

        exclude = []      

        ManagedList.__init__(self, parent, style, prefix, minid, maxid, exclude, rightalign, centeralign)
Example #8
0
    def __init__(self, parent):        
        style = wx.LC_REPORT
        
        prefix = 'fileinfo'
        minid = 0
        maxid = 7
        rightalign = [FILEINFO_SIZE, FILEINFO_PROGRESS]
        centeralign = []

        exclude = []

        ManagedList.__init__(self, parent, style, prefix, minid, maxid, exclude, rightalign, centeralign)
        
        self.torrent = parent.torrent

        self.priorityIDs = [wx.NewId(), wx.NewId(), wx.NewId(), wx.NewId()]
        self.prioritycolors = [ wx.Colour(160, 160, 160), 
                                wx.Colour(255, 64, 0), 
                                wx.Colour(0, 0, 0), 
                                wx.Colour(64, 64, 255) ]

        self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.onItemSelected)
        self.Bind(wx.EVT_LEFT_DCLICK, self.onOpenFileDest)
        self.Bind(wx.EVT_KEY_DOWN, self.onKeyDown)