Isis Developer Reference
Gui.h
Go to the documentation of this file.
1 #ifndef Isis_GuiMainWindow_h
2 #define Isis_GuiMainWindow_h
3 
9 /* SPDX-License-Identifier: CC0-1.0 */
10 
11 #include <iostream>
12 #include <string>
13 #include <vector>
14 
15 #include <QAction>
16 #include <QGroupBox>
17 #include <QLabel>
18 #include <QLayout>
19 #include <QLineEdit>
20 #include <QMainWindow>
21 #include <QProgressBar>
22 #include <QScrollArea>
23 #include <QWidget>
24 
25 #include "PvlObject.h"
26 #include "PvlGroup.h"
27 
28 #include "GuiLog.h"
29 #include "GuiParameter.h"
30 #include "GuiParameterFactory.h"
31 
32 namespace Isis {
73  class Gui : public QMainWindow {
74  Q_OBJECT
75 
76  public:
77  static void checkX11();
78 
79  static Gui *Create(Isis::UserInterface &ui, int &argc, char *argv[]);
80 
81  void ProgressText(const QString &text);
82  void Progress(int percent);
83 
84  int Exec(void (*funct)());
85  bool ProcessEvents();
86 
87  void LoadMessage(const QString &message);
88  int ShowWarning();
89 
90  void ShowLog() {};
91  void Log(const QString &text);
92 
94  ~Gui();
95 
96  bool eventFilter(QObject *o, QEvent *e);
97 
98  public slots:
99 
100  private:
101  static Gui *p_gui;
102 
103  GuiParameter *AddParameter(Isis::UserInterface &ui, int group, int param);
104  void Preferences();
105  void CreateAreas();
106 
107  QAction *CreateProcessAction();
108  QAction *CreateStopAction();
109  QAction *CreateExitAction();
110  QAction *CreateResetAction();
111  QAction *CreatePreviousHistoryAction();
112  QAction *CreateNextHistoryAction();
113  QAction *CreateSaveLogAction();
114  QAction *CreateClearLogAction();
115  QAction *CreateWhatsThisAction();
116 
117  void (*p_funct)(); // Function to be called for procesing phase
118 
119  QScrollArea *p_scrollArea; // Scrolling area for parameter group boxes
120  QWidget *p_scrollWidget; // Widget with layout for group boxes
121  QVBoxLayout *p_scrollLayout; // Layout for all parameter group boxes
122 
123  QLabel *p_statusText;
124  QProgressBar *p_progressBar;
125  GuiLog *p_log;
126 
127  QAction *p_processAction;
128  QAction *p_exitAction;
129  QAction *p_stopAction;
130  QAction *p_resetAction;
131  QAction *p_saveLogAction;
132  QAction *p_clearLogAction;
133  QAction *p_previousHistoryAction;
134  QAction *p_nextHistoryAction;
135 
137 
138  std::vector<GuiParameter *> p_parameters;
139 
140  QString p_errorString;
141  bool p_stop;
142 
143  void UpdateHistory();
144  int p_historyEntry;
145 
146  QLineEdit *p_commandLineEdit;
147 
148  private slots:
149  void StartProcess();
150  void StopProcessing();
151 
152  void ResetParameters();
153 
154  void NextHistory();
155  void PreviousHistory();
156 
157  void UpdateExclusions();
158  void UpdateCommandLine();
159  void UpdateParameters();
160 
161  void WhatsThis();
162  void AboutProgram();
163  void AboutIsis();
164 
165  void InvokeHelper(const QString &funct);
166  };
167 };
168 
169 
170 
171 #endif
Isis::iApp
Application * iApp
Definition: Application.cpp:51
FileName.h
Isis::Gui::Progress
void Progress(int percent)
Update the progress bar.
Definition: Gui.cpp:571
IsisAml::PutAsString
void PutAsString(const QString &paramName, const QString &value)
Allows the insertion of a value for any parameter.
Definition: IsisAml.cpp:65
Isis::GuiParameter::Update
void Update()
Update the value on the GUI with the value in the UI.
Definition: GuiParameter.cpp:196
QWidget
QProgressBar
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Isis::PvlObject::group
PvlGroup & group(const int index)
Return the group at the specified index.
Definition: PvlObject.cpp:452
Isis::GuiParameter::BooleanWidget
@ BooleanWidget
Definition: GuiParameter.h:75
Isis::GuiParameter::CubeWidget
@ CubeWidget
Definition: GuiParameter.h:74
Isis::GuiParameter::ComboWidget
@ ComboWidget
Definition: GuiParameter.h:75
Isis::ProgramLauncher::RunSystemCommand
static void RunSystemCommand(QString commandLine)
This runs arbitrary system commands.
Definition: ProgramLauncher.cpp:207
IsisAml::NumGroups
int NumGroups() const
Returns the number of groups found in the XML.
Definition: IsisAml.cpp:1087
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
PvlGroup.h
Isis::GuiLog
Definition: GuiLog.h:18
QMenu
Isis::PvlObject::groups
int groups() const
Returns the number of groups contained.
Definition: PvlObject.h:75
QMainWindow
GuiParameterFactory.h
Isis::GuiLog::Write
void Write(const QString &string)
Add more information to the log widget.
Definition: GuiLog.cpp:38
Isis::GuiParameter::SetEnabled
void SetEnabled(bool enabled, bool isParentCombo=false)
Enable or disable the parameter.
Definition: GuiParameter.cpp:217
Isis::PvlContainer::hasKeyword
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
Definition: PvlContainer.cpp:159
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::Gui::LoadMessage
void LoadMessage(const QString &message)
Add more information to the error message.
Definition: Gui.cpp:586
GuiParameter.h
Isis::Gui
Gui for Isis Applications.
Definition: Gui.h:73
Isis::Gui::ProcessEvents
bool ProcessEvents()
Let the event loop have some time to see if we need to cancel.
Definition: Gui.cpp:661
QToolBar
Preference.h
IString.h
Isis::GuiParameter
Definition: GuiParameter.h:34
Isis::Gui::ShowLog
void ShowLog()
Definition: Gui.h:90
Isis::PvlObject::Traverse
@ Traverse
Search child objects.
Definition: PvlObject.h:158
Isis::Gui::eventFilter
bool eventFilter(QObject *o, QEvent *e)
Reset the Progress bar when the user moves the mouse onto the toolbar.
Definition: Gui.cpp:622
GuiLog.h
Isis::Application::GetUserInterface
static UserInterface & GetUserInterface()
Returns the UserInterface object.
Definition: Application.cpp:463
IsisAml::GroupName
QString GroupName(const int &group) const
Returns the group name of group[index].
Definition: IsisAml.cpp:1098
Isis::GuiParameter::Name
QString Name() const
Return the name of the parameter.
Definition: GuiParameter.h:44
IsisAml::VerifyAll
void VerifyAll()
Verify all parameters.
Definition: IsisAml.cpp:2387
Isis::Gui::~Gui
~Gui()
Destructor.
Definition: Gui.cpp:175
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::GuiParameter::StringWidget
@ StringWidget
Definition: GuiParameter.h:73
Pvl.h
Isis::Pvl::read
void read(const QString &file)
Loads PVL information from a stream.
Definition: Pvl.cpp:90
Isis::PvlContainer::isNamed
bool isNamed(const QString &match) const
Returns whether the given string is equal to the container name or not.
Definition: PvlContainer.h:72
Isis::Application::GuiReportError
void GuiReportError(IException &e)
Loads the error message into the gui, but does not write it to the session log.
Definition: Application.cpp:708
Application.h
Isis::Gui::ProgressText
void ProgressText(const QString &text)
Change progress text.
Definition: Gui.cpp:565
Isis::PvlContainer::name
QString name() const
Returns the container name.
Definition: PvlContainer.h:63
Isis::Gui::ShowWarning
int ShowWarning()
Show an error message and return if the user wants to continue/abort.
Definition: Gui.cpp:606
QApplication
Isis::Gui::Log
void Log(const QString &text)
Write text to the gui log.
Definition: Gui.cpp:617
Isis::Application::GetGuiHelper
void * GetGuiHelper(QString helper)
Definition: Application.h:129
IsisAml::Clear
void Clear(const QString &paramName)
Clears the value(s) in the named parameter.
Definition: IsisAml.cpp:1852
IException.h
Isis::SessionLog::TheLog
static SessionLog & TheLog(bool restart=false)
Definition: SessionLog.cpp:39
Isis::Gui::Gui
Gui(Isis::UserInterface &ui)
Constructor.
Definition: Gui.cpp:130
ProgramLauncher.h
Isis::UserInterface::SaveHistory
void SaveHistory()
Saves the user parameter information in the history of the program for later use.
Definition: UserInterface.cpp:261
Isis::UserInterface
Command Line and Xml loader, validation, and access.
Definition: UserInterface.h:140
Isis::GuiParameterFactory::Create
static GuiParameter * Create(QGridLayout *grid, Isis::UserInterface &ui, int group, int param)
Definition: GuiParameterFactory.cpp:20
Isis::Gui::Exec
int Exec(void(*funct)())
Start the Gui and enter the main loop This routine only returns when the program is ready to exit.
Definition: Gui.cpp:580
Isis::Gui::checkX11
static void checkX11()
check to see if X is available
Definition: Gui.cpp:55
PvlObject.h
QMap< QString, QGridLayout * >
Gui.h
Isis::PvlContainer::keywords
int keywords() const
Returns the number of keywords contained in the PvlContainer.
Definition: PvlContainer.h:86
Isis::Preference::Preferences
static Preference & Preferences(bool unitTest=false)
Definition: Preference.cpp:86
QObject
UserInterface.h
IsisAml::ProgramName
QString ProgramName() const
Returns the Program name.
Definition: IsisAml.cpp:1057
QAction
Isis::GuiParameter::ListWidget
@ ListWidget
Definition: GuiParameter.h:74
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::GuiParameter::FileNameWidget
@ FileNameWidget
Definition: GuiParameter.h:74
Isis::Gui::Create
static Gui * Create(Isis::UserInterface &ui, int &argc, char *argv[])
Definition: Gui.cpp:84
SessionLog.h
IsisAml::NumParams
int NumParams(const int &) const
Returns the number of parameters in a group.
Definition: IsisAml.cpp:1207