~ubuntu-branches/ubuntu/natty/nuapplet/natty

« back to all changes in this revision

Viewing changes to src/systray.h

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Chifflier
  • Date: 2010-05-17 15:15:59 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100517151559-lf4zajscmlwf2yef
Tags: 2.3.0-1
* Imported Upstream version 2.3.0
  Add support for new (>= 2.4) libnuclient API (Closes: #573667)
* Urgency high, RC bug
* Bump standards version to 3.8.4
* Update homepage location
* Update dependencies on libnuclient and libnussl >= 2.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 ** Copyright 2004-2007 - INL
 
3
 ** Written by Eric Leblond <eric.leblond@inl.fr>
 
4
 **            Vincent Deffontaines <vincent@inl.fr>
 
5
 ** INL http://www.inl.fr/
 
6
 **
 
7
 ** This program is free software; you can redistribute it and/or modify
 
8
 ** it under the terms of the GNU General Public License as published by
 
9
 ** the Free Software Foundation, version 2 of the License.
 
10
 **
 
11
 ** This program is distributed in the hope that it will be useful,
 
12
 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 ** GNU General Public License for more details.
 
15
 **
 
16
 ** You should have received a copy of the GNU General Public License
 
17
 ** along with this program; if not, write to the Free Software
 
18
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
19
 */
 
20
 
 
21
#ifndef __SYSTRAY__
 
22
#define __SYSTRAY__
 
23
 
 
24
#include <nuclient.h>
 
25
#include <QMainWindow>
 
26
#include <QtGui>
 
27
#include <QSystemTrayIcon>
 
28
#include "auth_dlg.h"
 
29
#include "logs.h"
 
30
#include "preferences.h"
 
31
#include "thread_session.h"
 
32
 
 
33
class NuAppSystray : public QSystemTrayIcon {
 
34
        Q_OBJECT
 
35
 
 
36
public:
 
37
        NuAppSystray();
 
38
        ~NuAppSystray();
 
39
 
 
40
public slots:
 
41
        void onClick(QSystemTrayIcon::ActivationReason reason);
 
42
        void start_auth(QString _username, QString _password);
 
43
        void stop_auth();
 
44
        void popup_about();
 
45
 
 
46
        void tray_set_connected();
 
47
        void tray_set_stopped();
 
48
        void tray_set_trying();
 
49
        void tray_report_error();
 
50
        void tray_report_connected();
 
51
        void tray_report_disconnected();
 
52
 
 
53
signals:
 
54
        void showAuthDlg();
 
55
 
 
56
private:
 
57
        void createActions();
 
58
        void createTrayIcon();
 
59
 
 
60
        void parse_cmdline_options(int argc, char **argv);
 
61
        void usage();
 
62
 
 
63
        // Authentication related
 
64
        QSettings settings;
 
65
        QMenu *trayIconMenu;
 
66
 
 
67
        // GUI related
 
68
        QAction *exitAct;
 
69
        QAction *preferencesAct;
 
70
        QAction *logsAct;
 
71
        QAction *connectAct;
 
72
        QAction *disconnectAct;
 
73
        QAction *aboutAct;
 
74
        ThreadCheckConn timer;
 
75
 
 
76
        NuAppAuthDialog* auth_dlg;
 
77
        NuLogsWindow* logs_dlg;
 
78
        NuAppPreferences* pref_dlg;
 
79
};
 
80
 
 
81
#endif /* __SYSTRAY__ */