#ifndef ConfigDialog_h
#define ConfigDialog_h

#include "ui_CameraIdentificationConfig.h"
#include "ui_DestDirectoryConfig.h"
#include "ui_UK1104DigitalInputConfig.h"
#include "ui_UK1104IdentifyConfig.h"
#include "ui_UK1104RelayConfig.h"
#include "ui_ConfigTabsDialog.h"
#include "ui_PreferencesConfig.h"
#include "ui_ProgramConfigDialog.h"
#include "ConfigData.h"

class QTableWidgetItem;

// ConfigDialog puts all the config pages together into a tabbed dialog.
//
class ConfigDialog : public QDialog {

   Q_OBJECT

public:

   ConfigDialog();

   ~ConfigDialog();

   void
   PopUp();

private slots:

   void
   editProgramItem(
      int currentRow,
      int currentColumn,
      int previousRow,
      int previousColumn);

   void
   maybeAddRow(QTableWidgetItem * item);

   void
   comboChanged(const QString& text);

private:

   Ui::configTabsDialog           main;
   Ui::cameraIdentificationConfig leftcam;
   Ui::cameraIdentificationConfig rightcam;
   Ui::destDirectoryConfig        destdir;
   Ui::UK1104IdentifyConfig       uk1104id;
   Ui::UK1104RelayConfig          uk1104relay;
   Ui::UK1104DigitalInputConfig   uk1104input;
   Ui::preferencesConfig          prefs;
   Ui::ProgramDialog              lights_prog;
   Ui::ProgramDialog              cam_prog;
   Ui::ProgramDialog              download_prog;

   QComboBox *
   GetActionsCombo(int newRow, int newCol, QTableWidget* newTab);

   void
   InitProgram(QTableWidget * tab, ProgramEntryList prog);

   void
   UpdateProgram(QTableWidget * tab, ProgramEntryList & prog);

   int curRow, curCol;
   QTableWidget * curTab;
};

#endif // ConfigDialog_h
