multicookmanualwindow.h 1.1 KB
#ifndef MULTICOOKMANUALWINDOW_H
#define MULTICOOKMANUALWINDOW_H

#include <QMainWindow>

#include "multicook.h"

namespace Ui {
class MultiCookManualWindow;
}

class MultiCookManualWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MultiCookManualWindow(QWidget *parent = 0);
    ~MultiCookManualWindow();

    void setMode(Define::Mode mode);

    bool eventFilter(QObject *watched, QEvent *event);

protected:
    void keyPressEvent(QKeyEvent *event);
    void keyReleaseEvent(QKeyEvent *event);

signals:
    void selected(MultiCook*);

private:
    Ui::MultiCookManualWindow *ui;

    Define::Mode mode;

    int sliderToTime(int value);

    QTimer afterThreeSecsTimer;
    QWidget *pushed = NULL;

    void onEncoderLeft();
    void onEncoderRight();
    void onEncoderClicked(QWidget *clicked);

private slots:
    void updateView();
    void afterThreeSecs();

    void on_humidityButton_clicked();
    void on_tempButton_clicked();
    void on_timeButton_clicked();

    void on_backButton_clicked();
    void on_helpButton_clicked();
    void on_okButton_clicked();

};

#endif // MULTICOOKMANUALWINDOW_H