wxDialogPreferences.py
上传用户:lswyart
上传日期:2008-06-12
资源大小:3441k
文件大小:79k
源码类别:

杀毒

开发平台:

Visual C++

  1. #-----------------------------------------------------------------------------
  2. #Boa:Dialog:wxPreferencesDlg
  3. #-----------------------------------------------------------------------------
  4. # Name:        wxDialogPreferences.py
  5. # Product:     ClamWin Free Antivirus
  6. #
  7. # Author:      alch [alch at users dot sourceforge dot net]
  8. #
  9. # Created:     2004/19/03
  10. # Copyright:   Copyright alch (c) 2004
  11. # Licence:     
  12. #   This program is free software; you can redistribute it and/or modify
  13. #   it under the terms of the GNU General Public License as published by
  14. #   the Free Software Foundation; either version 2 of the License, or
  15. #   (at your option) any later version.
  16. #   This program is distributed in the hope that it will be useful,
  17. #   but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. #   GNU General Public License for more details.
  20. #   You should have received a copy of the GNU General Public License
  21. #   along with this program; if not, write to the Free Software
  22. #   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23. from wxPython.wx import *
  24. from wxPython.gizmos import *
  25. from wxPython.lib.intctrl import *
  26. from wxPython.lib.timectrl import *
  27. import MsgBox, Utils, EmailAlert, Config
  28. import os, sys, time, locale
  29. import wxDialogScheduledScan
  30. def create(parent, config=None, switchToSchedule=False):
  31.     return wxPreferencesDlg(parent, config, switchToSchedule)
  32.         
  33. [wxID_WXPREFERENCESDLG, wxID_WXPREFERENCESDLGBUTTONBROWSECLAMSCAN, 
  34.  wxID_WXPREFERENCESDLGBUTTONBROWSEFRESHCLAM, 
  35.  wxID_WXPREFERENCESDLGBUTTONBROWSEQUARANTINE, 
  36.  wxID_WXPREFERENCESDLGBUTTONBROWSESCANLOG, 
  37.  wxID_WXPREFERENCESDLGBUTTONBROWSEUPDATELOG, 
  38.  wxID_WXPREFERENCESDLGBUTTONCANCEL, wxID_WXPREFERENCESDLGBUTTONOK, 
  39.  wxID_WXPREFERENCESDLGBUTTONSENDTESTEMAIL, 
  40.  wxID_WXPREFERENCESDLGBUTTONTASKACTIVATE, wxID_WXPREFERENCESDLGBUTTONTASKADD, 
  41.  wxID_WXPREFERENCESDLGBUTTONTASKDEACTIVATE, 
  42.  wxID_WXPREFERENCESDLGBUTTONTASKEDIT, wxID_WXPREFERENCESDLGBUTTONTASKREMOVE, 
  43.  wxID_WXPREFERENCESDLGBUTTONVIRDB, wxID_WXPREFERENCESDLGCHECKBOXCHECKVERSION, 
  44.  wxID_WXPREFERENCESDLGCHECKBOXDETECTBROKEN, 
  45.  wxID_WXPREFERENCESDLGCHECKBOXENABLEAUTOUPDATE, 
  46.  wxID_WXPREFERENCESDLGCHECKBOXENABLEMBOX, 
  47.  wxID_WXPREFERENCESDLGCHECKBOXENABLEOLE2, 
  48.  wxID_WXPREFERENCESDLGCHECKBOXINFECTEDONLY, 
  49.  wxID_WXPREFERENCESDLGCHECKBOXSCANARCHIVES, 
  50.  wxID_WXPREFERENCESDLGCHECKBOXSCANRECURSIVE, 
  51.  wxID_WXPREFERENCESDLGCHECKBOXSMTPENABLE, 
  52.  wxID_WXPREFERENCESDLGCHECKBOXTRAYNOTIFY, 
  53.  wxID_WXPREFERENCESDLGCHECKBOXUPDATELOGON, 
  54.  wxID_WXPREFERENCESDLGCHOICEPRIORITY, wxID_WXPREFERENCESDLGCHOICEUPDATEDAY, 
  55.  wxID_WXPREFERENCESDLGCHOICEUPDATEFREQUENCY, 
  56.  wxID_WXPREFERENCESDLGEDITABLELISTBOXFILTERSEXCLUDE, 
  57.  wxID_WXPREFERENCESDLGEDITABLELISTBOXFILTERSINCLUDE, 
  58.  wxID_WXPREFERENCESDLGINTCTRLPROXYPORT, wxID_WXPREFERENCESDLGINTCTRLSMTPPORT, 
  59.  wxID_WXPREFERENCESDLGLISTVIEWSCHEDULEDTASKS, wxID_WXPREFERENCESDLGNOTEBOOK, 
  60.  wxID_WXPREFERENCESDLGRADIOBUTTONQUARANTINE, 
  61.  wxID_WXPREFERENCESDLGRADIOBUTTONREMOVEINFECTED, 
  62.  wxID_WXPREFERENCESDLGRADIOBUTTONREPORT, 
  63.  wxID_WXPREFERENCESDLGSPINBUTTONUPDATETIME, 
  64.  wxID_WXPREFERENCESDLGSPINCTRLARCHIVEFILES, 
  65.  wxID_WXPREFERENCESDLGSPINCTRLARCHIVESIZE, 
  66.  wxID_WXPREFERENCESDLGSPINCTRLMAXLOGSIZE, 
  67.  wxID_WXPREFERENCESDLGSPINCTRLRECURSION, 
  68.  wxID_WXPREFERENCESDLGSTATICBOXEMAILDETAILS, 
  69.  wxID_WXPREFERENCESDLGSTATICBOXINFECTED, 
  70.  wxID_WXPREFERENCESDLGSTATICBOXSCANOPTIONS, 
  71.  wxID_WXPREFERENCESDLGSTATICBOXSMTPCONNECTION, 
  72.  wxID_WXPREFERENCESDLGSTATICLINEUPDATETIMECTRL, 
  73.  wxID_WXPREFERENCESDLGSTATICTEXT1, wxID_WXPREFERENCESDLGSTATICTEXT2, 
  74.  wxID_WXPREFERENCESDLGSTATICTEXTADDITIONALPARAMS, 
  75.  wxID_WXPREFERENCESDLGSTATICTEXTCLAMSCAN, 
  76.  wxID_WXPREFERENCESDLGSTATICTEXTDBUPDATELOGFILE, 
  77.  wxID_WXPREFERENCESDLGSTATICTEXTEXPLAIN, wxID_WXPREFERENCESDLGSTATICTEXTFILES, 
  78.  wxID_WXPREFERENCESDLGSTATICTEXTFILTERSEXCLUDE, 
  79.  wxID_WXPREFERENCESDLGSTATICTEXTFILTERSINCLUDE, 
  80.  wxID_WXPREFERENCESDLGSTATICTEXTFILTREDESC1, 
  81.  wxID_WXPREFERENCESDLGSTATICTEXTFRESHCLAM, 
  82.  wxID_WXPREFERENCESDLGSTATICTEXTLIMITFILES, 
  83.  wxID_WXPREFERENCESDLGSTATICTEXTLOGFILE, 
  84.  wxID_WXPREFERENCESDLGSTATICTEXTMAXLOGSIZE, 
  85.  wxID_WXPREFERENCESDLGSTATICTEXTMAXSIZE, wxID_WXPREFERENCESDLGSTATICTEXTMB1, 
  86.  wxID_WXPREFERENCESDLGSTATICTEXTMB2, 
  87.  wxID_WXPREFERENCESDLGSTATICTEXTNOPERSONAL, 
  88.  wxID_WXPREFERENCESDLGSTATICTEXTPRIORITY, 
  89.  wxID_WXPREFERENCESDLGSTATICTEXTPROXYHOST, 
  90.  wxID_WXPREFERENCESDLGSTATICTEXTPROXYPASSWORD, 
  91.  wxID_WXPREFERENCESDLGSTATICTEXTPROXYPORT, 
  92.  wxID_WXPREFERENCESDLGSTATICTEXTPROXYUSER, 
  93.  wxID_WXPREFERENCESDLGSTATICTEXTRECURSION, 
  94.  wxID_WXPREFERENCESDLGSTATICTEXTSCHEDULEDTASKS, 
  95.  wxID_WXPREFERENCESDLGSTATICTEXTSMTPFROM, 
  96.  wxID_WXPREFERENCESDLGSTATICTEXTSMTPHOST, 
  97.  wxID_WXPREFERENCESDLGSTATICTEXTSMTPPASSWORD, 
  98.  wxID_WXPREFERENCESDLGSTATICTEXTSMTPPORT, 
  99.  wxID_WXPREFERENCESDLGSTATICTEXTSMTPSUBJECT, 
  100.  wxID_WXPREFERENCESDLGSTATICTEXTSMTPTO, 
  101.  wxID_WXPREFERENCESDLGSTATICTEXTSMTPUSERNAME, 
  102.  wxID_WXPREFERENCESDLGSTATICTEXTSUBARCHIVES, 
  103.  wxID_WXPREFERENCESDLGSTATICTEXTUPDATEDAY, 
  104.  wxID_WXPREFERENCESDLGSTATICTEXTUPDATEFREQUENCY, 
  105.  wxID_WXPREFERENCESDLGSTATICTEXTUPDATETIME, 
  106.  wxID_WXPREFERENCESDLGSTATICTEXTVIRDB, 
  107.  wxID_WXPREFERENCESDLGTEXTCTRLADDITIONALPARAMS, 
  108.  wxID_WXPREFERENCESDLGTEXTCTRLCLAMSCAN, wxID_WXPREFERENCESDLGTEXTCTRLDBMIRROR, 
  109.  wxID_WXPREFERENCESDLGTEXTCTRLFRESHCLAM, 
  110.  wxID_WXPREFERENCESDLGTEXTCTRLPROXYHOST, 
  111.  wxID_WXPREFERENCESDLGTEXTCTRLPROXYPASSWORD, 
  112.  wxID_WXPREFERENCESDLGTEXTCTRLPROXYUSER, 
  113.  wxID_WXPREFERENCESDLGTEXTCTRLQUARANTINE, 
  114.  wxID_WXPREFERENCESDLGTEXTCTRLSCANLOGFILE, 
  115.  wxID_WXPREFERENCESDLGTEXTCTRLSMTPFROM, wxID_WXPREFERENCESDLGTEXTCTRLSMTPHOST, 
  116.  wxID_WXPREFERENCESDLGTEXTCTRLSMTPPASSWORD, 
  117.  wxID_WXPREFERENCESDLGTEXTCTRLSMTPSUBJECT, 
  118.  wxID_WXPREFERENCESDLGTEXTCTRLSMTPTO, wxID_WXPREFERENCESDLGTEXTCTRLSMTPUSER, 
  119.  wxID_WXPREFERENCESDLGTEXTCTRLUPDATELOGFILE, 
  120.  wxID_WXPREFERENCESDLGTEXTCTRLVIRDB, wxID_WXPREFERENCESDLG_PANELADVANCED, 
  121.  wxID_WXPREFERENCESDLG_PANELARCHIVES, wxID_WXPREFERENCESDLG_PANELEMAILALERTS, 
  122.  wxID_WXPREFERENCESDLG_PANELFILES, wxID_WXPREFERENCESDLG_PANELFILTERS, 
  123.  wxID_WXPREFERENCESDLG_PANELINTERNETUPDATE, 
  124.  wxID_WXPREFERENCESDLG_PANELOPTIONS, wxID_WXPREFERENCESDLG_PANELPROXY, 
  125.  wxID_WXPREFERENCESDLG_PANELREPORTS, wxID_WXPREFERENCESDLG_PANELSCHEDULER, 
  126. ] = map(lambda _init_ctrls: wxNewId(), range(112))
  127. class wxPreferencesDlg(wxDialog):
  128.     def _init_coll_imageListScheduler_Images(self, parent):
  129.         # generated method, don't edit
  130.         parent.Add(bitmap=wxBitmap('img/ListScan.png', wxBITMAP_TYPE_PNG),
  131.               mask=wxNullBitmap)
  132.     def _init_coll_notebook_Pages(self, parent):
  133.         # generated method, don't edit
  134.         parent.AddPage(imageId=-1, page=self._panelOptions, select=True,
  135.               text='General')
  136.         parent.AddPage(imageId=-1, page=self._panelFilters, select=False,
  137.               text='Filters')
  138.         parent.AddPage(imageId=-1, page=self._panelInternetUpdate, select=False,
  139.               text='Internet Updates')
  140.         parent.AddPage(imageId=-1, page=self._panelProxy, select=False,
  141.               text='Proxy')
  142.         parent.AddPage(imageId=-1, page=self._panelScheduler, select=False,
  143.               text='Scheduled Scans')
  144.         parent.AddPage(imageId=-1, page=self._panelEmailAlerts, select=False,
  145.               text='Email Alerts')
  146.         parent.AddPage(imageId=-1, page=self._panelArchives, select=False,
  147.               text='Archives')
  148.         parent.AddPage(imageId=-1, page=self._panelFiles, select=False,
  149.               text='File Locations')
  150.         parent.AddPage(imageId=-1, page=self._panelReports, select=False,
  151.               text='Reports')
  152.         parent.AddPage(imageId=-1, page=self._panelAdvanced, select=False,
  153.               text='Advanced')
  154.     def _init_coll_listViewScheduledTasks_Columns(self, parent):
  155.         # generated method, don't edit
  156.         parent.InsertColumn(col=0, format=wxLIST_FORMAT_LEFT,
  157.               heading='Description', width=-1)
  158.         parent.InsertColumn(col=1, format=wxLIST_FORMAT_LEFT, heading='Path',
  159.               width=-1)
  160.         parent.InsertColumn(col=2, format=wxLIST_FORMAT_LEFT,
  161.               heading='Frequency', width=-1)
  162.     def _init_utils(self):
  163.         # generated method, don't edit
  164.         self.imageListScheduler = wxImageList(height=16, width=16)
  165.         self._init_coll_imageListScheduler_Images(self.imageListScheduler)
  166.     def _init_ctrls(self, prnt):
  167.         # generated method, don't edit
  168.         wxDialog.__init__(self, id=wxID_WXPREFERENCESDLG, name='', parent=prnt,
  169.               pos=wxPoint(366, 256), size=wxSize(419, 351),
  170.               style=wxDEFAULT_DIALOG_STYLE, title='ClamWin Preferences')
  171.         self._init_utils()
  172.         self.SetClientSize(wxSize(411, 324))
  173.         self.SetAutoLayout(False)
  174.         self.Center(wxBOTH)
  175.         EVT_CHAR_HOOK(self, self.OnCharHook)
  176.         self.notebook = wxNotebook(id=wxID_WXPREFERENCESDLGNOTEBOOK,
  177.               name='notebook', parent=self, pos=wxPoint(7, 7), size=wxSize(398,
  178.               278), style=wxNB_MULTILINE)
  179.         self.notebook.SetAutoLayout(true)
  180.         self.notebook.SetToolTipString('')
  181.         self._panelOptions = wxPanel(id=wxID_WXPREFERENCESDLG_PANELOPTIONS,
  182.               name='_panelOptions', parent=self.notebook, pos=wxPoint(0, 0),
  183.               size=wxSize(390, 234), style=wxTAB_TRAVERSAL)
  184.         self._panelOptions.SetAutoLayout(False)
  185.         self._panelInternetUpdate = wxPanel(id=wxID_WXPREFERENCESDLG_PANELINTERNETUPDATE,
  186.               name='_panelInternetUpdate', parent=self.notebook, pos=wxPoint(0,
  187.               0), size=wxSize(390, 234), style=wxTAB_TRAVERSAL)
  188.         self._panelInternetUpdate.SetAutoLayout(False)
  189.         self._panelProxy = wxPanel(id=wxID_WXPREFERENCESDLG_PANELPROXY,
  190.               name='_panelProxy', parent=self.notebook, pos=wxPoint(0, 0),
  191.               size=wxSize(390, 234), style=wxTAB_TRAVERSAL)
  192.         self._panelProxy.SetAutoLayout(False)
  193.         self._panelFiles = wxPanel(id=wxID_WXPREFERENCESDLG_PANELFILES,
  194.               name='_panelFiles', parent=self.notebook, pos=wxPoint(0, 0),
  195.               size=wxSize(390, 234), style=wxTAB_TRAVERSAL)
  196.         self._panelFiles.SetAutoLayout(False)
  197.         self._panelArchives = wxPanel(id=wxID_WXPREFERENCESDLG_PANELARCHIVES,
  198.               name='_panelArchives', parent=self.notebook, pos=wxPoint(0, 0),
  199.               size=wxSize(390, 234), style=wxTAB_TRAVERSAL)
  200.         self._panelArchives.SetAutoLayout(False)
  201.         self._panelReports = wxPanel(id=wxID_WXPREFERENCESDLG_PANELREPORTS,
  202.               name='_panelReports', parent=self.notebook, pos=wxPoint(0, 0),
  203.               size=wxSize(390, 234), style=wxTAB_TRAVERSAL)
  204.         self._panelReports.SetAutoLayout(False)
  205.         self._panelAdvanced = wxPanel(id=wxID_WXPREFERENCESDLG_PANELADVANCED,
  206.               name='_panelAdvanced', parent=self.notebook, pos=wxPoint(0, 0),
  207.               size=wxSize(390, 234), style=wxTAB_TRAVERSAL)
  208.         self._panelAdvanced.SetAutoLayout(False)
  209.         self.buttonOK = wxButton(id=wxID_WXPREFERENCESDLGBUTTONOK, label='OK',
  210.               name='buttonOK', parent=self, pos=wxPoint(128, 294),
  211.               size=wxSize(72, 23), style=0)
  212.         self.buttonOK.SetToolTipString('Closes the window and saves the changes')
  213.         self.buttonOK.SetDefault()
  214.         EVT_BUTTON(self.buttonOK, wxID_WXPREFERENCESDLGBUTTONOK, self.OnOK)
  215.         self.buttonCancel = wxButton(id=wxID_WXPREFERENCESDLGBUTTONCANCEL,
  216.               label='Cancel', name='buttonCancel', parent=self, pos=wxPoint(209,
  217.               294), size=wxSize(75, 23), style=0)
  218.         self.buttonCancel.SetToolTipString('Closes the window without saving the changes')
  219.         EVT_BUTTON(self.buttonCancel, wxID_WXPREFERENCESDLGBUTTONCANCEL,
  220.               self.OnCancel)
  221.         self.staticTextProxyHost = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTPROXYHOST,
  222.               label='Proxy &Server:', name='staticTextProxyHost',
  223.               parent=self._panelProxy, pos=wxPoint(6, 61), size=wxSize(80, 15),
  224.               style=0)
  225.         self.textCtrlProxyHost = wxTextCtrl(id=wxID_WXPREFERENCESDLGTEXTCTRLPROXYHOST,
  226.               name='textCtrlProxyHost', parent=self._panelProxy, pos=wxPoint(91,
  227.               57), size=wxSize(199, 21), style=0, value='')
  228.         self.textCtrlProxyHost.SetToolTipString('Proxy Server domain name or IP address')
  229.         self.staticTextProxyPort = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTPROXYPORT,
  230.               label='P&ort:', name='staticTextProxyPort',
  231.               parent=self._panelProxy, pos=wxPoint(296, 61), size=wxSize(34,
  232.               15), style=0)
  233.         self.intCtrlProxyPort = wxIntCtrl(allow_long=False, allow_none=False,
  234.               default_color=wxBLACK, id=wxID_WXPREFERENCESDLGINTCTRLPROXYPORT,
  235.               limited=False, max=65535, min=0, name='intCtrlProxyPort',
  236.               oob_color=wxRED, parent=self._panelProxy, pos=wxPoint(332, 57),
  237.               size=wxSize(54, 21), style=0, value=3128)
  238.         self.intCtrlProxyPort.SetBounds((0, 65535))
  239.         self.intCtrlProxyPort.SetToolTipString('Proxy Server port number (0-65535)')
  240.         self.staticTextProxyUser = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTPROXYUSER,
  241.               label='&User Name:', name='staticTextProxyUser',
  242.               parent=self._panelProxy, pos=wxPoint(6, 97), size=wxSize(80, 15),
  243.               style=0)
  244.         self.textCtrlProxyUser = wxTextCtrl(id=wxID_WXPREFERENCESDLGTEXTCTRLPROXYUSER,
  245.               name='textCtrlProxyUser', parent=self._panelProxy, pos=wxPoint(91,
  246.               93), size=wxSize(295, 21), style=0, value='')
  247.         self.textCtrlProxyUser.SetToolTipString('Proxy Server Account Name (optional)')
  248.         self.staticTextProxyPassword = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTPROXYPASSWORD,
  249.               label='&Password:', name='staticTextProxyPassword',
  250.               parent=self._panelProxy, pos=wxPoint(6, 135), size=wxSize(80, 15),
  251.               style=0)
  252.         self.textCtrlProxyPassword = wxTextCtrl(id=wxID_WXPREFERENCESDLGTEXTCTRLPROXYPASSWORD,
  253.               name='textCtrlProxyPassword', parent=self._panelProxy,
  254.               pos=wxPoint(91, 131), size=wxSize(295, 21), style=wxTE_PASSWORD,
  255.               value='')
  256.         self.textCtrlProxyPassword.SetToolTipString('Proxy Server account password (optional)')
  257.         self.staticTextExplain = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTEXPLAIN,
  258.               label='Leave these fields blank if you do not connect via Proxy Server',
  259.               name='staticTextExplain', parent=self._panelProxy, pos=wxPoint(6,
  260.               15), size=wxSize(378, 27), style=0)
  261.         self.staticTextExplain.SetToolTipString('')
  262.         self.staticBoxScanOptions = wxStaticBox(id=wxID_WXPREFERENCESDLGSTATICBOXSCANOPTIONS,
  263.               label='Scanning Options', name='staticBoxScanOptions',
  264.               parent=self._panelOptions, pos=wxPoint(6, 11), size=wxSize(376,
  265.               65), style=0)
  266.         self.checkBoxEnableAutoUpdate = wxCheckBox(id=wxID_WXPREFERENCESDLGCHECKBOXENABLEAUTOUPDATE,
  267.               label='&Enable Automatic Virus Database Updates',
  268.               name='checkBoxEnableAutoUpdate', parent=self._panelInternetUpdate,
  269.               pos=wxPoint(6, 11), size=wxSize(322, 20), style=0)
  270.         self.checkBoxEnableAutoUpdate.SetToolTipString('Enable automatic virus database downloads ')
  271.         EVT_CHECKBOX(self.checkBoxEnableAutoUpdate,
  272.               wxID_WXPREFERENCESDLGCHECKBOXENABLEAUTOUPDATE,
  273.               self.OnCheckBoxEnableAutoUpdate)
  274.         self.staticText1 = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXT1,
  275.               label='Download &Site :', name='staticText1',
  276.               parent=self._panelInternetUpdate, pos=wxPoint(24, 43),
  277.               size=wxSize(81, 13), style=0)
  278.         self.textCtrlDBMirror = wxTextCtrl(id=wxID_WXPREFERENCESDLGTEXTCTRLDBMIRROR,
  279.               name='textCtrlDBMirror', parent=self._panelInternetUpdate,
  280.               pos=wxPoint(126, 37), size=wxSize(243, 21), style=0, value='')
  281.         self.textCtrlDBMirror.SetToolTipString('Specify Database Mirror Site here. Usually this is database.clamav.net')
  282.         self.staticTextUpdateFrequency = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTUPDATEFREQUENCY,
  283.               label='&Update Frequency:', name='staticTextUpdateFrequency',
  284.               parent=self._panelInternetUpdate, pos=wxPoint(23, 70),
  285.               size=wxSize(98, 18), style=0)
  286.         self.staticTextUpdateFrequency.SetToolTipString('')
  287.         self.choiceUpdateFrequency = wxChoice(choices=['Hourly', 'Daily',
  288.               'Workdays', 'Weekly'],
  289.               id=wxID_WXPREFERENCESDLGCHOICEUPDATEFREQUENCY,
  290.               name='choiceUpdateFrequency', parent=self._panelInternetUpdate,
  291.               pos=wxPoint(126, 67), size=wxSize(110, 21), style=0)
  292.         self.choiceUpdateFrequency.SetColumns(2)
  293.         self.choiceUpdateFrequency.SetToolTipString('How often virus database is downloaded')
  294.         self.choiceUpdateFrequency.SetStringSelection('Daily')
  295.         EVT_CHOICE(self.choiceUpdateFrequency,
  296.               wxID_WXPREFERENCESDLGCHOICEUPDATEFREQUENCY,
  297.               self.OnChoiceUpdateFrequency)
  298.         self.staticTextClamScan = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTCLAMSCAN,
  299.               label='&ClamScan Location:', name='staticTextClamScan',
  300.               parent=self._panelFiles, pos=wxPoint(6, 15), size=wxSize(354, 13),
  301.               style=0)
  302.         self.staticTextClamScan.SetToolTipString('')
  303.         self.textCtrlClamScan = wxTextCtrl(id=wxID_WXPREFERENCESDLGTEXTCTRLCLAMSCAN,
  304.               name='textCtrlClamScan', parent=self._panelFiles, pos=wxPoint(6,
  305.               33), size=wxSize(356, 20), style=0, value='')
  306.         self.textCtrlClamScan.SetToolTipString('Specify location of clamscan')
  307.         self.buttonBrowseClamScan = wxButton(id=wxID_WXPREFERENCESDLGBUTTONBROWSECLAMSCAN,
  308.               label='...', name='buttonBrowseClamScan', parent=self._panelFiles,
  309.               pos=wxPoint(363, 34), size=wxSize(20, 20), style=0)
  310.         self.buttonBrowseClamScan.SetToolTipString('Click to browse for clamscan')
  311.         EVT_BUTTON(self.buttonBrowseClamScan,
  312.               wxID_WXPREFERENCESDLGBUTTONBROWSECLAMSCAN,
  313.               self.OnButtonBrowseClamScan)
  314.         self.staticTextFreshClam = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTFRESHCLAM,
  315.               label='&FreshClam Location:', name='staticTextFreshClam',
  316.               parent=self._panelFiles, pos=wxPoint(6, 65), size=wxSize(354, 13),
  317.               style=0)
  318.         self.staticTextFreshClam.SetToolTipString('')
  319.         self.textCtrlFreshClam = wxTextCtrl(id=wxID_WXPREFERENCESDLGTEXTCTRLFRESHCLAM,
  320.               name='textCtrlFreshClam', parent=self._panelFiles, pos=wxPoint(6,
  321.               83), size=wxSize(355, 20), style=0, value='')
  322.         self.textCtrlFreshClam.SetToolTipString('Specify location of freshclam')
  323.         self.buttonBrowseFreshClam = wxButton(id=wxID_WXPREFERENCESDLGBUTTONBROWSEFRESHCLAM,
  324.               label='...', name='buttonBrowseFreshClam',
  325.               parent=self._panelFiles, pos=wxPoint(363, 83), size=wxSize(20,
  326.               20), style=0)
  327.         self.buttonBrowseFreshClam.SetToolTipString('Click to browse for freshclam')
  328.         EVT_BUTTON(self.buttonBrowseFreshClam,
  329.               wxID_WXPREFERENCESDLGBUTTONBROWSEFRESHCLAM,
  330.               self.OnButtonBrowseFreshClam)
  331.         self.staticTextVirDB = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTVIRDB,
  332.               label='&Virus Database Folder:', name='staticTextVirDB',
  333.               parent=self._panelFiles, pos=wxPoint(6, 115), size=wxSize(354,
  334.               13), style=0)
  335.         self.staticTextVirDB.SetToolTipString('')
  336.         self.textCtrlVirDB = wxTextCtrl(id=wxID_WXPREFERENCESDLGTEXTCTRLVIRDB,
  337.               name='textCtrlVirDB', parent=self._panelFiles, pos=wxPoint(6,
  338.               133), size=wxSize(355, 20), style=0, value='')
  339.         self.textCtrlVirDB.SetToolTipString('Specify location of virus database files')
  340.         self.buttonVirDB = wxButton(id=wxID_WXPREFERENCESDLGBUTTONVIRDB,
  341.               label='...', name='buttonVirDB', parent=self._panelFiles,
  342.               pos=wxPoint(362, 133), size=wxSize(20, 20), style=0)
  343.         self.buttonVirDB.SetToolTipString('Click to browse for a virus database folder')
  344.         EVT_BUTTON(self.buttonVirDB, wxID_WXPREFERENCESDLGBUTTONVIRDB,
  345.               self.OnButtonBrowseVirDB)
  346.         self.checkBoxScanRecursive = wxCheckBox(id=wxID_WXPREFERENCESDLGCHECKBOXSCANRECURSIVE,
  347.               label='&Scan In Subdirectories', name='checkBoxScanRecursive',
  348.               parent=self._panelOptions, pos=wxPoint(15, 29), size=wxSize(354,
  349.               18), style=0)
  350.         self.checkBoxScanRecursive.SetToolTipString('Select if you wish to scan in subdirectories recursively')
  351.         self.staticTextUpdateTime = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTUPDATETIME,
  352.               label='&Time:', name='staticTextUpdateTime',
  353.               parent=self._panelInternetUpdate, pos=wxPoint(240, 70),
  354.               size=wxSize(33, 18), style=0)
  355.         self.spinButtonUpdateTime = wxSpinButton(id=wxID_WXPREFERENCESDLGSPINBUTTONUPDATETIME,
  356.               name='spinButtonUpdateTime', parent=self._panelInternetUpdate,
  357.               pos=wxPoint(353, 65), size=wxSize(16, 23),
  358.               style=wxSP_ARROW_KEYS | wxSP_VERTICAL)
  359.         self.spinButtonUpdateTime.SetToolTipString('')
  360.         self.checkBoxScanArchives = wxCheckBox(id=wxID_WXPREFERENCESDLGCHECKBOXSCANARCHIVES,
  361.               label='&Scan In Archives', name='checkBoxScanArchives',
  362.               parent=self._panelArchives, pos=wxPoint(6, 15), size=wxSize(322,
  363.               20), style=0)
  364.         self.checkBoxScanArchives.SetValue(False)
  365.         EVT_CHECKBOX(self.checkBoxScanArchives,
  366.               wxID_WXPREFERENCESDLGCHECKBOXSCANARCHIVES,
  367.               self.OnCheckBoxScanArchives)
  368.         self.staticTextMaxSize = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTMAXSIZE,
  369.               label='Do Not Scan Archives Larger Than',
  370.               name='staticTextMaxSize', parent=self._panelArchives,
  371.               pos=wxPoint(24, 49), size=wxSize(200, 15), style=0)
  372.         self.spinCtrlArchiveSize = wxSpinCtrl(id=wxID_WXPREFERENCESDLGSPINCTRLARCHIVESIZE,
  373.               initial=0, max=4096, min=1, name='spinCtrlArchiveSize',
  374.               parent=self._panelArchives, pos=wxPoint(229, 45), size=wxSize(72,
  375.               21), style=wxSP_ARROW_KEYS)
  376.         self.staticTextMB1 = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTMB1,
  377.               label='MegaBytes', name='staticTextMB1',
  378.               parent=self._panelArchives, pos=wxPoint(310, 49), size=wxSize(80,
  379.               16), style=0)
  380.         self.staticTextLimitFiles = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTLIMITFILES,
  381.               label='Do Not Extract More Than ', name='staticTextLimitFiles',
  382.               parent=self._panelArchives, pos=wxPoint(24, 82), size=wxSize(200,
  383.               17), style=0)
  384.         self.spinCtrlArchiveFiles = wxSpinCtrl(id=wxID_WXPREFERENCESDLGSPINCTRLARCHIVEFILES,
  385.               initial=0, max=1073741824, min=1, name='spinCtrlArchiveFiles',
  386.               parent=self._panelArchives, pos=wxPoint(229, 79), size=wxSize(72,
  387.               21), style=wxSP_ARROW_KEYS)
  388.         self.staticTextFiles = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTFILES,
  389.               label='Files', name='staticTextFiles', parent=self._panelArchives,
  390.               pos=wxPoint(310, 82), size=wxSize(80, 16), style=0)
  391.         self.staticTextRecursion = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTRECURSION,
  392.               label='Do Not Extract More Than ', name='staticTextRecursion',
  393.               parent=self._panelArchives, pos=wxPoint(24, 118), size=wxSize(200,
  394.               19), style=0)
  395.         self.spinCtrlRecursion = wxSpinCtrl(id=wxID_WXPREFERENCESDLGSPINCTRLRECURSION,
  396.               initial=0, max=999, min=1, name='spinCtrlRecursion',
  397.               parent=self._panelArchives, pos=wxPoint(229, 115), size=wxSize(72,
  398.               21), style=wxSP_ARROW_KEYS)
  399.         self.staticTextSubArchives = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTSUBARCHIVES,
  400.               label='Sub-Archives', name='staticTextSubArchives',
  401.               parent=self._panelArchives, pos=wxPoint(310, 118), size=wxSize(82,
  402.               16), style=0)
  403.         self.checkBoxEnableMbox = wxCheckBox(id=wxID_WXPREFERENCESDLGCHECKBOXENABLEMBOX,
  404.               label='&Treat Files As Mailboxes', name='checkBoxEnableMbox',
  405.               parent=self._panelAdvanced, pos=wxPoint(6, 11), size=wxSize(384,
  406.               18), style=0)
  407.         self.checkBoxEnableMbox.SetToolTipString('Select if you wish to scan mailboxes')
  408.         self.checkBoxEnableMbox.SetValue(False)
  409.         self.checkBoxEnableOLE2 = wxCheckBox(id=wxID_WXPREFERENCESDLGCHECKBOXENABLEOLE2,
  410.               label='&Extract Attachments and Macros from MS Office Documents',
  411.               name='checkBoxEnableOLE2', parent=self._panelAdvanced,
  412.               pos=wxPoint(6, 33), size=wxSize(381, 18), style=0)
  413.         self.checkBoxEnableOLE2.SetToolTipString('Select if you wish to scan OLE attachments and macros in MS Office Documents')
  414.         self.checkBoxEnableOLE2.SetValue(False)
  415.         self.checkBoxDetectBroken = wxCheckBox(id=wxID_WXPREFERENCESDLGCHECKBOXDETECTBROKEN,
  416.               label='&Detect Broken Executables', name='checkBoxDetectBroken',
  417.               parent=self._panelAdvanced, pos=wxPoint(6, 55), size=wxSize(381,
  418.               18), style=0)
  419.         self.checkBoxDetectBroken.SetToolTipString('Select if you wish to scan OLE attachments and macros in MS Office Documents')
  420.         self.checkBoxDetectBroken.SetValue(False)
  421.         self.staticTextAdditionalParams = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTADDITIONALPARAMS,
  422.               label='&Additional Clamscan Command Line Parameters:',
  423.               name='staticTextAdditionalParams', parent=self._panelAdvanced,
  424.               pos=wxPoint(6, 79), size=wxSize(378, 13), style=0)
  425.         self.textCtrlAdditionalParams = wxTextCtrl(id=wxID_WXPREFERENCESDLGTEXTCTRLADDITIONALPARAMS,
  426.               name='textCtrlAdditionalParams', parent=self._panelAdvanced,
  427.               pos=wxPoint(6, 97), size=wxSize(379, 21), style=0, value='')
  428.         self.staticTextMaxLogSize = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTMAXLOGSIZE,
  429.               label='Limit Log File Size To:', name='staticTextMaxLogSize',
  430.               parent=self._panelAdvanced, pos=wxPoint(6, 136), size=wxSize(170,
  431.               17), style=0)
  432.         self.spinCtrlMaxLogSize = wxSpinCtrl(id=wxID_WXPREFERENCESDLGSPINCTRLMAXLOGSIZE,
  433.               initial=0, max=4096, min=1, name='spinCtrlMaxLogSize',
  434.               parent=self._panelAdvanced, pos=wxPoint(6, 155), size=wxSize(129,
  435.               21), style=wxSP_ARROW_KEYS)
  436.         self.spinCtrlMaxLogSize.SetToolTipString('Select maximum size for the logfile')
  437.         self.spinCtrlMaxLogSize.SetValue(1)
  438.         self.staticTextLogFIle = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTLOGFILE,
  439.               label='&Scan Report File:', name='staticTextLogFIle',
  440.               parent=self._panelReports, pos=wxPoint(6, 15), size=wxSize(354,
  441.               19), style=0)
  442.         self.staticTextLogFIle.SetToolTipString('')
  443.         self.textCtrlScanLogFile = wxTextCtrl(id=wxID_WXPREFERENCESDLGTEXTCTRLSCANLOGFILE,
  444.               name='textCtrlScanLogFile', parent=self._panelReports,
  445.               pos=wxPoint(6, 35), size=wxSize(360, 20), style=0, value='')
  446.         self.textCtrlScanLogFile.SetToolTipString('Specify location for a scan reports log file')
  447.         self.buttonBrowseScanLog = wxButton(id=wxID_WXPREFERENCESDLGBUTTONBROWSESCANLOG,
  448.               label='...', name='buttonBrowseScanLog',
  449.               parent=self._panelReports, pos=wxPoint(366, 35), size=wxSize(20,
  450.               20), style=0)
  451.         self.buttonBrowseScanLog.SetToolTipString('Click to browse for a log file')
  452.         EVT_BUTTON(self.buttonBrowseScanLog,
  453.               wxID_WXPREFERENCESDLGBUTTONBROWSESCANLOG,
  454.               self.OnButtonBrowseScanLog)
  455.         self.staticTextDBUpdateLogFile = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTDBUPDATELOGFILE,
  456.               label='&Virus Database Update Report File:',
  457.               name='staticTextDBUpdateLogFile', parent=self._panelReports,
  458.               pos=wxPoint(6, 66), size=wxSize(354, 19), style=0)
  459.         self.staticTextDBUpdateLogFile.SetToolTipString('')
  460.         self.textCtrlUpdateLogFile = wxTextCtrl(id=wxID_WXPREFERENCESDLGTEXTCTRLUPDATELOGFILE,
  461.               name='textCtrlUpdateLogFile', parent=self._panelReports,
  462.               pos=wxPoint(6, 86), size=wxSize(360, 20), style=0, value='')
  463.         self.textCtrlUpdateLogFile.SetToolTipString('Specify location for a database updates log file')
  464.         self.buttonBrowseUpdateLog = wxButton(id=wxID_WXPREFERENCESDLGBUTTONBROWSEUPDATELOG,
  465.               label='...', name='buttonBrowseUpdateLog',
  466.               parent=self._panelReports, pos=wxPoint(366, 86), size=wxSize(20,
  467.               20), style=0)
  468.         self.buttonBrowseUpdateLog.SetToolTipString('Click to browse for a log file')
  469.         EVT_BUTTON(self.buttonBrowseUpdateLog,
  470.               wxID_WXPREFERENCESDLGBUTTONBROWSEUPDATELOG,
  471.               self.OnButtonBrowseUpdateLog)
  472.         self.staticLineUpdateTimeCtrl = wxStaticLine(id=wxID_WXPREFERENCESDLGSTATICLINEUPDATETIMECTRL,
  473.               name='staticLineUpdateTimeCtrl', parent=self._panelInternetUpdate,
  474.               pos=wxPoint(277, 66), size=wxSize(74, 22), style=0)
  475.         self.staticLineUpdateTimeCtrl.Show(False)
  476.         self.staticLineUpdateTimeCtrl.SetToolTipString('When the download should be started')
  477.         self.staticTextUpdateDay = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTUPDATEDAY,
  478.               label='&Day Of The Week:', name='staticTextUpdateDay',
  479.               parent=self._panelInternetUpdate, pos=wxPoint(23, 104),
  480.               size=wxSize(96, 18), style=0)
  481.         self.staticTextUpdateDay.SetToolTipString('')
  482.         self._panelScheduler = wxPanel(id=wxID_WXPREFERENCESDLG_PANELSCHEDULER,
  483.               name='_panelScheduler', parent=self.notebook, pos=wxPoint(0, 0),
  484.               size=wxSize(390, 234), style=wxTAB_TRAVERSAL)
  485.         self._panelScheduler.SetToolTipString('')
  486.         self.listViewScheduledTasks = wxListView(id=wxID_WXPREFERENCESDLGLISTVIEWSCHEDULEDTASKS,
  487.               name='listViewScheduledTasks', parent=self._panelScheduler,
  488.               pos=wxPoint(6, 34), size=wxSize(298, 158),
  489.               style=wxLC_REPORT | wxLC_SINGLE_SEL)
  490.         self.listViewScheduledTasks.SetToolTipString('List of Scheduled Scans')
  491.         self.listViewScheduledTasks.SetImageList(self.imageListScheduler,
  492.               wxIMAGE_LIST_NORMAL)
  493.         self.listViewScheduledTasks.SetImageList(self.imageListScheduler,
  494.               wxIMAGE_LIST_SMALL)
  495.         self._init_coll_listViewScheduledTasks_Columns(self.listViewScheduledTasks)
  496.         EVT_LIST_ITEM_SELECTED(self.listViewScheduledTasks,
  497.               wxID_WXPREFERENCESDLGLISTVIEWSCHEDULEDTASKS,
  498.               self.OnScheduledTasksUpdate)
  499.         EVT_LIST_ITEM_DESELECTED(self.listViewScheduledTasks,
  500.               wxID_WXPREFERENCESDLGLISTVIEWSCHEDULEDTASKS,
  501.               self.OnScheduledTasksUpdate)
  502.         EVT_LEFT_DCLICK(self.listViewScheduledTasks,
  503.               self.OnButtonEditScheduledScan)
  504.         self.staticTextScheduledTasks = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTSCHEDULEDTASKS,
  505.               label='Scheduled Scans:', name='staticTextScheduledTasks',
  506.               parent=self._panelScheduler, pos=wxPoint(6, 14), size=wxSize(154,
  507.               16), style=0)
  508.         self.staticTextScheduledTasks.SetToolTipString('')
  509.         self.buttonTaskAdd = wxButton(id=wxID_WXPREFERENCESDLGBUTTONTASKADD,
  510.               label='&Add', name='buttonTaskAdd', parent=self._panelScheduler,
  511.               pos=wxPoint(311, 34), size=wxSize(75, 23), style=0)
  512.         EVT_BUTTON(self.buttonTaskAdd, wxID_WXPREFERENCESDLGBUTTONTASKADD,
  513.               self.OnButtonAddScheduledScan)
  514.         self.buttonTaskRemove = wxButton(id=wxID_WXPREFERENCESDLGBUTTONTASKREMOVE,
  515.               label='&Remove', name='buttonTaskRemove',
  516.               parent=self._panelScheduler, pos=wxPoint(311, 67), size=wxSize(75,
  517.               23), style=0)
  518.         EVT_BUTTON(self.buttonTaskRemove, wxID_WXPREFERENCESDLGBUTTONTASKREMOVE,
  519.               self.OnButtonRemoveScheduledScan)
  520.         self.buttonTaskEdit = wxButton(id=wxID_WXPREFERENCESDLGBUTTONTASKEDIT,
  521.               label='&Edit', name='buttonTaskEdit', parent=self._panelScheduler,
  522.               pos=wxPoint(311, 101), size=wxSize(75, 23), style=0)
  523.         EVT_BUTTON(self.buttonTaskEdit, wxID_WXPREFERENCESDLGBUTTONTASKEDIT,
  524.               self.OnButtonEditScheduledScan)
  525.         self.checkBoxInfectedOnly = wxCheckBox(id=wxID_WXPREFERENCESDLGCHECKBOXINFECTEDONLY,
  526.               label='&Display Infected Files Only', name='checkBoxInfectedOnly',
  527.               parent=self._panelOptions, pos=wxPoint(15, 49), size=wxSize(354,
  528.               18), style=0)
  529.         self.checkBoxInfectedOnly.SetValue(False)
  530.         self.checkBoxInfectedOnly.SetToolTipString('Select if you wish to display infected files only in the scan progress window')
  531.         self.choiceUpdateDay = wxChoice(choices=['Monday', 'Tuesday',
  532.               'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
  533.               id=wxID_WXPREFERENCESDLGCHOICEUPDATEDAY, name='choiceUpdateDay',
  534.               parent=self._panelInternetUpdate, pos=wxPoint(126, 101),
  535.               size=wxSize(110, 21), style=0)
  536.         self.choiceUpdateDay.SetColumns(2)
  537.         self.choiceUpdateDay.SetToolTipString('When update frequency is weekly select day of the week for an update')
  538.         self.choiceUpdateDay.SetStringSelection('Tuesday')
  539.         self.checkBoxUpdateLogon = wxCheckBox(id=wxID_WXPREFERENCESDLGCHECKBOXUPDATELOGON,
  540.               label='&Update Virus Database On Logon',
  541.               name='checkBoxUpdateLogon', parent=self._panelInternetUpdate,
  542.               pos=wxPoint(6, 139), size=wxSize(322, 20), style=0)
  543.         self.checkBoxUpdateLogon.SetToolTipString('Select if you wish to update the virus databases just after you logged on')
  544.         self.checkBoxUpdateLogon.SetValue(False)
  545.         EVT_CHECKBOX(self.checkBoxUpdateLogon,
  546.               wxID_WXPREFERENCESDLGCHECKBOXUPDATELOGON,
  547.               self.OnCheckBoxEnableAutoUpdate)
  548.         self.staticBoxInfected = wxStaticBox(id=wxID_WXPREFERENCESDLGSTATICBOXINFECTED,
  549.               label='Infected Files', name='staticBoxInfected',
  550.               parent=self._panelOptions, pos=wxPoint(6, 84), size=wxSize(376,
  551.               106), style=0)
  552.         self.radioButtonReport = wxRadioButton(id=wxID_WXPREFERENCESDLGRADIOBUTTONREPORT,
  553.               label='&Report Only', name='radioButtonReport',
  554.               parent=self._panelOptions, pos=wxPoint(15, 102), size=wxSize(354,
  555.               18), style=0)
  556.         self.radioButtonReport.SetValue(False)
  557.         EVT_RADIOBUTTON(self.radioButtonReport,
  558.               wxID_WXPREFERENCESDLGRADIOBUTTONREPORT, self.OnRadioInfected)
  559.         self.radioButtonRemoveInfected = wxRadioButton(id=wxID_WXPREFERENCESDLGRADIOBUTTONREMOVEINFECTED,
  560.               label='&Remove (Use Carefully)', name='radioButtonRemoveInfected',
  561.               parent=self._panelOptions, pos=wxPoint(15, 120), size=wxSize(354,
  562.               18), style=0)
  563.         self.radioButtonRemoveInfected.SetValue(False)
  564.         EVT_RADIOBUTTON(self.radioButtonRemoveInfected,
  565.               wxID_WXPREFERENCESDLGRADIOBUTTONREMOVEINFECTED,
  566.               self.OnRadioInfected)
  567.         self.radioButtonQuarantine = wxRadioButton(id=wxID_WXPREFERENCESDLGRADIOBUTTONQUARANTINE,
  568.               label='&Move To Quarantine Folder:', name='radioButtonQuarantine',
  569.               parent=self._panelOptions, pos=wxPoint(15, 139), size=wxSize(354,
  570.               18), style=0)
  571.         self.radioButtonQuarantine.SetValue(False)
  572.         EVT_RADIOBUTTON(self.radioButtonQuarantine,
  573.               wxID_WXPREFERENCESDLGRADIOBUTTONQUARANTINE, self.OnRadioInfected)
  574.         self.textCtrlQuarantine = wxTextCtrl(id=wxID_WXPREFERENCESDLGTEXTCTRLQUARANTINE,
  575.               name='textCtrlQuarantine', parent=self._panelOptions,
  576.               pos=wxPoint(31, 159), size=wxSize(319, 20), style=0, value='')
  577.         self.textCtrlQuarantine.SetToolTipString('Specify location for a quarantine folder')
  578.         self.buttonBrowseQuarantine = wxButton(id=wxID_WXPREFERENCESDLGBUTTONBROWSEQUARANTINE,
  579.               label='...', name='buttonBrowseQuarantine',
  580.               parent=self._panelOptions, pos=wxPoint(351, 159), size=wxSize(20,
  581.               20), style=0)
  582.         self.buttonBrowseQuarantine.SetToolTipString('Click to browse for a quarantine folder')
  583.         EVT_BUTTON(self.buttonBrowseQuarantine,
  584.               wxID_WXPREFERENCESDLGBUTTONBROWSEQUARANTINE,
  585.               self.OnButtonBrowseQuarantine)
  586.         self._panelEmailAlerts = wxPanel(id=wxID_WXPREFERENCESDLG_PANELEMAILALERTS,
  587.               name='_panelEmailAlerts', parent=self.notebook, pos=wxPoint(0, 0),
  588.               size=wxSize(390, 234), style=wxTAB_TRAVERSAL)
  589.         self._panelEmailAlerts.SetToolTipString('')
  590.         self.checkBoxSMTPEnable = wxCheckBox(id=wxID_WXPREFERENCESDLGCHECKBOXSMTPENABLE,
  591.               label='&Send Email Alert On Virus Detection',
  592.               name='checkBoxSMTPEnable', parent=self._panelEmailAlerts,
  593.               pos=wxPoint(6, 11), size=wxSize(362, 15), style=0)
  594.         self.checkBoxSMTPEnable.SetValue(False)
  595.         self.checkBoxSMTPEnable.SetToolTipString('Select if you wish to receive email alerts when ClamWin detects a virus')
  596.         EVT_CHECKBOX(self.checkBoxSMTPEnable,
  597.               wxID_WXPREFERENCESDLGCHECKBOXSMTPENABLE,
  598.               self.OnCheckBoxSMTPEnable)
  599.         self.staticBoxSMTPConnection = wxStaticBox(id=wxID_WXPREFERENCESDLGSTATICBOXSMTPCONNECTION,
  600.               label='SMTP Connection Details', name='staticBoxSMTPConnection',
  601.               parent=self._panelEmailAlerts, pos=wxPoint(16, 27),
  602.               size=wxSize(368, 71), style=0)
  603.         self.staticBoxSMTPConnection.SetToolTipString('')
  604.         self.staticTextSMTPHost = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTSMTPHOST,
  605.               label='&Mail Server:', name='staticTextSMTPHost',
  606.               parent=self._panelEmailAlerts, pos=wxPoint(24, 49),
  607.               size=wxSize(71, 16), style=0)
  608.         self.staticTextSMTPHost.SetToolTipString('')
  609.         self.textCtrlSMTPHost = wxTextCtrl(id=wxID_WXPREFERENCESDLGTEXTCTRLSMTPHOST,
  610.               name='textCtrlSMTPHost', parent=self._panelEmailAlerts,
  611.               pos=wxPoint(104, 46), size=wxSize(192, 21), style=0, value='')
  612.         self.textCtrlSMTPHost.SetToolTipString('SMTP Server domain name or IP address')
  613.         self.staticTextSMTPPort = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTSMTPPORT,
  614.               label='P&ort:', name='staticTextSMTPPort',
  615.               parent=self._panelEmailAlerts, pos=wxPoint(300, 49),
  616.               size=wxSize(31, 16), style=0)
  617.         self.intCtrlSMTPPort = wxIntCtrl(allow_long=False, allow_none=False,
  618.               default_color=wxBLACK, id=wxID_WXPREFERENCESDLGINTCTRLSMTPPORT,
  619.               limited=False, max=65535, min=0, name='intCtrlSMTPPort',
  620.               oob_color=wxRED, parent=self._panelEmailAlerts, pos=wxPoint(330,
  621.               46), size=wxSize(47, 21), style=0, value=25)
  622.         self.intCtrlSMTPPort.SetBounds((0, 65535))
  623.         self.intCtrlSMTPPort.SetToolTipString('Mail Server port number (0-65535)')
  624.         self.staticTextSMTPUserName = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTSMTPUSERNAME,
  625.               label='&User Name:', name='staticTextSMTPUserName',
  626.               parent=self._panelEmailAlerts, pos=wxPoint(24, 72),
  627.               size=wxSize(79, 16), style=0)
  628.         self.staticTextSMTPUserName.SetToolTipString('')
  629.         self.textCtrlSMTPUser = wxTextCtrl(id=wxID_WXPREFERENCESDLGTEXTCTRLSMTPUSER,
  630.               name='textCtrlSMTPUser', parent=self._panelEmailAlerts,
  631.               pos=wxPoint(104, 69), size=wxSize(101, 21), style=0, value='')
  632.         self.textCtrlSMTPUser.SetToolTipString('Mail Server Account Name (optional)')
  633.         self.staticTextSMTPPassword = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTSMTPPASSWORD,
  634.               label='&Password:', name='staticTextSMTPPassword',
  635.               parent=self._panelEmailAlerts, pos=wxPoint(209, 72),
  636.               size=wxSize(66, 16), style=0)
  637.         self.staticTextSMTPPassword.SetToolTipString('')
  638.         self.textCtrlSMTPPassword = wxTextCtrl(id=wxID_WXPREFERENCESDLGTEXTCTRLSMTPPASSWORD,
  639.               name='textCtrlSMTPPassword', parent=self._panelEmailAlerts,
  640.               pos=wxPoint(276, 69), size=wxSize(101, 21), style=wxTE_PASSWORD,
  641.               value='')
  642.         self.textCtrlSMTPPassword.SetToolTipString('Mail Server account password (optional)')
  643.         self.staticBoxEmailDetails = wxStaticBox(id=wxID_WXPREFERENCESDLGSTATICBOXEMAILDETAILS,
  644.               label='Email Message Details', name='staticBoxEmailDetails',
  645.               parent=self._panelEmailAlerts, pos=wxPoint(16, 102),
  646.               size=wxSize(368, 95), style=0)
  647.         self.staticBoxEmailDetails.SetToolTipString('')
  648.         self.staticTextSMTPFrom = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTSMTPFROM,
  649.               label='&From:', name='staticTextSMTPFrom',
  650.               parent=self._panelEmailAlerts, pos=wxPoint(24, 124),
  651.               size=wxSize(63, 16), style=0)
  652.         self.staticTextSMTPFrom.SetToolTipString('')
  653.         self.textCtrlSMTPFrom = wxTextCtrl(id=wxID_WXPREFERENCESDLGTEXTCTRLSMTPFROM,
  654.               name='textCtrlSMTPFrom', parent=self._panelEmailAlerts,
  655.               pos=wxPoint(104, 118), size=wxSize(273, 21), style=0, value='')
  656.         self.textCtrlSMTPFrom.SetToolTipString('Specify an email address from which the notification will be sent.')
  657.         self.staticTextSMTPTo = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTSMTPTO,
  658.               label='&To:', name='staticTextSMTPTo',
  659.               parent=self._panelEmailAlerts, pos=wxPoint(24, 148),
  660.               size=wxSize(63, 16), style=0)
  661.         self.staticTextSMTPTo.SetToolTipString('')
  662.         self.textCtrlSMTPTo = wxTextCtrl(id=wxID_WXPREFERENCESDLGTEXTCTRLSMTPTO,
  663.               name='textCtrlSMTPTo', parent=self._panelEmailAlerts,
  664.               pos=wxPoint(104, 143), size=wxSize(273, 21), style=0, value='')
  665.         self.textCtrlSMTPTo.SetToolTipString('Specify an email address where the email alert will be delivered.  Separate multiple addresses with commas.')
  666.         self.staticTextSMTPSubject = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTSMTPSUBJECT,
  667.               label='Su&bject:', name='staticTextSMTPSubject',
  668.               parent=self._panelEmailAlerts, pos=wxPoint(24, 171),
  669.               size=wxSize(63, 16), style=0)
  670.         self.staticTextSMTPSubject.SetToolTipString('')
  671.         self.textCtrlSMTPSubject = wxTextCtrl(id=wxID_WXPREFERENCESDLGTEXTCTRLSMTPSUBJECT,
  672.               name='textCtrlSMTPSubject', parent=self._panelEmailAlerts,
  673.               pos=wxPoint(104, 167), size=wxSize(273, 21), style=0, value='')
  674.         self.textCtrlSMTPSubject.SetToolTipString("Specify Recipient's email address where the email alert will be delivered")
  675.         self.buttonSendTestEmail = wxButton(id=wxID_WXPREFERENCESDLGBUTTONSENDTESTEMAIL,
  676.               label='Send &Test Email', name='buttonSendTestEmail',
  677.               parent=self._panelEmailAlerts, pos=wxPoint(120, 205),
  678.               size=wxSize(149, 23), style=0)
  679.         self.buttonSendTestEmail.SetToolTipString('Click to send a test email message')
  680.         EVT_BUTTON(self.buttonSendTestEmail,
  681.               wxID_WXPREFERENCESDLGBUTTONSENDTESTEMAIL,
  682.               self.OnButtonSendTestEmail)
  683.         self.checkBoxTrayNotify = wxCheckBox(id=wxID_WXPREFERENCESDLGCHECKBOXTRAYNOTIFY,
  684.               label='&Display Pop-up Notification Messages In Taskbar ',
  685.               name='checkBoxTrayNotify', parent=self._panelReports,
  686.               pos=wxPoint(6, 123), size=wxSize(354, 18), style=0)
  687.         self.checkBoxTrayNotify.SetValue(False)
  688.         self.checkBoxTrayNotify.SetToolTipString('Select if you wish to receive Tray notification pop-up messages')
  689.         self._panelFilters = wxPanel(id=wxID_WXPREFERENCESDLG_PANELFILTERS,
  690.               name='_panelFilters', parent=self.notebook, pos=wxPoint(0, 0),
  691.               size=wxSize(390, 234), style=wxTAB_TRAVERSAL)
  692.         self.staticTextFiltreDesc1 = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTFILTREDESC1,
  693.               label='Specify Filename Patterns to include and/or exclude in scanning',
  694.               name='staticTextFiltreDesc1', parent=self._panelFilters,
  695.               pos=wxPoint(6, 11), size=wxSize(383, 16), style=0)
  696.         self.staticText2 = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXT2,
  697.               label='(To specify a regular expression include your pattern within <...>)',
  698.               name='staticText2', parent=self._panelFilters, pos=wxPoint(6, 28),
  699.               size=wxSize(382, 16), style=0)
  700.         self.staticTextFiltersExclude = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTFILTERSEXCLUDE,
  701.               label='&Exclude Matching Filenames:',
  702.               name='staticTextFiltersExclude', parent=self._panelFilters,
  703.               pos=wxPoint(6, 50), size=wxSize(184, 16), style=0)
  704.         self.editableListBoxFiltersExclude = wxEditableListBox(id=wxID_WXPREFERENCESDLGEDITABLELISTBOXFILTERSEXCLUDE,
  705.               label='Patterns', name='editableListBoxFiltersExclude',
  706.               parent=self._panelFilters, pos=wxPoint(6, 69), size=wxSize(182,
  707.               151))
  708.         self.staticTextFiltersInclude = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTFILTERSINCLUDE,
  709.               label='&Scan Only Matching Filenames:',
  710.               name='staticTextFiltersInclude', parent=self._panelFilters,
  711.               pos=wxPoint(202, 51), size=wxSize(187, 16), style=0)
  712.         self.editableListBoxFiltersInclude = wxEditableListBox(id=wxID_WXPREFERENCESDLGEDITABLELISTBOXFILTERSINCLUDE,
  713.               label='Patterns', name='editableListBoxFiltersInclude',
  714.               parent=self._panelFilters, pos=wxPoint(200, 69), size=wxSize(184,
  715.               151))
  716.         self.buttonTaskDeactivate = wxButton(id=wxID_WXPREFERENCESDLGBUTTONTASKDEACTIVATE,
  717.               label='&Deactivate', name='buttonTaskDeactivate',
  718.               parent=self._panelScheduler, pos=wxPoint(311, 169),
  719.               size=wxSize(75, 23), style=0)
  720.         EVT_BUTTON(self.buttonTaskDeactivate,
  721.               wxID_WXPREFERENCESDLGBUTTONTASKDEACTIVATE,
  722.               self.OnButtonTaskDeactivate)
  723.         self.buttonTaskActivate = wxButton(id=wxID_WXPREFERENCESDLGBUTTONTASKACTIVATE,
  724.               label='A&ctivate', name='buttonTaskActivate',
  725.               parent=self._panelScheduler, pos=wxPoint(311, 135),
  726.               size=wxSize(75, 23), style=0)
  727.         EVT_BUTTON(self.buttonTaskActivate,
  728.               wxID_WXPREFERENCESDLGBUTTONTASKACTIVATE,
  729.               self.OnButtonTaskActivate)
  730.         self.checkBoxCheckVersion = wxCheckBox(id=wxID_WXPREFERENCESDLGCHECKBOXCHECKVERSION,
  731.               label='&Notify About New ClamWin Releases',
  732.               name='checkBoxCheckVersion', parent=self._panelInternetUpdate,
  733.               pos=wxPoint(6, 172), size=wxSize(322, 20), style=0)
  734.         self.checkBoxCheckVersion.SetToolTipString('Select if you wish to get a notification message when ClamWin Free Antivirus program has been updated')
  735.         self.checkBoxCheckVersion.SetValue(False)
  736.         EVT_CHECKBOX(self.checkBoxCheckVersion,
  737.               wxID_WXPREFERENCESDLGCHECKBOXCHECKVERSION,
  738.               self.OnCheckBoxCheckVersionCheckbox)
  739.         self.staticTextNoPersonal = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTNOPERSONAL,
  740.               label='(No personal information is transmitted during this check)',
  741.               name='staticTextNoPersonal', parent=self._panelInternetUpdate,
  742.               pos=wxPoint(27, 193), size=wxSize(265, 13), style=0)
  743.         self.staticTextMB2 = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTMB2,
  744.               label='MegaBytes', name='staticTextMB2',
  745.               parent=self._panelAdvanced, pos=wxPoint(144, 156), size=wxSize(74,
  746.               16), style=0)
  747.         self.staticTextPriority = wxStaticText(id=wxID_WXPREFERENCESDLGSTATICTEXTPRIORITY,
  748.               label='Scanner &Priority:', name='staticTextPriority',
  749.               parent=self._panelAdvanced, pos=wxPoint(252, 136),
  750.               size=wxSize(103, 17), style=0)
  751.         self.choicePriority = wxChoice(choices=['Low', 'Normal'],
  752.               id=wxID_WXPREFERENCESDLGCHOICEPRIORITY, name='choicePriority',
  753.               parent=self._panelAdvanced, pos=wxPoint(252, 155),
  754.               size=wxSize(134, 21), style=0)
  755.         self.choicePriority.SetToolTipString('Specify the process priority for the virus scanner.')
  756.         self.choicePriority.SetStringSelection('Normal')
  757.         self.choicePriority.SetLabel('')
  758.         self._init_coll_notebook_Pages(self.notebook)
  759.     def __init__(self, parent, config, switchToSchedule):
  760.         self._config = None
  761.         self._config = config        
  762.         if sys.platform.startswith("win"):            
  763.             self._scheduledScans = wxDialogScheduledScan.LoadPersistentScheduledScans(
  764.                 os.path.join(Utils.GetScheduleShelvePath(self._config), 'ScheduledScans'))
  765.         self._init_ctrls(parent) 
  766.         
  767.         # set window icons
  768.         icons = wxIconBundle()
  769.         icons.AddIconFromFile('img/FrameIcon.ico', wxBITMAP_TYPE_ICO)
  770.         self.SetIcons(icons)        
  771.         
  772.         # wxWidgets notebook bug workaround
  773.         # http://sourceforge.net/tracker/index.php?func=detail&aid=645323&group_id=9863&atid=109863
  774.         s = self.notebook.GetSize(); 
  775.         self.notebook.SetSize(wxSize(s.GetWidth() - 1, s.GetHeight()));
  776.         self.notebook.SetSize(s); 
  777.                         
  778.         
  779.         init_pages = [self._OptionsPageInit, self._FiltersPageInit, self._ScheduledScanPageInit, 
  780.                         self._InternetUpdatePageInit, self._EmailAlertsPageInit,
  781.                         self._ProxyPageInit, 
  782.                         self._FilesPageInit, self._ArchivesPageInit, 
  783.                         self._ReportsPageInit, 
  784.                         self._AdvancedPageInit]
  785.         # added check for self._config.Get('UI', 'Standalone')
  786.         # to enable running the scanner only with no scheduler
  787.         # needed in clamwin plugin to BartPE <http://oss.netfarm.it/winpe/>
  788.         if self._config.Get('UI', 'Standalone') == '1':        
  789.             # remove internet updates page on unix
  790.             init_pages.remove(self._ScheduledScanPageInit)
  791.             init_pages.remove(self._InternetUpdatePageInit)            
  792.             self.notebook.RemovePage(4)
  793.             self.notebook.RemovePage(2)
  794.             
  795.             
  796.         for init_page in init_pages:
  797.             init_page()
  798.             
  799.         for i in range(0, self.notebook.GetPageCount()):
  800.             self.notebook.GetPage(i).TransferDataToWindow()        
  801.             
  802.         self.UpdateScheduledTasksButtons()
  803.         
  804.         if switchToSchedule:
  805.             self.notebook.SetSelection(4)
  806.         
  807.         
  808.     def OnCancel(self, event):
  809.         self.EndModal(wxID_CANCEL)
  810.     def OnOK(self, event):  
  811.         if self._Apply():
  812.             self.EndModal(wxID_OK)
  813.     def _Apply(self):                       
  814.             pages = range(0, self.notebook.GetPageCount())
  815.             # rearrange pages in order to validate the current one first
  816.          for page in pages:             
  817.              if self.notebook.GetSelection() == page:
  818.                  tmp = pages[0]
  819.                     pages[0] = pages[page]
  820.                     pages[page] = tmp
  821.                     
  822.             # validate and apply each page
  823.             for page in pages:
  824.              if not self.notebook.GetPage(page).Validate():
  825.                  # activate the invalid page
  826.                  self.notebook.SetSelection(page)
  827.                  return False
  828.              self.notebook.GetPage(page).TransferDataFromWindow()                             
  829.                 
  830.          # save config to properties file    
  831.             if not self._config.Write():
  832.                 MsgBox.ErrorBox(self, 'An error occured whilst saving configuration file %s. Please check that you have write permsiison to the configuratuion file.' % self._config.GetFilename())
  833.                 return False
  834.                             
  835.             # raise the event so other programs can reload config                
  836.             if sys.platform.startswith("win"):
  837.                 wxDialogScheduledScan.SavePersistentScheduledScans(
  838.                     os.path.join(Utils.GetScheduleShelvePath(self._config), 'ScheduledScans'),
  839.                     self._scheduledScans)               
  840.             
  841.                 import win32event, win32api                
  842.                 hEvent = None
  843.                 try:
  844.                     hEvent = win32event.CreateEvent(None, True, False, Utils.CONFIG_EVENT);
  845.                     win32event.PulseEvent(hEvent)
  846.                     win32api.CloseHandle(hEvent)                    
  847.                 except win32api.error, e:
  848.                     if hEvent is not None:
  849.                         win32api.CloseHandle(hEvent)
  850.                     print "Event Failed", str(e)
  851.             return True
  852.         
  853.                             
  854.         
  855.     def _EnableOptionsControls(self, init):
  856.         if init:
  857.             self._config.Get('ClamAV', 'RemoveInfected') == '1'
  858.             enable = self._config.Get('ClamAV', 'MoveInfected') == '1' and 
  859.                         len(self._config.Get('ClamAV', 'QuarantineDir'))
  860.         else:            
  861.             enable = self.radioButtonQuarantine.GetValue()
  862.                 
  863.         self.textCtrlQuarantine.Enable(enable)
  864.         self.buttonBrowseQuarantine.Enable(enable)
  865.                                     
  866.     def _OptionsPageInit(self):        
  867.         self.choicePriority.SetValidator(MyValidator(config=self._config, section='ClamAV', value='Priority'))        
  868.         self.checkBoxInfectedOnly.SetValidator(MyValidator(config=self._config, section='ClamAV', value='InfectedOnly'))
  869.         self.checkBoxScanRecursive.SetValidator(MyValidator(config=self._config, section='ClamAV', value='ScanRecursive'))                
  870.         self.radioButtonReport.SetValidator(MyValidator(config=self._config, section='UI', value='ReportInfected'))
  871.         self.radioButtonRemoveInfected.SetValidator(MyValidator(config=self._config, section='ClamAV', value='RemoveInfected'))
  872.         self.radioButtonQuarantine.SetValidator(MyValidator(config=self._config, section='ClamAV', value='MoveInfected'))        
  873.         self.textCtrlQuarantine.SetValidator(MyValidator(config=self._config, section='ClamAV', value='QuarantineDir', canEmpty = False))
  874.         self._EnableOptionsControls(True)
  875.         
  876.     def _FiltersPageInit(self):                
  877.         self.editableListBoxFiltersInclude.SetValidator(MyPatternValidator(config=self._config, section='ClamAV', value='IncludePatterns'))
  878.         self.editableListBoxFiltersExclude.SetValidator(MyPatternValidator(config=self._config, section='ClamAV', value='ExcludePatterns'))        
  879.         if sys.platform.startswith('win'):
  880.             EVT_CHAR(self.editableListBoxFiltersInclude.GetListCtrl(),
  881.                   self.OnEditableListBoxChar)
  882.             EVT_CHAR(self.editableListBoxFiltersExclude.GetListCtrl(),
  883.                   self.OnEditableListBoxChar)
  884.     def _EnableInternetUpdateControls(self, init):
  885.         if sys.platform.startswith("win"):
  886.             if init:
  887.                 enable = self._config.Get('Updates', 'Enable') == '1'                        
  888.                 enableDay = enable and self._config.Get('Updates', 'Frequency') == 'Weekly'
  889.             else:                
  890.                 enable = self.checkBoxEnableAutoUpdate.IsChecked()            
  891.                 enableDay = enable and self.choiceUpdateFrequency.GetStringSelection() == 'Weekly'
  892.             self.textCtrlDBMirror.Enable(enable)
  893.             self.choiceUpdateDay.Enable(enableDay)
  894.             self.choiceUpdateFrequency.Enable(enable)
  895.             self.timeUpdate.Enable(enable)
  896.             self.spinButtonUpdateTime.Enable(enable)
  897.             
  898.     def _InternetUpdatePageInit(self):
  899.         locale.setlocale(locale.LC_ALL, 'C')
  900.         self.timeUpdate = wxTimeCtrl(parent=self._panelInternetUpdate,
  901.          pos=self.staticLineUpdateTimeCtrl.GetPosition(), 
  902.          size=self.staticLineUpdateTimeCtrl.GetSize(),  fmt24hr=Utils.IsTime24(),
  903.          spinButton=self.spinButtonUpdateTime,
  904.          useFixedWidthFont=False, display_seconds=True)
  905.         self.timeUpdate.SetToolTipString(self.staticLineUpdateTimeCtrl.GetToolTip().GetTip())
  906.         #self.timeUpdate.BindSpinButton(self.spinButtonUpdateTime)            
  907.         self.textCtrlDBMirror.SetValidator(MyValidator(config=self._config, section='Updates', value='DBMirror', canEmpty=False))        
  908.         self.checkBoxEnableAutoUpdate.SetValidator(MyValidator(config=self._config, section='Updates', value='Enable'))
  909.         self.checkBoxCheckVersion.SetValidator(MyValidator(config=self._config, section='Updates', value='CheckVersion'))
  910.         self.choiceUpdateFrequency.SetValidator(MyValidator(config=self._config, section='Updates', value='Frequency'))        
  911.         self.timeUpdate.SetValidator(MyValidator(config=self._config, section='Updates', value='Time'))
  912.         if sys.platform.startswith('win'):
  913.             self.checkBoxUpdateLogon.SetValidator(MyValidator(config=self._config, section='Updates', value='UpdateOnLogon'))
  914.         else:
  915.             self.checkBoxUpdateLogon.Hide()        
  916.         self.choiceUpdateDay.SetValidator(MyWeekDayValidator(config=self._config, section='Updates', value='WeekDay'))        
  917.         self._EnableInternetUpdateControls(True)
  918.     
  919.     def _ProxyPageInit(self):              
  920.         self.textCtrlProxyHost.SetValidator(MyValidator(config=self._config, section='Proxy', value='Host'))        
  921.         self.intCtrlProxyPort.SetValidator(MyValidator(config=self._config, section='Proxy', value='Port'))        
  922.         self.textCtrlProxyUser.SetValidator(MyValidator(config=self._config, section='Proxy', value='User'))        
  923.         self.textCtrlProxyPassword.SetValidator(MyValidator(config=self._config, section='Proxy', value='Password'))             
  924.     
  925.     def _ScheduledScanPageInit(self):  
  926.         # adjust column witdh in the listview
  927.         col_count = self.listViewScheduledTasks.GetColumnCount()
  928.         col_size = self.listViewScheduledTasks.GetSize()[0]/col_count-1        
  929.         self.listViewScheduledTasks.SetColumnWidth(0, col_size + 30)              
  930.         self.listViewScheduledTasks.SetColumnWidth(1, col_size + 5)    
  931.         self.listViewScheduledTasks.SetColumnWidth(2, col_size - 35)          
  932.         for sc in self._scheduledScans:
  933.            self._ListAddScheduledScan(sc)       
  934.            
  935.     def _EnableEmailAlertsControls(self, init):        
  936.         if init:
  937.             enable = self._config.Get('EmailAlerts', 'Enable') == '1'                        
  938.         else:
  939.             enable = self.checkBoxSMTPEnable.IsChecked()
  940.         self.textCtrlSMTPHost.Enable(enable)
  941.         self.intCtrlSMTPPort.Enable(enable)
  942.         self.textCtrlSMTPUser.Enable(enable)    
  943.         self.textCtrlSMTPPassword.Enable(enable)    
  944.         self.textCtrlSMTPFrom.Enable(enable)    
  945.         self.textCtrlSMTPTo.Enable(enable)    
  946.         self.textCtrlSMTPSubject.Enable(enable)  
  947.         self.buttonSendTestEmail.Enable(enable)          
  948.         
  949.     def _EmailAlertsPageInit(self):   
  950.         self.checkBoxSMTPEnable.SetValidator(MyValidator(config=self._config, section='EmailAlerts', value='Enable'))        
  951.         self.textCtrlSMTPHost.SetValidator(MyValidator(config=self._config, section='EmailAlerts', value='SMTPHost', canEmpty=False))        
  952.         self.intCtrlSMTPPort.SetValidator(MyValidator(config=self._config, section='EmailAlerts', value='SMTPPort', canEmpty=False))        
  953.         self.textCtrlSMTPUser.SetValidator(MyValidator(config=self._config, section='EmailAlerts', value='SMTPUser'))        
  954.         self.textCtrlSMTPPassword.SetValidator(MyValidator(config=self._config, section='EmailAlerts', value='SMTPPassword'))                            
  955.         self.textCtrlSMTPFrom.SetValidator(MyValidator(config=self._config, section='EmailAlerts', value='From'))                            
  956.         self.textCtrlSMTPTo.SetValidator(MyValidator(config=self._config, section='EmailAlerts', value='To', canEmpty=False))                            
  957.         self.textCtrlSMTPSubject.SetValidator(MyValidator(config=self._config, section='EmailAlerts', value='Subject'))                                    
  958.         self._EnableEmailAlertsControls(True)        
  959.     def _FilesPageInit(self):
  960.         self.textCtrlClamScan.SetValidator(MyValidator(config=self._config, section='ClamAV', value='ClamScan', canEmpty=False))  
  961.         self.textCtrlFreshClam.SetValidator(MyValidator(self._config, section='ClamAV', value='FreshClam', canEmpty=False))        
  962.         self.textCtrlVirDB.SetValidator(MyValidator(self._config, section='ClamAV', value='Database', canEmpty=False))                
  963.         
  964.     def _EnableArchivesControls(self, init):        
  965.         if init:
  966.             enable = self._config.Get('ClamAV', 'ScanArchives') == '1'                        
  967.         else:
  968.             enable = self.checkBoxScanArchives.IsChecked()
  969.         self.spinCtrlArchiveFiles.Enable(enable)
  970.         self.spinCtrlArchiveSize.Enable(enable)
  971.         self.spinCtrlRecursion.Enable(enable)    
  972.         
  973.     def _ArchivesPageInit(self):
  974.         self.checkBoxScanArchives.SetValidator(MyValidator(config=self._config, section='ClamAV', value='ScanArchives'))  
  975.         self.spinCtrlArchiveSize.SetValidator(MyValidator(self._config, section='ClamAV', value='MaxSize', canEmpty=False))        
  976.         self.spinCtrlArchiveFiles.SetValidator(MyValidator(self._config, section='ClamAV', value='MaxFiles', canEmpty=False))        
  977.         self.spinCtrlRecursion.SetValidator(MyValidator(self._config, section='ClamAV', value='MaxRecursion', canEmpty=False))        
  978.         self._EnableArchivesControls(True)
  979.         
  980.     def _ReportsPageInit(self):
  981.         self.textCtrlScanLogFile.SetValidator(MyValidator(config=self._config, section='ClamAV', value='LogFile', canEmpty=False))        
  982.         self.textCtrlUpdateLogFile.SetValidator(MyValidator(config=self._config, section='Updates', value='DBUpdateLogFile', canEmpty=False))        
  983.         if sys.platform.startswith('win') and self._config.Get('UI', 'Standalone') != '1':
  984.             self.checkBoxTrayNotify.SetValidator(MyValidator(config=self._config, section='UI', value='TrayNotify'))        
  985.         else:
  986.             self.checkBoxTrayNotify.Hide()
  987.                     
  988.     def _AdvancedPageInit(self):                
  989.         self.choicePriority.SetValidator(MyValidator(config=self._config, section='ClamAV', value='Priority'))
  990.         self.spinCtrlMaxLogSize.SetValidator(MyValidator(self._config, section='ClamAV', value='MaxLogSize', canEmpty=False))        
  991.         self.checkBoxEnableMbox.SetValidator(MyValidator(config=self._config, section='ClamAV', value='EnableMbox'))
  992.         self.checkBoxEnableOLE2.SetValidator(MyValidator(config=self._config, section='ClamAV', value='ScanOle2'))
  993.         self.checkBoxDetectBroken.SetValidator(MyValidator(config=self._config, section='ClamAV', value='DetectBroken'))
  994.         self.textCtrlAdditionalParams.SetValidator(MyValidator(config=self._config, section='ClamAV', value='ClamScanParams', canEmpty=True))        
  995.           
  996.     def _ListAddScheduledScan(self, sc, pos = -1):
  997.         if pos == -1:
  998.             pos = self.listViewScheduledTasks.GetItemCount()
  999.         self.listViewScheduledTasks.InsertImageStringItem(pos, sc.Description, 0)
  1000.         self.listViewScheduledTasks.SetStringItem(pos, 1, sc.Path)
  1001.         self.listViewScheduledTasks.SetStringItem(pos, 2, sc.Frequency)        
  1002.         item = self.listViewScheduledTasks.GetItem(pos)
  1003.         if sc.Active:
  1004.             item.SetTextColour(wxNullColour)
  1005.         else:
  1006.             item.SetTextColour(wxLIGHT_GREY)
  1007.         self.listViewScheduledTasks.SetItem(item)                  
  1008.     def OnCharHook(self, event):
  1009.         if event.GetKeyCode() == WXK_ESCAPE:
  1010.             self.EndModal(wxID_CANCEL)
  1011.         else:
  1012.             event.Skip()                
  1013.    
  1014.     def OnButtonBrowseFreshClam(self, event):
  1015.         if sys.platform.startswith("win"):
  1016.             filename = 'freshclam.exe'
  1017.             mask = "Executable files (*.exe)|*.exe|All files (*.*)|*.*"
  1018.         else:
  1019.             filename = 'freshclam'
  1020.             mask = "All files (*)|*"
  1021.         dlg = wxFileDialog(self, "Choose a file", ".", filename, mask, wxOPEN)
  1022.         try:
  1023.             if dlg.ShowModal() == wxID_OK:
  1024.                 filename = dlg.GetPath()                 
  1025.             self.textCtrlFreshClam.Clear()
  1026.             self.textCtrlFreshClam.WriteText(filename)   
  1027.         finally:
  1028.             dlg.Destroy()
  1029.             
  1030.     def OnButtonBrowseClamScan(self, event):
  1031.         if sys.platform.startswith("win"):
  1032.             filename = 'clamscan.exe'
  1033.             mask = "Executable files (*.exe)|*.exe|All files (*.*)|*.*"
  1034.         else:
  1035.             filename = 'clamscan'
  1036.             mask = "All files (*)|*"
  1037.         dlg = wxFileDialog(self, "Choose a file", ".", filename, mask, wxOPEN)
  1038.         try:
  1039.             if dlg.ShowModal() == wxID_OK:
  1040.                 filename = dlg.GetPath()  
  1041.                 self.textCtrlClamScan.Clear()
  1042.                 self.textCtrlClamScan.WriteText(filename)   
  1043.         finally:
  1044.             dlg.Destroy()
  1045.             
  1046.     def OnButtonBrowseVirDB(self, event):
  1047.         dlg = wxDirDialog(self)
  1048.         try:
  1049.             if dlg.ShowModal() == wxID_OK:
  1050.                 dir = dlg.GetPath()                            
  1051.                 self.textCtrlVirDB.Clear()
  1052.                 self.textCtrlVirDB.WriteText(dir)   
  1053.         finally:
  1054.             dlg.Destroy()
  1055.     def OnButtonBrowseScanLog(self, event):
  1056.         if sys.platform.startswith("win"):
  1057.             filename = 'ClamScanLog.txt'
  1058.             mask = "Text Files (*.txt)|*.txt|All files (*.*)|*.*"
  1059.         else:
  1060.             filename = 'ClamScanLog'
  1061.             mask = "All files (*)|*"
  1062.         dlg = wxFileDialog(self, "Choose a file", ".", filename, mask, wxSAVE)
  1063.         try:
  1064.             if dlg.ShowModal() == wxID_OK:
  1065.                 filename = dlg.GetPath()  
  1066.                 self.textCtrlScanLogFile.Clear()
  1067.                 self.textCtrlScanLogFile.WriteText(filename)   
  1068.         finally:
  1069.             dlg.Destroy()
  1070.             
  1071.     def OnButtonBrowseUpdateLog(self, event):
  1072.         if sys.platform.startswith("win"):
  1073.             filename = 'ClamUpdateLog.txt'
  1074.             mask = "Text Files (*.txt)|*.txt|All files (*.*)|*.*"
  1075.         else:
  1076.             filename = 'ClamUpdateLog'
  1077.             mask = "All files (*)|*"
  1078.         dlg = wxFileDialog(self, "Choose a file", ".", filename, mask, wxSAVE)
  1079.         try:
  1080.             if dlg.ShowModal() == wxID_OK:
  1081.                 filename = dlg.GetPath()  
  1082.                 self.textCtrlUpdateLogFile.Clear()
  1083.                 self.textCtrlUpdateLogFile.WriteText(filename)   
  1084.         finally:
  1085.             dlg.Destroy()
  1086.     def OnChoiceUpdateFrequency(self, event):        
  1087.         self._EnableInternetUpdateControls(False)
  1088.         event.Skip()
  1089.     def OnCheckBoxEnableAutoUpdate(self, event):
  1090.         self._EnableInternetUpdateControls(False)
  1091.         event.Skip()
  1092.             
  1093.         
  1094.     def OnCheckBoxScanArchives(self, event):
  1095.         self._EnableArchivesControls(False)
  1096.         event.Skip()
  1097.     def OnButtonAddScheduledScan(self, event):
  1098.         if self.listViewScheduledTasks.GetItemCount() > 20:
  1099.             MsgBox.ErrorBox(self, 'Maximum amount of schdeuled items (20) has been reached.')
  1100.             return
  1101.         sc = wxDialogScheduledScan.ScheduledScanInfo()    
  1102.         sc = wxDialogScheduledScan.ScheduledScanInfo()    
  1103.         dlg = wxDialogScheduledScan.wxDialogScheduledScan(self, sc)
  1104.         try:
  1105.             if dlg.ShowModal() == wxID_OK:
  1106.                self._scheduledScans.append(sc)
  1107.                self._ListAddScheduledScan(sc)       
  1108.                id = self.listViewScheduledTasks.GetItemCount() - 1
  1109.                self.listViewScheduledTasks.Select(id)                                      
  1110.         finally:            
  1111.             dlg.Destroy()        
  1112.     def OnButtonRemoveScheduledScan(self, event):
  1113.         id = self.listViewScheduledTasks.GetFirstSelected()        
  1114.         if id != -1:
  1115.             del self._scheduledScans[id]
  1116.             self.listViewScheduledTasks.DeleteItem(id)
  1117.             if self.listViewScheduledTasks.GetItemCount():
  1118.                 if id > 0:
  1119.                     id -= 1                  
  1120.                 self.listViewScheduledTasks.Select(id)                        
  1121.         
  1122.     def OnButtonEditScheduledScan(self, event):
  1123.         id = self.listViewScheduledTasks.GetFirstSelected()
  1124.         if id != -1:
  1125.             sc = self._scheduledScans[id]
  1126.             dlg = wxDialogScheduledScan.wxDialogScheduledScan(self, sc)
  1127.             try:
  1128.                 if dlg.ShowModal() == wxID_OK:
  1129.                     self.listViewScheduledTasks.DeleteItem(id)
  1130.                     self._ListAddScheduledScan(sc, id)                    
  1131.                     item = self.listViewScheduledTasks.GetItem(id)
  1132.                     if sc.Active:
  1133.                         item.SetTextColour(wxNullColour)
  1134.                     else:
  1135.                         item.SetTextColour(wxLIGHT_GREY)
  1136.                     self.listViewScheduledTasks.SetItem(item)                  
  1137.                     self.listViewScheduledTasks.Select(id)                      
  1138.                     self._scheduledScans[id] = sc        
  1139.             finally:            
  1140.                 dlg.Destroy()             
  1141.                    
  1142.     def UpdateScheduledTasksButtons(self):
  1143.         selected = self.listViewScheduledTasks.GetFirstSelected()
  1144.         enabled = (selected != -1)
  1145.         self.buttonTaskEdit.Enable(enabled)
  1146.         self.buttonTaskRemove.Enable(enabled)
  1147.         if selected != -1:            
  1148.             sc = self._scheduledScans[selected]                    
  1149.             self.buttonTaskActivate.Enable(not sc.Active)
  1150.             self.buttonTaskDeactivate.Enable(sc.Active)
  1151.         else:
  1152.             self.buttonTaskActivate.Enable(False)
  1153.             self.buttonTaskDeactivate.Enable(False)
  1154.         
  1155.     def OnScheduledTasksUpdate(self, event):
  1156.         self.UpdateScheduledTasksButtons()
  1157.         event.Skip()
  1158.     def OnRadioInfected(self, event):
  1159.         self._EnableOptionsControls(False)
  1160.         
  1161.     def OnButtonBrowseQuarantine(self, event):
  1162.         dlg = wxDirDialog(self)
  1163.         try:
  1164.             if dlg.ShowModal() == wxID_OK:
  1165.                 dir = dlg.GetPath()                            
  1166.                 self.textCtrlQuarantine.Clear()
  1167.                 self.textCtrlQuarantine.WriteText(dir)   
  1168.         finally:
  1169.             dlg.Destroy()
  1170.     
  1171.     def OnCheckBoxSMTPEnable(self, event):
  1172.         self._EnableEmailAlertsControls(False)
  1173.     def OnButtonSendTestEmail(self, event):        
  1174.         self.SetCursor(wxStockCursor(wxCURSOR_WAIT))
  1175.         try:
  1176.             msg = EmailAlert.VirusAlertMsg(self.textCtrlSMTPFrom.GetValue(), 
  1177.                             self.textCtrlSMTPTo.GetValue(),
  1178.                             self.textCtrlSMTPSubject.GetValue() + ' (Testing)',
  1179.                             self.textCtrlSMTPHost.GetValue(),
  1180.                             self.intCtrlSMTPPort.GetValue(),
  1181.                             self.textCtrlSMTPUser.GetValue(),
  1182.                             self.textCtrlSMTPPassword.GetValue(),
  1183.                             Body='This is a test message sent during configuration of ClamWin Free Antivirus on the following computer: %s.n'
  1184.                                 'Please do not be alarmed.n' % Utils.GetHostName())
  1185.             status, msg = msg.Send(True)            
  1186.             if not status:
  1187.                 raise Exception(msg)
  1188.             MsgBox.InfoBox(self, 'Test Email has been sent successfully.')
  1189.         except Exception, e:
  1190.             MsgBox.ErrorBox(self, 'Could not send the email. Please ensure you are connected to the internet. Error: %s' % str(e))
  1191.         self.SetCursor(wxNullCursor)
  1192.     def OnEditableListBoxChar(self, event):
  1193.         # bind F2 key to edit label function
  1194.         if event.GetKeyCode() == WXK_F2:            
  1195.             listCtrl = event.GetEventObject()
  1196.             selected = listCtrl.GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED)           
  1197.             if selected != -1:                   
  1198.                 listCtrl.EditLabel(selected)  
  1199.         else:
  1200.             event.Skip()
  1201.             
  1202.     def OnButtonTaskActivate(self, event):        
  1203.         selected = self.listViewScheduledTasks.GetFirstSelected()
  1204.         if selected != -1:
  1205.             self._scheduledScans[selected].Active = True
  1206.         item = self.listViewScheduledTasks.GetItem(selected)
  1207.         item.SetTextColour(wxNullColour)
  1208.         self.listViewScheduledTasks.SetItem(item)
  1209.         self.UpdateScheduledTasksButtons()
  1210.                     
  1211.     def OnButtonTaskDeactivate(self, event):        
  1212.         selected = self.listViewScheduledTasks.GetFirstSelected()
  1213.         if selected != -1:
  1214.             self._scheduledScans[selected].Active = False
  1215.         item = self.listViewScheduledTasks.GetItem(selected)
  1216.         item.SetTextColour(wxLIGHT_GREY)
  1217.         self.listViewScheduledTasks.SetItem(item)
  1218.         self.UpdateScheduledTasksButtons()
  1219.     def OnCheckBoxCheckVersionCheckbox(self, event):
  1220.         event.Skip()
  1221. class MyBaseValidator(wxPyValidator):
  1222.      def __init__(self, config, section, value, canEmpty=True):          
  1223.          wxPyValidator.__init__(self)         
  1224.          self._config = config
  1225.          self._section = section
  1226.          self._value = value                
  1227.          self._canEmpty = canEmpty
  1228.          
  1229.      def Clone(self):                  
  1230.          return self.__class__(self._config, self._section, self._value, self._canEmpty)
  1231.      
  1232.      def Validate(self, win):
  1233.          return True
  1234.      
  1235. class MyWeekDayValidator(MyBaseValidator):          
  1236.      def TransferToWindow(self):         
  1237.          value = self._config.Get(self._section, self._value)
  1238.          if not len(value):
  1239.              value = ''
  1240.          ctrl = self.GetWindow()                                           
  1241.          ctrl.SetSelection(int(value))         
  1242.          
  1243.      def TransferFromWindow(self):
  1244.          ctrl = self.GetWindow()
  1245.          value = ctrl.GetSelection()                  
  1246.          self._config.Set(self._section, self._value, str(value)) 
  1247.          
  1248.             
  1249. class MyValidator(MyBaseValidator):     
  1250.     def Validate(self, win):         
  1251.         ctrl = self.GetWindow()
  1252.         if not ctrl.IsEnabled():
  1253.             return True
  1254.         if isinstance(ctrl, (wxChoice, wxCheckBox, wxRadioButton)) or self._canEmpty:
  1255.             return True   
  1256.         if isinstance(ctrl, (wxIntCtrl, wxSpinCtrl)):     
  1257.             text = str(ctrl.GetValue())
  1258.         else:
  1259.             text = ctrl.GetValue()
  1260.         if len(text) == 0:
  1261.             page = self.GetWindow().GetParent()
  1262.             wxMessageBox("Value cannot be empty", "ClamWin Free Antivirus", style=wxICON_EXCLAMATION|wxOK)
  1263.             ctrl.SetBackgroundColour("yellow")
  1264.             ctrl.SetFocus()
  1265.             ctrl.Refresh()
  1266.             return False
  1267.         else:
  1268.             ctrl.SetBackgroundColour(wxSystemSettings_GetColour(wxSYS_COLOUR_WINDOW))
  1269.             ctrl.Refresh()             
  1270.             return True
  1271.         
  1272.     def TransferToWindow(self):
  1273.         value = self._config.Get(self._section, self._value)
  1274.         ctrl = self.GetWindow()                     
  1275.         if isinstance(ctrl, (wxIntCtrl, wxCheckBox, wxRadioButton, wxSpinCtrl, wxIntCtrl)):            
  1276.             value = int(value)            
  1277.         else:
  1278.             if not len(value):
  1279.                value = ''         
  1280.                               
  1281.         if(isinstance(ctrl, wxChoice)):
  1282.             ctrl.SetStringSelection(value)
  1283.         else:
  1284.             ctrl.SetValue(value)         
  1285.         
  1286.     def TransferFromWindow(self):
  1287.         ctrl = self.GetWindow()
  1288.         if(isinstance(ctrl, wxChoice)):
  1289.             value = ctrl.GetStringSelection()         
  1290.         elif isinstance(ctrl, (wxCheckBox, wxRadioButton, wxIntCtrl, wxSpinCtrl)):
  1291.             value = str(ctrl.GetValue())            
  1292.         elif isinstance(ctrl, wxTimeCtrl):
  1293.             # set C locale, otherwise python and wxpython complain
  1294.             locale.setlocale(locale.LC_ALL, 'C')            
  1295.             value = ctrl.GetWxDateTime().Format('%H:%M:%S')
  1296.         else:
  1297.             value = ctrl.GetValue()         
  1298.         
  1299.         if self._config is not None:            
  1300.             self._config.Set(self._section, self._value, value)         
  1301.     
  1302.         
  1303. class MyFolderPromptCreateValidator(MyValidator):     
  1304.     def Validate(self, win):  
  1305.         if not self.GetWindow().IsEnabled():
  1306.             return True
  1307.         if not MyValidator.Validate(self, win):       
  1308.             return False
  1309.         ctrl = self.GetWindow()
  1310.         path = ctrl.GetValue()
  1311.         # offer to create a folder if it doesn't exist
  1312.         if not os.path.isdir(path):
  1313.             main_win = win.GetParent()
  1314.             choice = MsgBox.MessageBox(main_win, 'ClamWin Free Antivirus', 
  1315.                         'The folder you selected does not exist. Would you like to create %s now?' % path, 
  1316.                         wxYES_NO  | wxICON_QUESTION)
  1317.             if choice == wxID_YES:
  1318.                 try:
  1319.                     os.mkdir(path)
  1320.                 except Exception, e:
  1321.                     MsgBox.ErrorBox(main_win, 'Unable to create folder %s. Error: %s' % (path, str(e)))                  
  1322.         return True
  1323. class MyPatternValidator(MyBaseValidator):     
  1324.     def Validate(self, win):         
  1325.         ctrl = self.GetWindow()
  1326.         if not ctrl.IsEnabled() or self._canEmpty:
  1327.             return True
  1328.         strings = ctrl.GetStrings()
  1329.         if len(strings) == 0:
  1330.             page = self.GetWindow().GetParent()
  1331.             wxMessageBox("Value cannot be empty", "ClamWin Free Antivirus", style=wxICON_EXCLAMATION|wxOK)            
  1332.             ctrl.GetListCtrl().SetBackgroundColour("yellow")
  1333.             ctrl.SetFocus()
  1334.             ctrl.Refresh()            
  1335.             return False
  1336.         else:
  1337.             ctrl.SetBackgroundColour(wxSystemSettings_GetColour(wxSYS_COLOUR_WINDOW))            
  1338.             return True
  1339.         
  1340.     def TransferToWindow(self):
  1341.         strings = self._config.Get(self._section, self._value)
  1342.         if len(strings) > 0:            
  1343.             self.GetWindow().SetStrings(strings.split(Config.REGEX_SEPARATOR))        
  1344.             
  1345.     def TransferFromWindow(self):
  1346.         # need this trick to enable saving edited label
  1347.         # when ok is clicked  
  1348.         self.GetWindow().GetListCtrl().EditLabel(0)
  1349.         value = Config.REGEX_SEPARATOR.join(self.GetWindow().GetStrings())
  1350.         if self._config is not None:            
  1351.             self._config.Set(self._section, self._value, value)