/***********************************************************************
**
**   altimetermodedialog.h
**
**   This file is part of Cumulus.
**
************************************************************************
**
**   Copyright (c):  2004 by Eggert Ehmke
**
**   This file is distributed under the terms of the General Public
**   Licence. See the file COPYING for more information.
**
**   $Id: altimetermodedialog.h,v 1.4 2004/06/22 20:19:58 axel Exp $
**
***********************************************************************/

#ifndef ALTIMETERMODEDIALOG_H
#define ALTIMETERMODEDIALOG_H

#include <qdialog.h>
#include <qpushbutton.h>
#include <qtimer.h>
#include <qbuttongroup.h>

/**
  *@author Eckhard Voellm 
  */

class AltimeterModeDialog : public QDialog
{
   Q_OBJECT
public: 
	AltimeterModeDialog(QWidget *parent);
	~AltimeterModeDialog();
  void work ();
  QString Pretext();
  static int mode() { return _mode; };
protected:
  void load ();
  void accept ();
  void save (int mode); // 0: MSL,  1: GND
private:
  QButtonGroup * altMode;
  QPushButton* buttonOK;
  QPushButton* buttonCancel;
  QTimer* timeout;
  int _time;
  static int _mode;  	 // 0: MSL,  1: GND
  bool _toggling_mode;   // 1: On 
private slots:
  void setTimer();
signals:
  void settingsChanged();
  void newAltimeterMode();
};

#endif
