Isis 3 Programmer Reference
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 {
90  class Gui : public QMainWindow {
91  Q_OBJECT
92 
93  public:
94  static void checkX11();
95 
96  static Gui *Create(Isis::UserInterface &ui, int &argc, char *argv[]);
97 
98  void ProgressText(const QString &text);
99  void Progress(int percent);
100 
101  int Exec(void (*funct)());
102  bool ProcessEvents();
103 
104  void LoadMessage(const QString &message);
105  int ShowWarning();
106 
107  void ShowLog() {};
108  void Log(const QString &text);
109 
111  ~Gui();
112 
113  bool eventFilter(QObject *o, QEvent *e);
114 
115  public slots:
116 
117  private:
118  static Gui *p_gui;
119 
120  GuiParameter *AddParameter(Isis::UserInterface &ui, int group, int param);
121  void Preferences();
122  void CreateAreas();
123 
124  QAction *CreateProcessAction();
125  QAction *CreateStopAction();
126  QAction *CreateExitAction();
127  QAction *CreateResetAction();
128  QAction *CreatePreviousHistoryAction();
129  QAction *CreateNextHistoryAction();
130  QAction *CreateSaveLogAction();
131  QAction *CreateClearLogAction();
132  QAction *CreateWhatsThisAction();
133 
134  void (*p_funct)(); // Function to be called for procesing phase
135 
136  QScrollArea *p_scrollArea; // Scrolling area for parameter group boxes
137  QWidget *p_scrollWidget; // Widget with layout for group boxes
138  QVBoxLayout *p_scrollLayout; // Layout for all parameter group boxes
139 
140  QLabel *p_statusText;
141  QProgressBar *p_progressBar;
142  GuiLog *p_log;
143 
144  QAction *p_processAction;
145  QAction *p_exitAction;
146  QAction *p_stopAction;
147  QAction *p_resetAction;
148  QAction *p_saveLogAction;
149  QAction *p_clearLogAction;
150  QAction *p_previousHistoryAction;
151  QAction *p_nextHistoryAction;
152 
154 
155  std::vector<GuiParameter *> p_parameters;
156 
157  QString p_errorString;
158  bool p_stop;
159 
160  void UpdateHistory();
161  int p_historyEntry;
162 
163  QLineEdit *p_commandLineEdit;
164 
165  private slots:
166  void StartProcess();
167  void StopProcessing();
168 
169  void ResetParameters();
170 
171  void NextHistory();
172  void PreviousHistory();
173 
174  void UpdateExclusions();
175  void UpdateCommandLine();
176  void UpdateParameters();
177 
178  void WhatsThis();
179  void AboutProgram();
180  void AboutIsis();
181 
182  void InvokeHelper(const QString &funct);
183  };
184 };
185 
186 
187 
188 #endif
bool eventFilter(QObject *o, QEvent *e)
Reset the Progress bar when the user moves the mouse onto the toolbar.
Definition: Gui.cpp:616
void NextHistory()
Goto the next history entry.
Definition: Gui.cpp:677
void ProgressText(const QString &text)
Change progress text.
Definition: Gui.cpp:559
void InvokeHelper(const QString &funct)
Activate helper buttons.
Definition: Gui.cpp:892
void StopProcessing()
The user pressed the stop button ... see what they want to do.
Definition: Gui.cpp:627
static void checkX11()
check to see if X is available
Definition: Gui.cpp:49
bool ProcessEvents()
Let the event loop have some time to see if we need to cancel.
Definition: Gui.cpp:655
Gui(Isis::UserInterface &ui)
Constructor.
Definition: Gui.cpp:124
void UpdateParameters()
Update Parameters.
Definition: Gui.cpp:856
void Progress(int percent)
Update the progress bar.
Definition: Gui.cpp:565
static Gui * p_gui
Singleton.
Definition: Gui.h:118
void UpdateCommandLine()
Update the command line toolbar.
Definition: Gui.cpp:824
void ResetParameters()
Reset the parameters fields to the defaults.
Definition: Gui.cpp:661
void PreviousHistory()
Goto the previous history entry.
Definition: Gui.cpp:683
void Log(const QString &text)
Write text to the gui log.
Definition: Gui.cpp:611
void UpdateHistory()
Changed the parameters based on the history pointer.
Definition: Gui.cpp:696
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:574
void StartProcess()
The user pressed the go button.
Definition: Gui.cpp:329
void LoadMessage(const QString &message)
Add more information to the error message.
Definition: Gui.cpp:580
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Command Line and Xml loader, validation, and access.
~Gui()
Destructor.
Definition: Gui.cpp:169
int ShowWarning()
Show an error message and return if the user wants to continue/abort.
Definition: Gui.cpp:600
void UpdateExclusions()
Grey out parameters that should be excluded for radio buttons and checkboxes.
Definition: Gui.cpp:802
Gui for Isis Applications.
Definition: Gui.h:90