favoritenamepopup.h 959 Bytes
#ifndef FAVORITENAMEPOPUP_H
#define FAVORITENAMEPOPUP_H

#include <QWidget>

#include "cookhistory.h"

namespace Ui {
class FavoriteNamePopup;
}

class FavoriteNamePopup : public QWidget
{
    Q_OBJECT

    explicit FavoriteNamePopup(QWidget *parent);

public:
    explicit FavoriteNamePopup(QWidget *parent, ManualCookSetting setting);
    explicit FavoriteNamePopup(QWidget *parent, AutoCookSetting setting);
    ~FavoriteNamePopup();

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

private:
    Ui::FavoriteNamePopup *ui;

    enum { Manual, Auto } type;
    ManualCookSetting manualSetting;
    AutoCookSetting autoSetting;

    QWidget *pushed = NULL;

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

private slots:
    void ok();
    void cancel();
    void on_okButton_clicked();
    void on_cancelButton_clicked();
};

#endif // FAVORITENAMEPOPUP_H