~ubuntu-branches/ubuntu/gutsy/kdebase-workspace/gutsy

« back to all changes in this revision

Viewing changes to ksysguard/gui/SensorDisplayLib/DummyDisplay.cc

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-09-05 20:45:14 UTC
  • Revision ID: james.westby@ubuntu.com-20070905204514-632hhspl0nvrc84i
Tags: upstream-3.93.0
ImportĀ upstreamĀ versionĀ 3.93.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    KSysGuard, the KDE System Guard
 
3
 
 
4
    Copyright (c) 1999, 2000, 2001 Chris Schlaeger <cs@kde.org>
 
5
 
 
6
    This program is free software; you can redistribute it and/or
 
7
    modify it under the terms of version 2 of the GNU General Public
 
8
    License as published by the Free Software Foundation.
 
9
 
 
10
    This program is distributed in the hope that it will be useful,
 
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
    GNU General Public License for more details.
 
14
 
 
15
    You should have received a copy of the GNU General Public License
 
16
    along with this program; if not, write to the Free Software
 
17
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
18
 
 
19
*/
 
20
 
 
21
#include <klocale.h>
 
22
#include <ksgrd/SensorManager.h>
 
23
#include <QMouseEvent>
 
24
 
 
25
#include "DummyDisplay.h"
 
26
 
 
27
DummyDisplay::DummyDisplay( QWidget* parent, SharedSettings *workSheetSettings )
 
28
  : KSGRD::SensorDisplay( parent, i18n( "Drop Sensor Here" ), workSheetSettings )
 
29
{
 
30
  setMinimumSize( 16, 16 );
 
31
 
 
32
  setWhatsThis(i18n("This is an empty space in a worksheet. Drag a sensor from "
 
33
                    "the Sensor Browser and drop it here. A sensor display will "
 
34
                    "appear that allows you to monitor the values of the sensor "
 
35
                    "over time." ) );
 
36
}
 
37
 
 
38
bool DummyDisplay::eventFilter( QObject* object, QEvent* event )
 
39
{
 
40
  if ( event->type() == QEvent::MouseButtonRelease &&
 
41
       ( (QMouseEvent*)event)->button() == Qt::LeftButton )
 
42
    setFocus();
 
43
 
 
44
  return QWidget::eventFilter( object, event );
 
45
}
 
46
 
 
47
#include "DummyDisplay.moc"