Isis 3.0 Object Programmers' Reference |
Home |
Opens a window in Gui Application to be able to edit, save and create text files. More...
#include <GuiEditFile.h>
Public Slots | |
void | open () |
For action File->Open. | |
void | OpenFile (QString) |
To display the contents of an opened file. | |
void | setTextChanged () |
Indicator that the text has changed. | |
void | saveAs () |
For action File->Save As. | |
void | saveAsFile (QString) |
Save the contents of text editor to another file. | |
void | saveFile () |
For action File->Save. | |
void | closeFile () |
For action File->Close. | |
void | closeWin () |
For action Exit (close the window) | |
Public Member Functions | |
void | showWindow (QString psFile="") |
If there is already an instance of this object, then display the window. | |
~GuiEditFile () | |
Destructor. | |
void | clearFile () |
Delete the contents of a file. | |
Static Public Member Functions | |
static void | EditFile (UserInterface &pUI, QString psFile="") |
Creates a single instance of the GuiEditFile. | |
Private Member Functions | |
GuiEditFile (UserInterface &pUI, QString psFile="") | |
Constructor. | |
void | windowTitle (QString &psfile) |
display only the file base name | |
Private Attributes | |
QWidget * | m_parent |
Parent widget. | |
QString | m_fileName |
Current file open. | |
QMainWindow * | m_editWin |
Editor window. | |
QTextEdit * | m_txtEdit |
Text Editor. | |
QFile * | m_editFile |
File pointer to current file. | |
bool | m_textChanged |
Flag to indicate text changed. | |
QAction * | m_open |
Actioons. | |
QAction * | m_save |
Action Save. | |
QAction * | m_saveAs |
Action Save As. | |
QAction * | m_close |
Action Close. | |
QAction * | m_exit |
Action Exit. | |
Static Private Attributes | |
static GuiEditFile * | m_instance = NULL |
Instance of this object - singleton. | |
Opens a window in Gui Application to be able to edit, save and create text files.
Creates a singleton window to edit files.
Example can be used to edit DefFiles in control net applications. Refer to cnetedit Application
2011-05-21 Sharmila Prasad - Initial Version
2011-10-07 Sharmila Prasad - Added message if the file does not have write permissions and is unable to load it.
Definition at line 49 of file GuiEditFile.h.
Isis::GuiEditFile::~GuiEditFile | ( | ) |
Destructor.
Definition at line 149 of file GuiEditFile.cpp.
|
private |
Constructor.
pUI | |
psFile |
Definition at line 63 of file GuiEditFile.cpp.
References Isis::UserInterface::TheGui().
void Isis::GuiEditFile::clearFile | ( | ) |
Delete the contents of a file.
Delete the contents of the current file - especially if changes are made and they are not to be saved.
Definition at line 323 of file GuiEditFile.cpp.
|
slot |
For action File->Close.
Action File->close, close the opened file.
Definition at line 212 of file GuiEditFile.cpp.
|
slot |
For action Exit (close the window)
Action Exit - Close window and clear text editor.
Definition at line 168 of file GuiEditFile.cpp.
|
static |
Creates a single instance of the GuiEditFile.
If already an instance, display the object
pUI | - User Interface of parent app |
psFile | - File to edit |
Definition at line 32 of file GuiEditFile.cpp.
|
slot |
|
slot |
To display the contents of an opened file.
Display the selected file.
psOutFile |
Definition at line 233 of file GuiEditFile.cpp.
|
slot |
|
slot |
Save the contents of text editor to another file.
Copy the current file into user selected file.
psNewFile |
Definition at line 308 of file GuiEditFile.cpp.
|
slot |
|
slot |
Indicator that the text has changed.
Flag to indicate text has changed.
Definition at line 178 of file GuiEditFile.cpp.
void Isis::GuiEditFile::showWindow | ( | QString | psFile = "" | ) |
If there is already an instance of this object, then display the window.
Display the window if there is already an instance of this object.
psFile | - File to edit |
Definition at line 48 of file GuiEditFile.cpp.
|
private |
display only the file base name
Display only the base name of the file.
psfile | - current file |
Definition at line 338 of file GuiEditFile.cpp.
|
private |
Action Close.
Definition at line 91 of file GuiEditFile.h.
|
private |
File pointer to current file.
Definition at line 84 of file GuiEditFile.h.
|
private |
Editor window.
Definition at line 82 of file GuiEditFile.h.
|
private |
Action Exit.
Definition at line 92 of file GuiEditFile.h.
|
private |
Current file open.
Definition at line 81 of file GuiEditFile.h.
|
staticprivate |
Instance of this object - singleton.
Definition at line 79 of file GuiEditFile.h.
|
private |
|
private |
Parent widget.
Definition at line 80 of file GuiEditFile.h.
|
private |
Action Save.
Definition at line 89 of file GuiEditFile.h.
|
private |
Action Save As.
Definition at line 90 of file GuiEditFile.h.
|
private |
Flag to indicate text changed.
Definition at line 85 of file GuiEditFile.h.
|
private |
Text Editor.
Definition at line 83 of file GuiEditFile.h.