~ubuntu-branches/ubuntu/utopic/smb4k/utopic-proposed

« back to all changes in this revision

Viewing changes to smb4k/smb4ksystemtray.h

  • Committer: Package Import Robot
  • Author(s): Fathi Boudra
  • Date: 2012-05-19 18:54:34 UTC
  • mfrom: (1.1.20)
  • Revision ID: package-import@ubuntu.com-20120519185434-duffny2n87214n1n
Tags: 1.0.1-1
* New upstream release.
* Update debian/compat: bump to 9.
* Update debian/control:
  - bump debhelper to 9.
  - bump kdelibs5-dev build dependency to 4:4.4.0.
  - bump Standards-Version to 3.9.3 (no changes needed).
  - Replace smbfs dependency by cifs-utils. (Closes: #638162)
* Update debian/copyright:
  - update upstream URL.
  - update upstream e-mail.
* Update debian/smb4k.lintian-overrides file.
* Update debian/watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
    smb4ksystemtray  -  This is the system tray window class of Smb4K.
3
3
                             -------------------
4
4
    begin                : Mi Jun 13 2007
5
 
    copyright            : (C) 2007-2008 by Alexander Reinholdt
6
 
    email                : dustpuppy@users.berlios.de
 
5
    copyright            : (C) 2007-2011 by Alexander Reinholdt
 
6
    email                : alexander.reinholdt@kdemail.net
7
7
 ***************************************************************************/
8
8
 
9
9
/***************************************************************************
19
19
 *                                                                         *
20
20
 *   You should have received a copy of the GNU General Public License     *
21
21
 *   along with this program; if not, write to the                         *
22
 
 *   Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,   *
23
 
 *   MA  02111-1307 USA                                                    *
 
22
 *   Free Software Foundation, 51 Franklin Street, Suite 500, Boston,      *
 
23
 *   MA 02110-1335, USA                                                    *
24
24
 ***************************************************************************/
25
25
 
26
26
#ifndef SMB4KSYSTEMTRAY_H
31
31
#endif
32
32
 
33
33
// Qt includes
34
 
#include <QAction>
35
 
#include <QActionGroup>
 
34
#include <QWidget>
 
35
#include <QString>
36
36
 
37
37
// KDE includes
38
 
#include <ksystemtrayicon.h>
39
 
#include <kactionmenu.h>
40
 
 
41
 
class Smb4KSystemTray : public KSystemTrayIcon
 
38
#include <kstatusnotifieritem.h>
 
39
 
 
40
 
 
41
class Smb4KSystemTray : public KStatusNotifierItem
42
42
{
43
43
  Q_OBJECT
44
44
 
 
45
  friend class Smb4KMainWindow;
 
46
 
45
47
  public:
46
48
    /**
47
49
     * The constructor.
56
58
    ~Smb4KSystemTray();
57
59
 
58
60
    /**
59
 
     * Embeds the system tray window into the system tray, if @p ebd is
60
 
     * TRUE. Otherwise, it removes it from there. Note, that the system tray
61
 
     * icon won't be deleted but only hidden!
62
 
     *
63
 
     * @param ebd           If TRUE the system tray icon will be embedded into
64
 
     *                      the system tray.
65
 
     */
66
 
    void embed( bool ebd );
67
 
 
68
 
    /**
69
 
     * This function returns TRUE if the system tray window is embedded into
70
 
     * the system tray, i.e. it is visible, and FALSE otherwise.
71
 
     *
72
 
     * @returns TRUE if the system tray window is embedded.
73
 
     */
74
 
    bool isEmbedded() { return isVisible(); }
75
 
 
76
 
    /**
77
 
     * This function (re-)loads the settings for this widget. It basically just
78
 
     * runs the slot slotSetupBookmarkMenu() and slotSetupSharesMenu(), that will
79
 
     * do everything to properly set up the menus.
80
 
     *
81
 
     * This slot *does not* manage the appearance (or disappearance) of this widget
82
 
     * in the system tray. You need to use embed() to do this.
 
61
     * This function (re-)loads the settings for this widget.
83
62
     */
84
63
    void loadSettings();
85
64
 
116
95
    void slotSettingsChanged( const QString &dialogName );
117
96
 
118
97
    /**
119
 
     * This slot is invoked when the bookmarks have been updated. It sets up the
120
 
     * bookmark menu, inserts the bookmark actions into it and automatically
121
 
     * disables them if they were already mounted (@see slotSetupSharesMenu() as well).
122
 
     */
123
 
    void slotSetupBookmarksMenu();
124
 
 
125
 
    /**
126
 
     * This slot opens the bookmark editor.
127
 
     *
128
 
     * @param checked         TRUE if the action can be and is checked and FALSE
129
 
     *                        otherwise.
130
 
     */
131
 
    void slotBookmarkEditor( bool checked );
132
 
 
133
 
    /**
134
 
     * This slot is called when a bookmark action has been triggered. It initializes the
135
 
     * mounting of the represented share.
136
 
     *
137
 
     * @param action        The bookmark action.
138
 
     */
139
 
    void slotBookmarkTriggered( QAction *action );
140
 
 
141
 
    /**
142
 
     * This slot enables and disables the bookmarks. If a share that's represented
143
 
     * by the bookmark is mounted, the bookmark will be disabled. It will be
144
 
     * enabled, when it is unmounted again.
145
 
     */
146
 
    void slotEnableBookmarks();
147
 
 
148
 
    /**
149
 
     * This slot is activated when the list of mounted shares has been updated.
150
 
     * It setus up the "Mounted Shares" menu and also enables/disables the
151
 
     * bookmarks in the "Bookmarks" menu. It is connected to the
152
 
     * Smb4KMounter::updated() signal.
153
 
     */
154
 
    void slotSetupSharesMenu();
155
 
 
156
 
    /**
157
 
     * This slot initializes the umounting of all shares. It is connected to the
158
 
     * "Unmount All" action of the "Mounted Shares" menu.
159
 
     *
160
 
     * @param checked         TRUE if the action can be and is checked and FALSE
161
 
     *                        otherwise.
162
 
     */
163
 
    void slotUnmountAllTriggered( bool checked );
164
 
 
165
 
    /**
166
 
     * This slot is called whan a share related action has been triggered. It
167
 
     * executes all actions that can be performed: Unmounting, Synchronization,
168
 
     * etc.
169
 
     *
170
 
     * @param action        The action that has been triggered.
171
 
     */
172
 
    void slotShareActionTriggered( QAction *action );
173
 
 
174
 
  private:
175
 
    /**
176
 
     * The action menu for the bookmarks.
177
 
     */
178
 
    KActionMenu *m_bookmarks_menu;
179
 
 
180
 
    /**
181
 
     * The action menu for the mounted shares.
182
 
     */
183
 
    KActionMenu *m_shares_menu;
184
 
 
185
 
    /**
186
 
     * This QActionGroup manages the bookmark actions.
187
 
     */
188
 
    QActionGroup *m_bookmarks;
189
 
 
190
 
    /**
191
 
     * This QActionGroup manages all menus representing a share.
192
 
     */
193
 
    QActionGroup *m_share_menus;
194
 
 
195
 
    /**
196
 
     * This QActionGoup manages all actions associated with
197
 
     * shares.
198
 
     */
199
 
    QActionGroup *m_shares_actions;
 
98
     * Set the status of the system tray icon. This slot checks the global
 
99
     * list of mounted shares and the global list of workgroups. If neither of
 
100
     * them contains any item, the icon is set to passive state until one of 
 
101
     * the lists is populated.
 
102
     */
 
103
    void slotSetStatus();
200
104
};
201
105
 
202
106
#endif