Isis Developer Reference
GuiEditFile.h
Go to the documentation of this file.
1 #ifndef _GuiEditFile_h_
2 #define _GuiEditFile_h_
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 #include <QAction>
10 #include <QFile>
11 #include <QObject>
12 #include <QMainWindow>
13 #include <QString>
14 #include <QTextEdit>
15 #include <QWidget>
16 
36 namespace Isis {
37  class UserInterface;
54  class GuiEditFile : public QObject {
55  Q_OBJECT
56  public:
58  static void EditFile(UserInterface & pUI, QString psFile="");
59 
61  void showWindow(QString psFile="");
62 
64  ~GuiEditFile();
65 
67  void clearFile();
68 
69  public slots:
70  void open();
71  void OpenFile(QString);
72  void setTextChanged();
73  void saveAs();
74  void saveAsFile(QString);
75  void saveFile();
76  void closeFile();
77  void closeWin();
78 
79  private:
81  GuiEditFile(UserInterface & pUI, QString psFile="");
82  void windowTitle(QString & psfile);
83 
84  static GuiEditFile* m_instance;
85  QWidget *m_parent;
86  QString m_fileName;
87  QMainWindow *m_editWin;
88  QTextEdit *m_txtEdit;
89  QFile *m_editFile;
90  bool m_textChanged;
91 
93  QAction *m_open;
94  QAction *m_save;
95  QAction *m_saveAs;
96  QAction *m_close;
97  QAction *m_exit;
98  };
99 
100 };
101 #endif
102 
FileName.h
QWidget
Isis::GuiEditFile::clearFile
void clearFile()
Delete the contents of a file.
Definition: GuiEditFile.cpp:329
QList< QPushButton * >
QFileDialog
Isis::GuiEditFile::saveAs
void saveAs()
For action File->Save As.
Definition: GuiEditFile.cpp:291
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
QMenu
QMainWindow
Isis::GuiEditFile::EditFile
static void EditFile(UserInterface &pUI, QString psFile="")
Creates a single instance of the GuiEditFile.
Definition: GuiEditFile.cpp:38
Isis::GuiEditFile::~GuiEditFile
~GuiEditFile()
Destructor.
Definition: GuiEditFile.cpp:155
Isis::GuiEditFile::closeWin
void closeWin()
For action Exit (close the window)
Definition: GuiEditFile.cpp:174
Isis::ReadWrite
const int ReadWrite
Definition: Process.h:24
Isis::GuiEditFile::saveFile
void saveFile()
For action File->Save.
Definition: GuiEditFile.cpp:277
GuiEditFile.h
Isis::GuiEditFile::showWindow
void showWindow(QString psFile="")
If there is already an instance of this object, then display the window.
Definition: GuiEditFile.cpp:54
Isis::GuiEditFile
Opens a window in Gui Application to be able to edit, save and create text files.
Definition: GuiEditFile.h:54
Isis::GuiEditFile::saveAsFile
void saveAsFile(QString)
Save the contents of text editor to another file.
Definition: GuiEditFile.cpp:314
Isis::UserInterface::TheGui
Gui * TheGui()
Definition: UserInterface.h:187
std
Namespace for the standard library.
Isis::UserInterface
Command Line and Xml loader, validation, and access.
Definition: UserInterface.h:140
Isis::GuiEditFile::OpenFile
void OpenFile(QString)
To display the contents of an opened file.
Definition: GuiEditFile.cpp:239
QObject
UserInterface.h
Isis::GuiEditFile::setTextChanged
void setTextChanged()
Indicator that the text has changed.
Definition: GuiEditFile.cpp:184
QAction
Isis::GuiEditFile::closeFile
void closeFile()
For action File->Close.
Definition: GuiEditFile.cpp:218
Isis::GuiEditFile::open
void open()
For action File->Open.
Definition: GuiEditFile.cpp:193
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16