Isis Developer Reference
GuiEditFile.h
Go to the documentation of this file.
1#ifndef _GuiEditFile_h_
2#define _GuiEditFile_h_
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
36namespace 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
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
Opens a window in Gui Application to be able to edit, save and create text files.
Definition GuiEditFile.h:54
static void EditFile(UserInterface &pUI, QString psFile="")
Creates a single instance of the GuiEditFile.
Definition GuiEditFile.cpp:38
void saveAsFile(QString)
Save the contents of text editor to another file.
Definition GuiEditFile.cpp:314
void showWindow(QString psFile="")
If there is already an instance of this object, then display the window.
Definition GuiEditFile.cpp:54
void saveAs()
For action File->Save As.
Definition GuiEditFile.cpp:291
void clearFile()
Delete the contents of a file.
Definition GuiEditFile.cpp:329
void OpenFile(QString)
To display the contents of an opened file.
Definition GuiEditFile.cpp:239
void setTextChanged()
Indicator that the text has changed.
Definition GuiEditFile.cpp:184
void closeFile()
For action File->Close.
Definition GuiEditFile.cpp:218
~GuiEditFile()
Destructor.
Definition GuiEditFile.cpp:155
void closeWin()
For action Exit (close the window)
Definition GuiEditFile.cpp:174
void saveFile()
For action File->Save.
Definition GuiEditFile.cpp:277
void open()
For action File->Open.
Definition GuiEditFile.cpp:193
Command Line and Xml loader, validation, and access.
Definition UserInterface.h:139
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16