Module GTKEventDialog :: Class GTKEventDialog
[hide private]
[frames] | no frames]

Class GTKEventDialog

source code

AccessEngine.AEMonitor.AEMonitor --+
                                   |
                                  GTKEventDialog

Buffers text describing raw pyatspi events. Lets the user choose which events are displayed and to enable or disable logging altogether. Supports the saving of logs to text files on disk. Items are only buffered when the window created by this object does not have the focus to prevent the text box from scrolling while the user is trying to inspect it or select its contents.

Instance Methods [hide private]
 
__init__(self)
Initializes instance variables.
source code
 
init(self)
Creates and shows the monitor window and its components.
source code
 
close(self, widget=None)
Destroys the window, sets logging to False to prevent further adds to the queue, and removes the timer.
source code
gtk.MenuBar
_createMenuBar(self)
Creates the main menu bar consisting of a File menu for saving the active buffer, clearing the active buffer, and quiting the program; a Raw menu for selecting which raw events should be buffered; and a View menu for selecting which types of events should be buffered.
source code
gtk.Menu
_createViewMenu(self)
Builds a menu with checkable items indicating whether a certain type of event should be buffered.
source code
 
_onSaveLog(self, widget)
Saves the text in the text_buffer to a plain text file on disk.
source code
string
_getActiveLogText(self)
Grabs all of the text from the text buffer.
source code
 
_onClearLog(self, widget)
Clears the text buffer.
source code
 
_onCheckLogging(self, widget)
Sets if logging to the text buffer is enabled or not.
source code
 
_onCheckFilters(self, widget, event_name)
Adds or removes an event from the shown list when an item is checked or unchecked respectively in the View menu.
source code
boolean
_isShown(self, event_name)
Gets if the given event name is in the shown list and if logging is enabled.
source code
 
_queueText(self, text, tags=None)
Queues text for later display in the text_view when the window does not have the focus and when the timer fires.
source code
boolean
_onPumpQueue(self)
Buffers all waiting events as long as the top level window is not the foreground window.
source code
 
_addViewMenuItems(self, menu) source code
 
_insert_one_tag_into_buffer(self, name, params)
Adds one named style tag into the TextBuffer tag table.
source code
Class Variables [hide private]
  num_windows = 0
Instance Variables [hide private]
boolean logging
Is logging to the text view enabled?
Queue.Queue queue
Queue of text to buffer
boolean scroll
Scroll the text buffer on the next timer interval?
list of string shown
Names of events to be shown
gtk.TextBuffer text_buffer
Buffer holding string representations of raw events
gtk.TextView text_view
View of past raw events
integer timer
ID for the timer callback to _onPumpQueue
gtk.Window window
Top level window
Method Details [hide private]

init(self)

source code 
Creates and shows the monitor window and its components. Calls the parent implementation to set the AccessEngine.AEMonitor.Base.AEMonitor.is_init flag to True.

close(self, widget=None)

source code 
Destroys the window, sets logging to False to prevent further adds to the queue, and removes the timer. Calls the parent implementation to set the AccessEngine.AEMonitor.Base.AEMonitor.is_init flag to False.
Parameters:
  • widget (gtk.Widget) - Source of the gtk quit event or None if called externally

_createMenuBar(self)

source code 
Creates the main menu bar consisting of a File menu for saving the active buffer, clearing the active buffer, and quiting the program; a Raw menu for selecting which raw events should be buffered; and a View menu for selecting which types of events should be buffered.
Returns: gtk.MenuBar
Fully constructed menu bar and menus

_createViewMenu(self)

source code 
Builds a menu with checkable items indicating whether a certain type of event should be buffered. The names of the menu items and whether they are checked or not are gotten from the AEMonitor.getEventNames and AEMonitor.getEventDefaults methods.
Returns: gtk.Menu
Fully constructed menu

_onSaveLog(self, widget)

source code 
Saves the text in the text_buffer to a plain text file on disk. Grabs all the text in the active textbox using _getActiveLogText. Uses the standard gtk.FileChooserDialog to request a filename and location for the save.
Parameters:
  • widget (gtk.Widget) - Source of the gtk activate event

_getActiveLogText(self)

source code 
Grabs all of the text from the text buffer. Used by _onSaveLog to save the buffer to disk.
Returns: string
All text in the buffer used by the active textbox

_onClearLog(self, widget)

source code 
Clears the text buffer.
Parameters:
  • widget (gtk.Widget) - Source of the gtk event

_onCheckLogging(self, widget)

source code 
Sets if logging to the text buffer is enabled or not.
Parameters:
  • widget (gtk.Widget) - Source of the gtk toggled event

_onCheckFilters(self, widget, event_name)

source code 
Adds or removes an event from the shown list when an item is checked or unchecked respectively in the View menu.
Parameters:
  • widget (gtk.Widget) - Source of the gtk activate event
  • event_name (string) - Name of the event

_isShown(self, event_name)

source code 
Gets if the given event name is in the shown list and if logging is enabled.
Parameters:
  • event_name (string) - Name of the event
Returns: boolean
Is the event to be shown?

_queueText(self, text, tags=None)

source code 
Queues text for later display in the text_view when the window does not have the focus and when the timer fires.
Parameters:
  • text (string) - Text to buffer and display

_onPumpQueue(self)

source code 
Buffers all waiting events as long as the top level window is not the foreground window. Buffering stops immediately when the window is active to allow the user to read and select text without having it scroll. Buffering stops when PUMP_MAX items have been displayed during this call.
Returns: boolean
True to ensure this method is called on the next interval

_insert_one_tag_into_buffer(self, name, params)

source code 
Adds one named style tag into the TextBuffer tag table. These tags can then be used to add style to text that is queued in _queueText.
Parameters:
  • name (string) - Tag name of this style
  • params (dictionary) - dictionary of key, value pairs that represent a style.