Package pallavi :: Package plugins :: Module IODialog
[hide private]
[frames] | no frames]

Module IODialog

source code

Plugin provides basic dialogs for Save, Save As, Open, New, and Close
functionality. Shows a dialog for Save As and Open. Checks if the existing
document is modified before closing or overwriting it.

This is a simple plugin to get I/O up ASAP and to allow a simple editor for
those that don't need more. A more robust implementation might do things like
take care of automatically FTPing or CVSing or provide other virtual filesystem
functionality.

This plugin provides the following actions:
SaveActive
        Save the active buffer. Shows a dialog to choose a filename only
        if the buffer does not have one associated yet.
SaveActiveAs
        Save the active buffer, showing a dialog to choose a new filename.
OpenFile
        Open a file and load it into the active textview.
CloseFile
        Close the active buffer.
NewFile
        Create a new untitled file in the active buffer.


This plugin issues the following events:
FileSaved
        When a buffer is saved
FileOpened
        When a buffer is opened
FileClosed
        When a buffer is closed
NewFileCreated
        When a new untitled buffer is created
        
This plugin invokes the following actions:
SetStatusMessage
        When an open or save event occurs



Functions [hide private]
 
setup() source code
 
SaveActive(data=None)
Save the active buffer to its file.
source code
 
SaveActiveAs(data=None)
Prompt for a filename and save the active buffer to that file
source code
 
OpenFile(data=None)
If data is none, prompt for filenames and load the files contents into the active textview.
source code
 
CloseFile(data=None)
Close the current file and remove it from the buffer switcher.
source code
 
NewFile(data=None)
Create a new blank buffer in the focused textview.
source code
 
VerifyModified()
Determine if its ok to close the document in the active textview.
source code
Function Details [hide private]

SaveActive(data=None)

source code 
Save the active buffer to its file. If no filename has yet been specified, prompt the saveas dialog

OpenFile(data=None)

source code 
If data is none, prompt for filenames and load the files contents into the active textview. Otherwise, assume data is a list of filenames to be opened.

CloseFile(data=None)

source code 
Close the current file and remove it from the buffer switcher. Return true if the buffer was closed, false if it was not.

NewFile(data=None)

source code 
Create a new blank buffer in the focused textview. The old docpointer will remain in the docSelector

VerifyModified()

source code 
Determine if its ok to close the document in the active textview. If the document hasn't been modified since last save, its ok. If it has, we ask the user if we should ignore tha changes or not. Return True if its ok to discard the document, false otherwise.