Isis 3.0 Programmer Reference
Back | Home
Gui.h
Go to the documentation of this file.
1 #ifndef Isis_GuiMainWindow_h
2 #define Isis_GuiMainWindow_h
3 
28 #include <iostream>
29 #include <string>
30 #include <vector>
31 
32 #include <QAction>
33 #include <QGroupBox>
34 #include <QLabel>
35 #include <QLayout>
36 #include <QLineEdit>
37 #include <QMainWindow>
38 #include <QProgressBar>
39 #include <QScrollArea>
40 #include <QWidget>
41 
42 #include "PvlObject.h"
43 #include "PvlGroup.h"
44 
45 #include "GuiLog.h"
46 #include "GuiParameter.h"
47 #include "GuiParameterFactory.h"
48 
49 namespace Isis {
86  class Gui : public QMainWindow {
87  Q_OBJECT
88 
89  public:
90  static void checkX11();
91 
92  static Gui *Create(Isis::UserInterface &ui, int &argc, char *argv[]);
93 
94  void ProgressText(const QString &text);
95  void Progress(int percent);
96 
97  int Exec(void (*funct)());
98  bool ProcessEvents();
99 
100  void LoadMessage(const QString &message);
101  int ShowWarning();
102 
103  void ShowLog() {};
104  void Log(const QString &text);
105 
107  ~Gui();
108 
109  bool eventFilter(QObject *o, QEvent *e);
110 
111  public slots:
112 
113  private:
114  static Gui *p_gui;
115 
116  GuiParameter *AddParameter(Isis::UserInterface &ui, int group, int param);
117  void Preferences();
118  void CreateAreas();
119 
120  QAction *CreateProcessAction();
121  QAction *CreateStopAction();
122  QAction *CreateExitAction();
123  QAction *CreateResetAction();
124  QAction *CreatePreviousHistoryAction();
125  QAction *CreateNextHistoryAction();
126  QAction *CreateSaveLogAction();
127  QAction *CreateClearLogAction();
128  QAction *CreateWhatsThisAction();
129 
130  void (*p_funct)(); // Function to be called for procesing phase
131 
132  QScrollArea *p_scrollArea; // Scrolling area for parameter group boxes
133  QWidget *p_scrollWidget; // Widget with layout for group boxes
134  QVBoxLayout *p_scrollLayout; // Layout for all parameter group boxes
135 
136  QLabel *p_statusText;
137  QProgressBar *p_progressBar;
138  GuiLog *p_log;
139 
140  QAction *p_processAction;
141  QAction *p_exitAction;
142  QAction *p_stopAction;
143  QAction *p_resetAction;
144  QAction *p_saveLogAction;
145  QAction *p_clearLogAction;
146  QAction *p_previousHistoryAction;
147  QAction *p_nextHistoryAction;
148 
150 
151  std::vector<GuiParameter *> p_parameters;
152 
153  QString p_errorString;
154  bool p_stop;
155 
156  void UpdateHistory();
157  int p_historyEntry;
158 
159  QLineEdit *p_commandLineEdit;
160 
161  private slots:
162  void StartProcess();
163  void StopProcessing();
164 
165  void ResetParameters();
166 
167  void NextHistory();
168  void PreviousHistory();
169 
170  void UpdateExclusions();
171  void UpdateCommandLine();
172  void UpdateParameters();
173 
174  void WhatsThis();
175  void AboutProgram();
176  void AboutIsis();
177 
178  void InvokeHelper(const QString &funct);
179  };
180 };
181 
182 
183 
184 #endif
bool eventFilter(QObject *o, QEvent *e)
Reset the Progress bar when the user moves the mouse onto the toolbar.
Definition: Gui.cpp:594
void NextHistory()
Goto the next history entry.
Definition: Gui.cpp:655
void ProgressText(const QString &text)
Change progress text.
Definition: Gui.cpp:537
void InvokeHelper(const QString &funct)
Activate helper buttons.
Definition: Gui.cpp:870
void StopProcessing()
The user pressed the stop button ... see what they want to do.
Definition: Gui.cpp:605
static void checkX11()
check to see if X is available
Definition: Gui.cpp:48
bool ProcessEvents()
Let the event loop have some time to see if we need to cancel.
Definition: Gui.cpp:633
Gui(Isis::UserInterface &ui)
Constructor.
Definition: Gui.cpp:106
void UpdateParameters()
Update Parameters.
Definition: Gui.cpp:834
void Progress(int percent)
Update the progress bar.
Definition: Gui.cpp:543
static Gui * p_gui
Singleton.
Definition: Gui.h:114
void UpdateCommandLine()
Update the command line toolbar.
Definition: Gui.cpp:802
void ResetParameters()
Reset the parameters fields to the defaults.
Definition: Gui.cpp:639
void PreviousHistory()
Goto the previous history entry.
Definition: Gui.cpp:661
void Log(const QString &text)
Write text to the gui log.
Definition: Gui.cpp:589
void UpdateHistory()
Changed the parameters based on the history pointer.
Definition: Gui.cpp:674
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:552
void StartProcess()
The user pressed the go button.
Definition: Gui.cpp:307
void LoadMessage(const QString &message)
Add more information to the error message.
Definition: Gui.cpp:558
Command Line and Xml loader, validation, and access.
~Gui()
Destructor.
Definition: Gui.cpp:147
int ShowWarning()
Show an error message and return if the user wants to continue/abort.
Definition: Gui.cpp:578
void UpdateExclusions()
Grey out parameters that should be excluded for radio buttons and checkboxes.
Definition: Gui.cpp:780
Gui for Isis Applications.
Definition: Gui.h:86

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:18:57