objects.gui.appOptions.appOptions Class Reference

Code generated by "Boa Constructor". More...

List of all members.

Public Member Functions

def __init__
def loadConfiguration
 Sets GUI controls to match optionsConfigurator settings.
def disableIdentIPControls
 Disables all the various "IP Address Geographical Info" boxes when the user clicks on the "Identify Self using Coordinates" radio button.
def enableIdentIPControls
 Enables all the various "IP Address Geographical Info" boxes when the user clicks on the "Identify Self using IP Address" radio button.
def disableIdentCoordControls
 Disables all the various Coordinate boxes when the user clicks on the "Identify Self using IP Address" radio button.
def enableIdentCoordControls
 Enables all the various Coordinate boxes when the user clicks on the "Identify Self using IP Coordinates" radio button.
def OnButtonCancelButton
 "Cancel" Button handler
def OnButtonApplyButton
 "Apply" Button handler
def OnButtonLocateIPButton
 "Locate Address" Button handler
def getDBIsp
 Returns the Unicode representation of the ISP name.
def getDBOrganization
 Returns the Unicode representation of the Organization Name.
def OnRadioButtonByIPAddressRadiobutton
 "Identify Self using IP Address" Button handler.
def OnRadioButtonByCoordRadiobutton
 "Identify Self using Coordinates" Button handler.
