~ubuntu-branches/ubuntu/vivid/youker-assistant/vivid

« back to all changes in this revision

Viewing changes to src/tray.h

  • Committer: Package Import Robot
  • Author(s): Kobe Lee (kylinkobe)
  • Date: 2013-09-18 16:22:14 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130918162214-6nqyjyf3cd3ynqky
Tags: 0.2.1-0ubuntu1
* Modify the mouse events of MonitorBall.
* Add reset button for clear pages.
* Add policykit for apt clear in sudodbus.
* Fixed the bug about software status and add masklayer.
* Rewrite the code of system information.
* Add some signals and slots.
* Fixed the bug about Software signals(LP: #1226389).
* Modify KThread and add base.py.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include <QtGui>
30
30
#include <QAction>
31
31
#include "ui_tray.h"
 
32
#include "suspensionframe.h"
 
33
#include "systemdispatcher.h"
32
34
 
33
35
class Tray: public QWidget, private Ui::Tray
34
36
{
37
39
    explicit Tray(QWidget *parent = 0);
38
40
    virtual ~Tray();
39
41
    QIcon icon;
 
42
    //创建托盘
40
43
    void createTray();
41
 
 
42
44
    QSystemTrayIcon *trayIcon;
43
45
    QMenu *trayMenu;
44
 
    QAction *actionShow, *actionQuit;
 
46
    //监控球、QML、退出程序三个托盘菜单
 
47
    QAction *actionShow, *actionQml, *actionQuit;
 
48
 
 
49
    virtual QSize sizeHint()const;
 
50
private:
 
51
    QPoint dragPos;
 
52
    SuspensionFrame *frame;
 
53
    SystemDispatcher *dispather;
 
54
    QString cpu_value;
 
55
    QString up_speed;
 
56
    QString down_speed;
 
57
    double used_memory;
 
58
    QString free_memory;
 
59
    int memory_size;
 
60
    double total_size;
 
61
    QString ratio;
 
62
    QStringList speed;
 
63
    QStringList total_speed;
 
64
    QSize initSize;
 
65
    QImage wheel;
 
66
    QPixmap blister;
 
67
    int ratio_sus;
 
68
protected:
 
69
    void mousePressEvent(QMouseEvent *event);
 
70
    void mouseMoveEvent(QMouseEvent *event);
 
71
    void mouseReleaseEvent(QMouseEvent *event);
 
72
    void mouseDoubleClickEvent(QMouseEvent *event);
 
73
    void paintEvent(QPaintEvent *);
 
74
    void resizeEvent(QResizeEvent *event);
45
75
 
46
76
public slots:
47
77
    void handle_trayIcon_activated(QSystemTrayIcon::ActivationReason reason);
 
78
    //显示/隐藏监控球
48
79
    void showOrHide();
49
 
 
 
80
    //显示/隐藏QML主界面
 
81
    void showOrHideQml();
 
82
    //小监控球数据更新
 
83
    void updateData();
 
84
    //开始整理内存,一键加速
 
85
    void startMemoryAccelerate();
50
86
signals:
51
 
    void showFloat();
 
87
    //显示/隐藏QML主界面的信号
 
88
    void showOrHideQmlSignal();
 
89
    //将小监控球实时更新的数据同步到大监控球
 
90
    void sysc_data(QString upspeed, QString downspeed, QString ratio, int used_memory, QString free_memory, QString cpu_ratio);
52
91
};
53
92
 
54
93
#endif