#ifndef WIDGET_H #define WIDGET_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "MabiWeather.h" #include "alertwidget.h" #include "../Glass/glass.h" struct Arbeit { QString name; int begin; int end; }; class Widget : public QWidget { Q_OBJECT public: Widget(QWidget *parent = 0); ~Widget(); bool initialized(); private: QLabel *lbErinnTime; QLabel *lbRealTime; QLabel *lbMoongate; QLabel *lbMoongateNext; QLabel *lbArbeit; QLabel *lbWeather; QLabel *lbWeekEffectName; QLabel *lbWeekEffectContent; QLabel *lbWeekAdvanceItem; QLabel *lbPrice; QLabel *lbPriceNext1; QLabel *lbPriceNext2; QComboBox *cbWeather; QComboBox *cbArbeit; QCheckBox *cbTopmost; QToolButton *btClose; QSlider *slOpacity; QHBoxLayout *timeLayout; QVBoxLayout *gateLayout; QHBoxLayout *arbeitLayout; QHBoxLayout *weatherLayout; QVBoxLayout *effectLayout; QVBoxLayout *priceLayout; QVBoxLayout *fletaLayout; QHBoxLayout *optionLayout; QMenu *trayMenu; QAction *showAction; QAction *transWindow; QAction *quitQction; QSystemTrayIcon *trayIcon; QGridLayout *mainLayout; AlertWidget *alert; private: void initWeather(); void initSequence(); void initAlerts(); void createLayout(); void createLable(); void createOption(); void createTrayicon(); void update(); void updateTime(); void updateMoongate(); void updateArbeit(); void updateWeather(); void updateWeekEffect(); void updatePrice(); void updateAlert(); Glass *glass; QImage background; QBasicTimer timer; QDateTime realTime; QDateTime erinnTime; QPoint dragPos; QList moongateSequence; QList arbeitSequence; QList weekdayEffectsName; QList weekdayEffectsContent; QList weekdayEffectsAdvance; QList priceSequence; QList weatherArea; int weatherCurrent; CMabiWeather* weather; bool isInitialized; bool isFirstTransparent; private slots: void showTimer(); void closeTimer(); void toggleTransparent(); void toggleTopmost(); void changeOpacity(int opacity); void trayActivated(QSystemTrayIcon::ActivationReason reason); protected: void paintEvent(QPaintEvent *event); void timerEvent(QTimerEvent *event); void closeEvent(QCloseEvent *event); void mouseMoveEvent(QMouseEvent *event); void mousePressEvent(QMouseEvent *event); }; #endif // WIDGET_H