~ubuntu-branches/ubuntu/breezy/kdemultimedia/breezy

« back to all changes in this revision

Viewing changes to noatun/noatun/modules/systray/kitsystemtray.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-03-24 04:48:58 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050324044858-8ff88o9jxej6ii3d
Tags: 4:3.4.0-0ubuntu3
Add kubuntu_02_hide_arts_menu_entries.diff to hide artsbuilder and artscontrol k-menu entries

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// $Id: kitsystemtray.cpp,v 1.5 2000/12/13 14:51:34 malte Exp $
2
 
//
3
 
// Kit
4
 
//
5
 
// Copyright (C) 1999 Neil Stevens <multivac@fcmail.com>
6
 
//
7
 
// Permission is hereby granted, free of charge, to any person obtaining a copy
8
 
// of this software and associated documentation files (the "Software"), to deal
9
 
// in the Software without restriction, including without limitation the rights
10
 
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
 
// copies of the Software, and to permit persons to whom the Software is
12
 
// furnished to do so, subject to the following conditions:
13
 
// 
14
 
// The above copyright notice and this permission notice shall be included in
15
 
// all copies or substantial portions of the Software.
16
 
// 
17
 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
 
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
 
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
20
 
// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21
 
// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22
 
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
 
// 
24
 
// Except as contained in this notice, the name(s) of the author(s) shall not be
25
 
// used in advertising or otherwise to promote the sale, use or other dealings
26
 
// in this Software without prior written authorization from the author(s).
27
 
 
28
 
#ifdef HAVE_CONFIG_H
29
 
#include <config.h>
30
 
#endif
31
 
 
32
 
#include "noatunapp.h"
33
 
#include "player.h"
34
 
#include "kitsystemtray.h"
35
 
#include "kmainwindow.h"
36
 
#include "kpopupmenu.h"
37
 
#include "kxmlgui.h"
38
 
#include "kiconloader.h"
39
 
 
40
 
KitSystemTray::KitSystemTray(const QString &contextMenu, KMainWindow *parent, const char *name)
41
 
        : KSystemTray(parent, name)
42
 
{
43
 
        setAlignment(AlignHCenter | AlignVCenter);
44
 
        menu = (KPopupMenu *)parent->guiFactory()->container(contextMenu, parent); 
45
 
        menu->insertTitle(SmallIcon("noatun"), QString::null, 0, 0);
46
 
}
47
 
 
48
 
void KitSystemTray::changeTitle(const QPixmap &pixmap, const QString &title)
49
 
{
50
 
        menu->changeTitle(0, pixmap, title);
51
 
}
52
 
 
53
 
void KitSystemTray::showEvent(QShowEvent *)
54
 
{
55
 
        // empty
56
 
}
57
 
 
58
 
void KitSystemTray::mousePressEvent(QMouseEvent *event)
59
 
{
60
 
        if(event->button() == LeftButton)
61
 
                napp->player()->toggleInterfaces();
62
 
        else
63
 
                menu->popup(event->globalPos());
64
 
}
65
 
 
66
 
#include "kitsystemtray.moc"