~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to kscd/docking.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *              KSCD -- a simpole cd player for the KDE project
 
3
 *
 
4
 * $Id: docking.cpp,v 1.23 2001/03/25 04:23:00 tibirna Exp $
 
5
 *
 
6
 *              Copyright (C) 1997 Bernd Johannes Wuebben
 
7
 *                      wuebben@math.cornell.edu
 
8
 *
 
9
 * This program is free software; you can redistribute it and/or
 
10
 * modify it under the terms of the GNU Library General Public
 
11
 * License as published by the Free Software Foundation; either
 
12
 * version 2 of the License, or (at your option) any later version.
 
13
 *
 
14
 * This program is distributed in the hope that it will be useful,
 
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
17
 * Library General Public License for more details.
 
18
 *
 
19
 * You should have received a copy of the GNU Library General Public
 
20
 * License along with this program; if not, write to the Free
 
21
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
22
 */
 
23
 
 
24
#include "kscd.h"
 
25
 
 
26
#include <qtooltip.h>
 
27
#include <kapp.h>
 
28
 
 
29
#include "docking.h"
 
30
#include <klocale.h>
 
31
#include <kiconloader.h>
 
32
#include <kglobal.h>
 
33
#include <kpopupmenu.h>
 
34
 
 
35
DockWidget::DockWidget( KSCD* parent, const char *name)
 
36
    : KSystemTray( parent, name )
 
37
{
 
38
 
 
39
    setPixmap( UserIcon("cdsmall") );
 
40
 
 
41
      // popup menu for right mouse button
 
42
    QPopupMenu* popup = contextMenu();
 
43
 
 
44
    popup->insertItem(i18n("Play/Pause"), parent, SLOT(playClicked()));
 
45
    popup->insertItem(i18n("Stop"), parent, SLOT(stopClicked()));
 
46
    popup->insertItem(i18n("Forward"), parent, SLOT(fwdClicked()));
 
47
    popup->insertItem(i18n("Backward"), parent, SLOT(bwdClicked()));
 
48
    popup->insertItem(i18n("Next"), parent, SLOT(nextClicked()));
 
49
    popup->insertItem(i18n("Previous"), parent, SLOT(prevClicked()));
 
50
    popup->insertItem(i18n("Eject"), parent, SLOT(ejectClicked()));
 
51
 
 
52
    tip = "";
 
53
    setToolTip(tip);
 
54
}
 
55
 
 
56
DockWidget::~DockWidget() {
 
57
}
 
58
 
 
59
void DockWidget::setToolTip(const QString& text)
 
60
{
 
61
    if (tip == text)
 
62
        return;
 
63
    if (text.isEmpty())
 
64
        tip = "KSCD";
 
65
    else
 
66
        tip = text;
 
67
    QToolTip::remove(this);
 
68
    QToolTip::add(this, tip);
 
69
 
 
70
}
 
71
 
 
72
 
 
73
#include "docking.moc"