Table of Contents

Class: FileSelection sam/FileSelection.py

Responsible for the file selection dialog box.

Purpose: Creates the file selection dialog box from a specified glade file, displays the dialog box to the user, and runs its own main loop - waiting for a user event to end the loop and hence return control to MainWindow.

Used by: MainWindow

Uses: gtk, libglade, CustomError

Attributes: None

SRS Refs: 3.2.1.1

Author: mayadm

Date: 10/7/02

Methods   
__init__
fileOpen
getFileName
getWidgetTree
handleCancel
hide
  __init__ 
__init__ ( self )

Purpose: Creates a new instance of the class FileSelection. If the environment variable RAMI_SAM_SHARE is set, the glade file containing FileSelection's widget tree is looked for in that directory, otherwise looked for in the current directory. Displays the file selection dialog box to the user using the widget tree "fileselection" from the glade file contained by spec_filename. Connects up the handlers.

Used by: MainWindow

Uses: libglade

Input: None

Output: None

Preconditions: The name of the widget tree is "fileselection" in the glade file. The names of the handlers are as below in the dictionary.

Postconditions: getFileName() must be called after this class has been initialised to ensure a mainloop is entered.

SRS Refs: 3.2.1.1

Author: mayadm

Date: 10/7/02

  fileOpen 
fileOpen ( self,  *args )

Purpose: Handles the user clicking on "ok_button1". Sets the filename attribute to the filename selected by the user, then mainquits out of the loop.

Used by: FileSelection

Uses: gtk

Input: *args : unused arguments

Output: None

Preconditions: The name of the widget tree is "fileselection" in the glade file. A mainloop has been entered.

Postconditions: self.__filename attribute has been set to a file name selected by the user

SRS Refs: 3.2.1.1

Author: mayadm

Date: 10/7/02

  getFileName 
getFileName ( self )

Purpose: Runs a mainloop waiting for a user event, then once the loop has been exited, returns the filename selected by the user (which may be None if the user has quit or cancelled).

Used by: MainWindow

Uses: gtk

Input: None

Output: getFileName : string or None

Preconditions: None

Postconditions: Each handler must contain a mainquit().

SRS Refs: 3.2.1.1

Author: mayadm

Date: 10/7/02

  getWidgetTree 
getWidgetTree ( self )

Purpose: Returns the widget tree of FileSelection.

Used by: MainWindow

Uses: None

Input: None

Output: getWidgetTree : GladeXML

Preconditions: The name of the widget tree is "fileselection" in the glade file.

Postconditions: None

SRS Refs: 3.2.1.1

Author: mayadm

Date: 7/8/02

  handleCancel 
handleCancel ( self,  *args )

Purpose: Handles the user clicking on "cancel_button1". Hides the file selection dialog box and mainquits out of the loop.

Used by: FileSelection

Uses: gtk

Input: *args : unused arguments

Output: None

Preconditions: A mainloop has been entered.

Postconditions: None

SRS Refs: 3.2.1.1

Author: mayadm

Date: 10/7/02

  hide 
hide ( self )

Purpose: Hides the file selection dialog box.

Used by: MainWindow, FileSelection

Uses: CustomError

Input: None

Output: None

Preconditions: The name of the widget tree is "fileselection" in the glade file.

Postconditions: None

SRS Refs: 3.2.1.1

Author: mayadm

Date: 11/7/02

Exceptions   
CustomError, "Error - no widget tree for FileSelection"

Table of Contents

This document was automatically generated on Wed Oct 30 23:04:21 2002 by HappyDoc version 2.0