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

📄 regdialog.py

📁 ABC-win32-v3.1 一个P2P软源代码
💻 PY
字号:
#########################################################################
# Author : Tim Tucker
# Description : Ask whether or not to associate ABC with torrents
#########################################################################
import wx
from os import path


################################################################
#
# Class: RegCheckDialog
#
# Prompts to associate ABC with .torrent files if it is not
# already associated with them
#
################################################################
class RegCheckDialog(wx.Dialog):
    def __init__(self, parent):
        self.utility = parent.utility
        
        title = self.utility.lang.get('associate')
        
        pre = wx.PreDialog()
        pre.Create(parent, -1, title)
        self.this = pre.this

        outerbox = wx.BoxSizer( wx.VERTICAL )

        outerbox.Add(wx.StaticText(self, -1,  self.utility.lang.get('notassociated')), 0, wx.ALIGN_LEFT|wx.ALL, 5)
               
        self.yesbtn = wx.Button(self, -1, self.utility.lang.get('yes'))
        self.Bind(wx.EVT_BUTTON, self.onYES, self.yesbtn)
        
        self.nobtn = wx.Button(self, -1, self.utility.lang.get('no'))
        self.Bind(wx.EVT_BUTTON, self.onNO, self.nobtn)
        
        self.cancelbtn = wx.Button(self, wx.ID_CANCEL, self.utility.lang.get('cancel'))

        buttonbox = wx.BoxSizer( wx.HORIZONTAL )
        buttonbox.Add(self.yesbtn, 0, wx.ALL, 5)
        buttonbox.Add(self.nobtn, 0, wx.ALL, 5)
        buttonbox.Add(self.cancelbtn, 0, wx.ALL, 5)

        outerbox.Add( buttonbox, 0, wx.ALIGN_CENTER)

        self.SetAutoLayout( True )
        self.SetSizer( outerbox )
        self.Fit()
        
    def onYES(self, event = None):
        self.apply(True)
        self.EndModal(wx.ID_YES)
        
    def onNO(self, event = None):
        self.apply(False)
        self.EndModal(wx.ID_NO)
        
    def apply(self, register):
        self.utility.regchecker.updateRegistry(register)
        
        self.utility.config.Write('associate', register, "boolean")
        self.utility.config.Flush()

⌨️ 快捷键说明

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