⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spinners.py

📁 ABC-win32-v3.1 一个P2P软源代码
💻 PY
字号:
#!/usr/bin/python

#########################################################################
#
# Spinners to control and display information
# 
#########################################################################
import sys
import os
import wx

from ABC.GUI.spinner import ABCSpinner

from Utility.constants import * #IGNORE:W0611
       
    
class NumSimSpinner(ABCSpinner):
    def __init__(self, parent):
        label = 'tb_maxsim'
        
        ABCSpinner.__init__(self, parent, label)
        
        self.changeSpinner()

    def changeSpinner(self, event = None):
        if event is None:
            self.spinner.SetValue(self.utility.config.Read('numsimdownload', "int"))
            self.updateCounter()
            return
            
        currentval = self.utility.config.Read('numsimdownload')
        newval = self.enforceMinMax()
               
        if currentval != newval:
            self.utility.config.Write('numsimdownload', newval)
            self.utility.config.Flush()
            
            if event is not None:
                self.utility.queue.updateAndInvoke()

    def updateCounter(self, event = None):
        proccount = self.utility.queue.getProcCount()
        self.current.SetLabel(str(proccount))
       

#class DownSpinner(ABCSpinner):
#    def __init__(self, parent):
#        # TODO: needs real label
#        label = 'tb_urm'
#        unitlabel = self.utility.lang.get('KB') + "/" + self.utility.lang.get('l_second')
#        
#        ABCSpinner.__init__(self, parent, label, unitlabel)
#        
#        self.changeSpinner()
#        
#    def changeSpinner(self):
#        if event is None:
#            self.spinner.SetRange(0, 9999)
#            self.spinner.SetValue(self.utility.queue.ratemanager.MaxRate("down"))
#            self.current.SetLabel(str(self.utility.queue.totals_kb['down']))
#            return


#class UpSpinner(ABCSpinner):
#    def __init__(self, parent):       
#        # TODO: needs real label
#        label = 'tb_urm'
#        unitlabel = self.utility.lang.get('KB') + "/" + self.utility.lang.get('l_second')
#        
#        ABCSpinner.__init__(self, parent, label, unitlabel)
#        
#        self.changeSpinner()
#        
#    def changeSpinner(self, event = None):
#        if event is None:
#            self.spinner.SetRange(0, 9999)
#            self.spinner.SetValue(self.utility.queue.ratemanager.MaxRate("up"))
#            self.current.SetLabel(str(self.utility.queue.totals_kb['up']))
#            return
#            
#        # Check which upload value we're using
#        # (seeding or downloading)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -