Isis 3 Programmer Reference
GuiEditFile.h
1 #ifndef _GuiEditFile_h_
2 #define _GuiEditFile_h_
3 
4 #include <QAction>
5 #include <QFile>
6 #include <QObject>
7 #include <QMainWindow>
8 #include <QString>
9 #include <QTextEdit>
10 #include <QWidget>
11 
31 namespace Isis {
32  class UserInterface;
49  class GuiEditFile : public QObject {
50  Q_OBJECT
51  public:
53  static void EditFile(UserInterface & pUI, QString psFile="");
54 
56  void showWindow(QString psFile="");
57 
59  ~GuiEditFile();
60 
62  void clearFile();
63 
64  public slots:
65  void open();
66  void OpenFile(QString);
67  void setTextChanged();
68  void saveAs();
69  void saveAsFile(QString);
70  void saveFile();
71  void closeFile();
72  void closeWin();
73 
74  private:
76  GuiEditFile(UserInterface & pUI, QString psFile="");
77  void windowTitle(QString & psfile);
78 
81  QString m_fileName;
83  QTextEdit *m_txtEdit;
84  QFile *m_editFile;
86 
93  };
94 
95 };
96 #endif
97 
QMainWindow * m_editWin
Editor window.
Definition: GuiEditFile.h:82
bool m_textChanged
Flag to indicate text changed.
Definition: GuiEditFile.h:85
QAction * m_saveAs
Action Save As.
Definition: GuiEditFile.h:90
void OpenFile(QString)
To display the contents of an opened file.
void saveFile()
For action File->Save.
void setTextChanged()
Indicator that the text has changed.
void closeWin()
For action Exit (close the window)
void saveAs()
For action File->Save As.
QString m_fileName
Current file open.
Definition: GuiEditFile.h:81
static void EditFile(UserInterface &pUI, QString psFile="")
Creates a single instance of the GuiEditFile.
Definition: GuiEditFile.cpp:32
QAction * m_close
Action Close.
Definition: GuiEditFile.h:91
void open()
For action File->Open.
QTextEdit * m_txtEdit
Text Editor.
Definition: GuiEditFile.h:83
~GuiEditFile()
Destructor.
void windowTitle(QString &psfile)
display only the file base name
void clearFile()
Delete the contents of a file.
QFile * m_editFile
File pointer to current file.
Definition: GuiEditFile.h:84
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Command Line and Xml loader, validation, and access.
QWidget * m_parent
Parent widget.
Definition: GuiEditFile.h:80
Opens a window in Gui Application to be able to edit, save and create text files. ...
Definition: GuiEditFile.h:49
GuiEditFile(UserInterface &pUI, QString psFile="")
Constructor.
Definition: GuiEditFile.cpp:63
static GuiEditFile * m_instance
Instance of this object - singleton.
Definition: GuiEditFile.h:79
QAction * m_exit
Action Exit.
Definition: GuiEditFile.h:92
QAction * m_save
Action Save.
Definition: GuiEditFile.h:89
void showWindow(QString psFile="")
If there is already an instance of this object, then display the window.
Definition: GuiEditFile.cpp:48
QAction * m_open
Actioons.
Definition: GuiEditFile.h:88
void saveAsFile(QString)
Save the contents of text editor to another file.
void closeFile()
For action File->Close.