def getConfigValid
 Returns True if the configuration is valid given the chosen identification method (i.e.
def getIdentifyByIP
 Returns the state of the "Identify Self using IP Address" radio button.
def getIndentifyByCoord
 Returns the state of the "Identify Self using Coordinates" radio button.
def getIPAddress
 Returns the IP Address value from the IP Address control box.
def getIPGeoInfo
 Returns a tuple containing all the values of the Geographical Info boxes.
def getCoordinates
 Returns a tuple containing the values of the coordinate boxes .
def OnRadioButtonDisableTraceRadiobutton
 Disable the traffic recording controls.
def OnRadioButtonEnableTraceRadiobutton
 Enable the traffic recording controls.
def OnCheckBoxUnlimitedCaptureCheckbox
 "Never Stop Recording" CheckBox handler.
def enableTrafficRecordingControls
 Enable the traffic recording controls (helper method).
def disableTrafficRecordingControls
 Disable the traffic recording controls (helper method).
def getNetworkMaxStorage
 Returns the value of the Max size of the trace file.
def getNetworkUnlimitedCapture
 Returns the value of "Never Stop Recording" CheckBox.
def getNetworkRecordTraffic

Public Attributes

 notebookOptions
 buttonCancel
 buttonApply
 panelIndentification
 radioButtonByIPAddress
 radioButtonByCoord
 staticTextIPAddr
 buttonLocateIP
 staticTextLon
 staticTextLat
 ipAddrCtrlSelfIP
 staticTextInfoLon
 staticTextInfoLat
 staticTextInfoCity
 staticTextInfoStateProv
 staticTextInfoCountry
 staticTextOrg
 staticTextInfoISP
 textCtrlInfoCity
 textCtrlInfoLon
 textCtrlInfoISP
 textCtrlInfoLat
 staticBox1
 textCtrlInfoStatProv
 textCtrlInfoCountry
 textCtrlInfoOrg
 numCtrlLongitude
 numCtrlLatitude
 panelNetTrace
 radioButtonDisableTrace
 radioButtonEnableTrace
 intCtrlMaxStorage
 genStaticTextStopCapturing
 genStaticTextMB
 checkBoxUnlimitedCapture
 geoIPDB
 ipAddrValid
 networkSettingsChanged
 coordValid


Detailed Description

Code generated by "Boa Constructor".

This class should be edited using the Boa Constructor IDE. Minimal inline documentation will be provided for this class as it may interfere with the automatic code generation.

The appOptions class represents the applications's 'Options' window

Definition at line 53 of file appOptions.py.


Member Function Documentation

def objects.gui.appOptions.appOptions.__init__ (   self,
  parent,
  geoIPDatabase 
)

Definition at line 314 of file appOptions.py.

00314                                              :
00315         self._init_ctrls(parent)
00316         self.geoIPDB = geoIPDatabase
00317         
00318         self.ipAddrValid = False
00319     
00320     
    ## Sets GUI controls to match optionsConfigurator settings. This method is called when the window is initializing.

def objects.gui.appOptions.appOptions.disableIdentCoordControls (   self  ) 

Disables all the various Coordinate boxes when the user clicks on the "Identify Self using IP Address" radio button.

Definition at line 421 of file appOptions.py.

00421                                        :
00422         self.numCtrlLongitude.Disable()
00423         self.numCtrlLatitude.Disable()
00424     
00425     
00426     
    ## Enables all the various Coordinate boxes when

def objects.gui.appOptions.appOptions.disableIdentIPControls (   self  ) 

Disables all the various "IP Address Geographical Info" boxes when the user clicks on the "Identify Self using Coordinates" radio button.

Definition at line 391 of file appOptions.py.

00391                                     :
00392         self.ipAddrCtrlSelfIP.Disable()
00393         
00394         self.textCtrlInfoLon.Disable()
00395         self.textCtrlInfoLat.Disable()
00396         self.textCtrlInfoCity.Disable()
00397         self.textCtrlInfoStatProv.Disable()
00398         self.textCtrlInfoCountry.Disable()
00399         self.textCtrlInfoOrg.Disable()
00400         self.textCtrlInfoISP.Disable()
00401     
00402     
00403     
    ## Enables all the various "IP Address Geographical Info" boxes when

def objects.gui.appOptions.appOptions.disableTrafficRecordingControls (   self  ) 

Disable the traffic recording controls (helper method).

Definition at line 665 of file appOptions.py.

00665                                              :
00666         self.checkBoxUnlimitedCapture.Disable()
00667         self.intCtrlMaxStorage.Disable()
00668         
00669         
00670         
    ## Returns the value of the Max size of the trace file

def objects.gui.appOptions.appOptions.enableIdentCoordControls (   self  ) 

Enables all the various Coordinate boxes when the user clicks on the "Identify Self using IP Coordinates" radio button.

Definition at line 429 of file appOptions.py.

00429                                       :
00430         self.numCtrlLongitude.Enable()
00431         self.numCtrlLatitude.Enable()
00432        
00433         
00434         
    ## "Cancel" Button handler

def objects.gui.appOptions.appOptions.enableIdentIPControls (   self  ) 

Enables all the various "IP Address Geographical Info" boxes when the user clicks on the "Identify Self using IP Address" radio button.

Definition at line 406 of file appOptions.py.

00406                                    :
00407         self.ipAddrCtrlSelfIP.Enable()
00408         
00409         self.textCtrlInfoLon.Enable()
00410         self.textCtrlInfoLat.Enable()
00411         self.textCtrlInfoCity.Enable()
00412         self.textCtrlInfoStatProv.Enable()
00413         self.textCtrlInfoCountry.Enable()
00414         self.textCtrlInfoOrg.Enable()
00415         self.textCtrlInfoISP.Enable()
00416     
00417     
00418     
    ## Disables all the various Coordinate boxes when

def objects.gui.appOptions.appOptions.enableTrafficRecordingControls (   self  ) 

Enable the traffic recording controls (helper method).

Definition at line 656 of file appOptions.py.

00656                                             :
00657         self.checkBoxUnlimitedCapture.Enable()
00658         self.intCtrlMaxStorage.Enable()
00659         
00660         self.OnCheckBoxUnlimitedCaptureCheckbox(None)
00661     
00662     
00663     
    ## Disable the traffic recording controls (helper method). 

def objects.gui.appOptions.appOptions.getConfigValid (   self  ) 

Returns True if the configuration is valid given the chosen identification method (i.e.

By IP Addr or by Coord).

Returns:
Boolean

Definition at line 573 of file appOptions.py.

00573                             :
00574         if self.radioButtonByIPAddress.GetValue() == True and self.ipAddrCtrlSelfIP.IsValid() == True:
00575             return True
00576         
00577         if self.radioButtonByCoord.GetValue() == True:
00578             if self.numCtrlLongitude.IsValid() == True and self.numCtrlLatitude.IsValid() == True:
00579                 return True;
00580             
00581         return False
00582     
00583     
00584     
    ## Returns the state of the "Identify Self using IP Address" radio button.

def objects.gui.appOptions.appOptions.getCoordinates (   self  ) 

Returns a tuple containing the values of the coordinate boxes .

Returns:
Tuple

Definition at line 619 of file appOptions.py.

00619                             :
00620         return (str(self.numCtrlLongitude.GetValue()), 
00621                 str(self.numCtrlLatitude.GetValue()))
00622     
00623         
00624     """
        network tab related

def objects.gui.appOptions.appOptions.getDBIsp (   self  ) 

Returns the Unicode representation of the ISP name.

Returns:
String

Definition at line 538 of file appOptions.py.

00538                       :        
00539         return unicode(self.geoIPDB.isp)
00540     
00541     
00542     

def objects.gui.appOptions.appOptions.getDBOrganization (   self  ) 

Returns the Unicode representation of the Organization Name.

Returns:
String

Definition at line 545 of file appOptions.py.

00545                                :
00546         return unicode(self.geoIPDB.organization)
00547         
00548         
00549         
    ## "Identify Self using IP Address" Button handler.

def objects.gui.appOptions.appOptions.getIdentifyByIP (   self  ) 

Returns the state of the "Identify Self using IP Address" radio button.

Returns:
Radio Button Value

Definition at line 587 of file appOptions.py.

00587                              :
00588         return self.radioButtonByIPAddress.GetValue()
00589 
00590     
00591     
    ## Returns the state of the "Identify Self using Coordinates" radio button.

def objects.gui.appOptions.appOptions.getIndentifyByCoord (   self  ) 

Returns the state of the "Identify Self using Coordinates" radio button.

Returns:
Radio Button Value

Definition at line 594 of file appOptions.py.

00594                                  :
00595         return self.radioButtonByCoord.GetValue()
00596     
00597     
    ## Returns the IP Address value from the IP Address control box.

def objects.gui.appOptions.appOptions.getIPAddress (   self  ) 

Returns the IP Address value from the IP Address control box.

Returns:
"IP Address Control" Value

Definition at line 600 of file appOptions.py.

00600                           :
00601         return self.ipAddrCtrlSelfIP.GetAddress()
00602     
00603     
    ## Returns a tuple containing all the values of the Geographical Info boxes.

def objects.gui.appOptions.appOptions.getIPGeoInfo (   self  ) 

Returns a tuple containing all the values of the Geographical Info boxes.

Returns:
Tuple

Definition at line 606 of file appOptions.py.

00606                           :
00607         return (self.textCtrlInfoLon.GetValue(),  
00608                 self.textCtrlInfoLat.GetValue(),
00609                 self.textCtrlInfoCity.GetValue(),
00610                 self.textCtrlInfoStatProv.GetValue(),
00611                 self.textCtrlInfoCountry.GetValue(),
00612                 self.textCtrlInfoOrg.GetValue(),
00613                 self.textCtrlInfoISP.GetValue())
00614     
00615     
00616     
    ## Returns a tuple containing the values of the coordinate boxes . 

def objects.gui.appOptions.appOptions.getNetworkMaxStorage (   self  ) 

Returns the value of the Max size of the trace file.

Returns:
String

Definition at line 673 of file appOptions.py.

00673                                   :
00674         return self.intCtrlMaxStorage.GetValue()
00675     
00676     
00677     
    ## Returns the value of "Never Stop Recording" CheckBox

def objects.gui.appOptions.appOptions.getNetworkRecordTraffic (   self  ) 

Definition at line 685 of file appOptions.py.

00685                                      :
00686         return self.radioButtonEnableTrace.GetValue() 
00687        
00688         
        

def objects.gui.appOptions.appOptions.getNetworkUnlimitedCapture (   self  ) 

Returns the value of "Never Stop Recording" CheckBox.

Returns:
CheckBox Value

Definition at line 680 of file appOptions.py.

00680                                         :
00681         return self.checkBoxUnlimitedCapture.GetValue()
00682     
00683     
00684     
    def getNetworkRecordTraffic(self):

def objects.gui.appOptions.appOptions.loadConfiguration (   self,
  optConf 
)

Sets GUI controls to match optionsConfigurator settings.

This method is called when the window is initializing.

Parameters:
optConf optionsConfigurator object which reads various options from INI file

Definition at line 323 of file appOptions.py.

00323                                         :
00324         
00325         if optConf.ident_getIdentByIPAddr() == True:
00326             self.radioButtonByIPAddress.SetValue(True)
00327             self.disableIdentCoordControls()
00328             self.buttonLocateIP.Enable()
00329         else:
00330             self.radioButtonByCoord.SetValue(True)
00331             self.disableIdentIPControls()
00332             self.buttonLocateIP.Disable()
00333             
00334         # populate the IP address field        
00335         ipAddr =  optConf.ident_getIPAddr()
00336         
00337         if ipAddr != "":
00338             self.ipAddrValid = True
00339             self.ipAddrCtrlSelfIP.SetValue(ipAddr)
00340         
00341         # now populate the info window
00342         lon, lat, city, stateProv, country, org, ISP = optConf.ident_getIPGeoInfo()     
00343     
00344         self.textCtrlInfoLon.Clear()
00345         self.textCtrlInfoLat.Clear()
00346         self.textCtrlInfoCity.Clear()
00347         self.textCtrlInfoStatProv.Clear()
00348         self.textCtrlInfoCountry.Clear()
00349         self.textCtrlInfoOrg.Clear()
00350         self.textCtrlInfoISP.Clear()
00351         
00352         self.textCtrlInfoLon.WriteText(lon)
00353         self.textCtrlInfoLat.WriteText(lat)
00354         self.textCtrlInfoCity.WriteText(city)
00355         self.textCtrlInfoStatProv.WriteText(stateProv)
00356         self.textCtrlInfoCountry.WriteText(country)
00357         self.textCtrlInfoOrg.WriteText(org)
00358         self.textCtrlInfoISP.WriteText(ISP)
00359         
00360         #next populate the lon/lat fields
00361         selfLon, selfLat = optConf.ident_getManualCoord()
00362         
00363         self.numCtrlLongitude.SetValue(selfLon)        
00364         self.numCtrlLatitude.SetValue(selfLat)
00365         
00366         #finally load populate the network values
00367         dontStopRecording = optConf.network_getNeverStopRecording()
00368         if dontStopRecording == True:
00369             self.checkBoxUnlimitedCapture.SetValue(True)
00370             self.checkBoxUnlimitedCapture.Disable()
00371         else:
00372             self.checkBoxUnlimitedCapture.SetValue(False)
00373             self.checkBoxUnlimitedCapture.Enable()
00374             
00375         recordFlag = optConf.network_getRecordTraffic()
00376         
00377         if recordFlag == False:
00378             self.radioButtonDisableTrace.SetValue(True)
00379             self.disableTrafficRecordingControls()
00380         else:
00381             self.radioButtonEnableTrace.SetValue(True)
00382             self.enableTrafficRecordingControls()
00383             
00384         self.intCtrlMaxStorage.SetValue(optConf.network_getRecordingMaxLimit())
00385         self.networkSettingsChanged = False
00386     
00387     
00388     
    ## Disables all the various "IP Address Geographical Info" boxes when

def objects.gui.appOptions.appOptions.OnButtonApplyButton (   self,
  event 
)

"Apply" Button handler

Parameters:
event Standard wx.Button event

Definition at line 444 of file appOptions.py.

00444                                         :
00445         
00446         if self.radioButtonByIPAddress.GetValue() == True:
00447             self.OnButtonLocateIPButton(None, False)
00448             if self.ipAddrCtrlSelfIP.IsValid() == False or self.ipAddrCtrlSelfIP.GetAddress() == "...":
00449                 dlg = wx.MessageDialog(None, "You must supply a valid IP Addresss", 'Error', wx.ICON_ERROR)
00450                 result = dlg.ShowModal()
00451                 dlg.Destroy()
00452                 return
00453             
00454         if self.ipAddrCtrlSelfIP.IsValid() == False and self.ipAddrCtrlSelfIP.GetAddress() != "...":
00455             self.ipAddrValid = False
00456             dlg = wx.MessageDialog(None, "The supplied IP Address is not valid, and will not be saved", 'Error', wx.ICON_ERROR)
00457             result = dlg.ShowModal()
00458             dlg.Destroy()
00459         else:
00460             self.ipAddrValid = True
00461             
00462         if not self.numCtrlLongitude.IsValid() or not self.numCtrlLatitude.IsValid():
00463             self.coordValid = False
00464             dlg = wx.MessageDialog(None, "The supplied Coordinates are not valid, and will not be saved", 'Error', wx.ICON_ERROR)
00465             result = dlg.ShowModal()
00466             dlg.Destroy()
00467         else:
00468             self.coordValid = True
00469               
00470         return self.EndModal(wx.ID_OK)
00471            
00472         
00473         
    ## "Locate Address" Button handler

def objects.gui.appOptions.appOptions.OnButtonCancelButton (   self,
  event 
)

"Cancel" Button handler

Parameters:
event Standard wx.Button event

Definition at line 437 of file appOptions.py.

00437                                          :
00438         return self.EndModal(wx.ID_CANCEL)
00439     
00440     
00441     
    ## "Apply" Button handler

def objects.gui.appOptions.appOptions.OnButtonLocateIPButton (   self,
  event,
  validate = True 
)

"Locate Address" Button handler

Parameters:
event Standard wx.Button event
validate If set the true, this method will complain if the IP Address is not in valid form

Definition at line 477 of file appOptions.py.

00477                                                           :        
00478         if validate == True:
00479             if self.ipAddrCtrlSelfIP.IsValid() == False:            
00480                 dlg = wx.MessageDialog(None, "The IP Address is not valid.", 'Error', wx.ICON_ERROR)
00481                 result = dlg.ShowModal()
00482                 dlg.Destroy()
00483                 return
00484             
00485         ipAddr = self.ipAddrCtrlSelfIP.GetAddress()
00486 
00487         if validate == True:
00488             if ipAddr == "...":
00489                 dlg = wx.MessageDialog(None, "You did not supply an IP Address.", 'Error', wx.ICON_ERROR)
00490                 result = dlg.ShowModal()
00491                 dlg.Destroy()
00492                 return
00493         
00494         self.geoIPDB.find_by_addr(ipAddr)
00495         
00496         # populate the various list controls
00497         self.textCtrlInfoLon.Clear()
00498         self.textCtrlInfoLat.Clear()
00499         self.textCtrlInfoCity.Clear()
00500         self.textCtrlInfoStatProv.Clear()
00501         self.textCtrlInfoCountry.Clear()
00502         self.textCtrlInfoISP.Clear()
00503         self.textCtrlInfoOrg.Clear()
00504         
00505         self.textCtrlInfoLon.WriteText(str(self.geoIPDB.longitude))
00506         self.textCtrlInfoLat.WriteText(str(self.geoIPDB.latitude))
00507         self.textCtrlInfoCity.WriteText(self.geoIPDB.city)
00508         self.textCtrlInfoStatProv.WriteText("")
00509         self.textCtrlInfoCountry.WriteText(self.geoIPDB.country_name)        
00510         self.textCtrlInfoISP.WriteText(self.getDBIsp())
00511         self.textCtrlInfoOrg.WriteText(self.getDBOrganization())
00512         
00513         
00514         #determine if this is an exact or partial match
00515         if validate == True:
00516             if self.geoIPDB.country_name == "Local Area Network":
00517                 dlg = wx.MessageDialog(None, "The IP Address you entered is a local IP.\nYou must use a valid external IP Address (i.e. not in a 192.168.x.x or 172.16.x.x format)", 'Error', wx.ICON_ERROR)
00518                 result = dlg.ShowModal()
00519                 dlg.Destroy()
00520                 return
00521             
00522             if self.geoIPDB.city == "" and (self.geoIPDB.longitude != 0 or self.geoIPDB.latitude != 0): 
00523                 dlg = wx.MessageDialog(None, "Could not determine exact location of the supplied IP Address.\nYou may want to set your home location manually", 'Error', wx.ICON_ERROR)
00524                 result = dlg.ShowModal()
00525                 dlg.Destroy()
00526                 return
00527             
00528             if self.geoIPDB.city == "" and (self.geoIPDB.longitude == 0 and self.geoIPDB.latitude == 0): 
00529                 dlg = wx.MessageDialog(None, "Could not locate the supplied IP Address.\nYou may want to set your home location manually", 'Error', wx.ICON_ERROR)
00530                 result = dlg.ShowModal()
00531                 dlg.Destroy()
00532                 return
00533      
00534     
00535     

def objects.gui.appOptions.appOptions.OnCheckBoxUnlimitedCaptureCheckbox (   self,
  event 
)

"Never Stop Recording" CheckBox handler.

Parameters:
event Standard wx.Button event

Definition at line 646 of file appOptions.py.

00646                                                        :
00647         self.networkSettingsChanged = True
00648         if self.checkBoxUnlimitedCapture.GetValue() == True:       
00649             self.intCtrlMaxStorage.Disable()
00650         else:
00651             self.intCtrlMaxStorage.Enable()
00652       
00653         
00654     
    ## Enable the traffic recording controls (helper method).  

def objects.gui.appOptions.appOptions.OnRadioButtonByCoordRadiobutton (   self,
  event 
)

"Identify Self using Coordinates" Button handler.

Parameters:
event Standard wx.Button event

Definition at line 561 of file appOptions.py.

00561                                                     :
00562         self.disableIdentIPControls()
00563         self.enableIdentCoordControls()
00564         self.buttonLocateIP.Disable()
00565     
00566     
00567     #
    # Getters

def objects.gui.appOptions.appOptions.OnRadioButtonByIPAddressRadiobutton (   self,
  event 
)

"Identify Self using IP Address" Button handler.

Parameters:
event Standard wx.Button event

Definition at line 552 of file appOptions.py.

00552                                                         :
00553         self.enableIdentIPControls()
00554         self.disableIdentCoordControls()
00555         self.buttonLocateIP.Enable()        
00556     
00557 
00558 
    ## "Identify Self using Coordinates" Button handler.

def objects.gui.appOptions.appOptions.OnRadioButtonDisableTraceRadiobutton (   self,
  event 
)

Disable the traffic recording controls.

Parameters:
event Standard wx.Button event

Definition at line 630 of file appOptions.py.

00630                                                          :         
00631         self.disableTrafficRecordingControls()
00632         self.networkSettingsChanged = True
00633     
00634 
00635 

def objects.gui.appOptions.appOptions.OnRadioButtonEnableTraceRadiobutton (   self,
  event 
)

Enable the traffic recording controls.

Parameters:
event Standard wx.Button event

Definition at line 638 of file appOptions.py.

00638                                                         :
00639         self.enableTrafficRecordingControls()
00640         self.networkSettingsChanged = True
00641     
00642 
00643 
    ## "Never Stop Recording" CheckBox handler.


Member Data Documentation

Definition at line 82 of file appOptions.py.

Definition at line 76 of file appOptions.py.

Definition at line 120 of file appOptions.py.

Definition at line 302 of file appOptions.py.

Definition at line 463 of file appOptions.py.

Definition at line 298 of file appOptions.py.

Definition at line 292 of file appOptions.py.

Definition at line 316 of file appOptions.py.

Definition at line 284 of file appOptions.py.

Definition at line 138 of file appOptions.py.

Definition at line 318 of file appOptions.py.

Definition at line 385 of file appOptions.py.

Definition at line 70 of file appOptions.py.

Definition at line 247 of file appOptions.py.

Definition at line 235 of file appOptions.py.

Definition at line 88 of file appOptions.py.

Definition at line 258 of file appOptions.py.

Definition at line 106 of file appOptions.py.

Definition at line 96 of file appOptions.py.

Definition at line 264 of file appOptions.py.

Definition at line 275 of file appOptions.py.

Definition at line 208 of file appOptions.py.

Definition at line 155 of file appOptions.py.

Definition at line 167 of file appOptions.py.

Definition at line 179 of file appOptions.py.

Definition at line 149 of file appOptions.py.

Definition at line 143 of file appOptions.py.

Definition at line 161 of file appOptions.py.

Definition at line 115 of file appOptions.py.

Definition at line 132 of file appOptions.py.

Definition at line 127 of file appOptions.py.

Definition at line 173 of file appOptions.py.

Definition at line 184 of file appOptions.py.

Definition at line 222 of file appOptions.py.

Definition at line 195 of file appOptions.py.

Definition at line 202 of file appOptions.py.

Definition at line 190 of file appOptions.py.

Definition at line 228 of file appOptions.py.

Definition at line 216 of file appOptions.py.


The documentation for this class was generated from the following file:

Generated on Mon Mar 30 00:26:15 2009 for EyeSpy by  doxygen 1.5.8