USGS

Isis 3.0 Object Programmers' Reference

Home

Gui.h

Go to the documentation of this file.
00001 #ifndef Isis_GuiMainWindow_h
00002 #define Isis_GuiMainWindow_h
00003 
00028 #include <iostream>
00029 #include <string>
00030 #include <vector>
00031 
00032 #include <QAction>
00033 #include <QGroupBox>
00034 #include <QLabel>
00035 #include <QLayout>
00036 #include <QLineEdit>
00037 #include <QMainWindow>
00038 #include <QProgressBar>
00039 #include <QScrollArea>
00040 #include <QWidget>
00041 
00042 #include "PvlObject.h"
00043 #include "PvlGroup.h"
00044 
00045 #include "GuiLog.h"
00046 #include "GuiParameter.h"
00047 #include "GuiParameterFactory.h"
00048 
00049 namespace Isis {
00082   class Gui : public QMainWindow {
00083       Q_OBJECT
00084 
00085     public:
00086       static void checkX11();
00087       
00088       static Gui *Create(Isis::UserInterface &ui, int &argc, char *argv[]);
00089 
00090       void ProgressText(const QString &text);
00091       void Progress(int percent);
00092 
00093       int Exec(void (*funct)());
00094       bool ProcessEvents();
00095 
00096       void LoadMessage(const QString &message);
00097       int ShowWarning();
00098 
00099       void ShowLog() {};
00100       void Log(const QString &text);
00101 
00102       Gui(Isis::UserInterface &ui);
00103       ~Gui();
00104 
00105       bool eventFilter(QObject *o, QEvent *e);
00106 
00107     public slots:
00108 
00109     private:
00110       static Gui *p_gui;
00111 
00112       GuiParameter *AddParameter(Isis::UserInterface &ui, int group, int param);
00113       void Preferences();
00114       void CreateAreas();
00115 
00116       QAction *CreateProcessAction();
00117       QAction *CreateStopAction();
00118       QAction *CreateExitAction();
00119       QAction *CreateResetAction();
00120       QAction *CreatePreviousHistoryAction();
00121       QAction *CreateNextHistoryAction();
00122       QAction *CreateSaveLogAction();
00123       QAction *CreateClearLogAction();
00124       QAction *CreateWhatsThisAction();
00125 
00126       void (*p_funct)(); // Function to be called for procesing phase
00127 
00128       QScrollArea *p_scrollArea;   // Scrolling area for parameter group boxes
00129       QWidget *p_scrollWidget;     // Widget with layout for group boxes
00130       QVBoxLayout *p_scrollLayout; // Layout for all parameter group boxes
00131 
00132       QLabel *p_statusText;
00133       QProgressBar *p_progressBar;
00134       GuiLog *p_log;
00135 
00136       QAction *p_processAction;
00137       QAction *p_exitAction;
00138       QAction *p_stopAction;
00139       QAction *p_resetAction;
00140       QAction *p_saveLogAction;
00141       QAction *p_clearLogAction;
00142       QAction *p_previousHistoryAction;
00143       QAction *p_nextHistoryAction;
00144 
00145       QMap<QString, QGridLayout *> p_grids;
00146 
00147       std::vector<GuiParameter *> p_parameters;
00148 
00149       QString p_errorString;
00150       bool p_stop;
00151 
00152       void UpdateHistory();
00153       int p_historyEntry;
00154 
00155       QLineEdit *p_commandLineEdit;
00156 
00157     private slots:
00158       void StartProcess();
00159       void StopProcessing();
00160 
00161       void ResetParameters();
00162 
00163       void NextHistory();
00164       void PreviousHistory();
00165 
00166       void UpdateExclusions();
00167       void UpdateCommandLine();
00168       void UpdateParameters();
00169 
00170       void WhatsThis();
00171       void AboutProgram();
00172       void AboutIsis();
00173 
00174       void InvokeHelper(const QString &funct);
00175   };
00176 };
00177 
00178 
00179 
00180 #endif