~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to ksysguard/gui/SensorDisplayLib/SensorLoggerDlg.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the KDE project
 
2
   Copyright ( C ) 2003 Nadeem Hasan <nhasan@kde.org>
 
3
 
 
4
   This program is free software; you can redistribute it and/or
 
5
   modify it under the terms of the GNU General Public
 
6
   License as published by the Free Software Foundation; either
 
7
   version 2 of the License, or (at your option) any later version.
 
8
 
 
9
   This program is distributed in the hope that it will be useful,
 
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
   General Public License for more details.
 
13
 
 
14
   You should have received a copy of the GNU General Public License
 
15
   along with this program; see the file COPYING.  If not, write to
 
16
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
17
   Boston, MA 02110-1301, USA.
 
18
*/
 
19
 
 
20
#include "SensorLoggerDlg.h"
 
21
#include "ui_SensorLoggerDlgWidget.h"
 
22
 
 
23
#include <QLayout>
 
24
 
 
25
#include <klocale.h>
 
26
 
 
27
SensorLoggerDlg::SensorLoggerDlg( QWidget *parent, const char *name )
 
28
    : KDialog( parent )
 
29
{
 
30
  setObjectName( name );
 
31
  setModal( true );
 
32
  setCaption( i18n( "Sensor Logger" ) );
 
33
  setButtons( Ok|Cancel );
 
34
 
 
35
  QWidget *main = new QWidget( this );
 
36
 
 
37
  m_loggerWidget = new Ui_SensorLoggerDlgWidget;
 
38
  m_loggerWidget->setupUi( main );
 
39
  m_loggerWidget->m_fileName->setMode(KFile::File|KFile::LocalOnly);
 
40
 
 
41
  setMainWidget( main );
 
42
}
 
43
 
 
44
SensorLoggerDlg::~SensorLoggerDlg()
 
45
{
 
46
  delete m_loggerWidget;
 
47
}
 
48
 
 
49
QString SensorLoggerDlg::fileName() const
 
50
{
 
51
  return m_loggerWidget->m_fileName->url().path();
 
52
}
 
53
 
 
54
int SensorLoggerDlg::timerInterval() const
 
55
{
 
56
  return m_loggerWidget->m_timerInterval->value();
 
57
}
 
58
 
 
59
bool SensorLoggerDlg::lowerLimitActive() const
 
60
{
 
61
  return m_loggerWidget->m_lowerLimitActive->isChecked();
 
62
}
 
63
 
 
64
bool SensorLoggerDlg::upperLimitActive() const
 
65
{
 
66
  return m_loggerWidget->m_upperLimitActive->isChecked();
 
67
}
 
68
 
 
69
double SensorLoggerDlg::lowerLimit() const
 
70
{
 
71
  return m_loggerWidget->m_lowerLimit->text().toDouble();
 
72
}
 
73
 
 
74
double SensorLoggerDlg::upperLimit() const
 
75
{
 
76
  return m_loggerWidget->m_upperLimit->text().toDouble();
 
77
}
 
78
 
 
79
void SensorLoggerDlg::setFileName( const QString &url )
 
80
{
 
81
  m_loggerWidget->m_fileName->setUrl( url );
 
82
}
 
83
 
 
84
void SensorLoggerDlg::setTimerInterval( int i )
 
85
{
 
86
  m_loggerWidget->m_timerInterval->setValue( i );
 
87
}
 
88
 
 
89
void SensorLoggerDlg::setLowerLimitActive( bool b )
 
90
{
 
91
  m_loggerWidget->m_lowerLimitActive->setChecked( b );
 
92
}
 
93
 
 
94
void SensorLoggerDlg::setUpperLimitActive( bool b )
 
95
{
 
96
  m_loggerWidget->m_upperLimitActive->setChecked( b );
 
97
}
 
98
 
 
99
void SensorLoggerDlg::setLowerLimit( double limit )
 
100
{
 
101
  m_loggerWidget->m_lowerLimit->setText( QString::number( limit ) );
 
102
}
 
103
 
 
104
void SensorLoggerDlg::setUpperLimit( double limit )
 
105
{
 
106
  m_loggerWidget->m_upperLimit->setText( QString::number( limit ) );
 
107
}
 
108
 
 
109
#include "SensorLoggerDlg.moc"
 
110
 
 
111
/* vim: et sw=2 ts=2
 
112
*/
 
113