1
//=============================================================================
4
// Creation date : Wed Cct 16 10:45:54 CEST 2002 by Juanjo Álvarez (juanjux@yahoo.es)
6
// This file is part of the KVirc irc client distribution
7
// Copyright (C) 2002 Juanjo Álvarez
8
// Copyright (C) 2002-2008 Szymon Stefanek (pragma at kvirc dot net)
10
// This program is FREE software. You can redistribute it and/or
11
// modify it under the terms of the GNU General Public License
12
// as published by the Free Software Foundation; either version 2
13
// of the License, or (at your opinion) any later version.
15
// This program is distributed in the HOPE that it will be USEFUL,
16
// but WITHOUT ANY WARRANTY; without even the implied warranty of
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18
// See the GNU General Public License for more details.
20
// You should have received a copy of the GNU General Public License
21
// along with this program. If not, write to the Free Software Foundation,
22
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24
//=============================================================================
28
#include "kvi_options.h"
29
#include "kvi_locale.h"
30
#include "kvi_tal_tooltip.h"
35
KviLagOptionsWidget::KviLagOptionsWidget(QWidget * parent)
36
: KviOptionsWidget(parent)
38
setObjectName("lag_options_widget");
41
KviBoolSelector * pUse = addBoolSelector(0,0,0,0, __tr2qs_ctx("Enable lag meter","options"), KviOption_boolUseLagMeterEngine);
42
mergeTip(pUse,__tr2qs_ctx("<center>This enables the lag meter engine, which checks at regular intervals how much lag (latency) the server has.</center>","options"));
43
KviTalGroupBox *g = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("Configuration","options"),KVI_OPTION_BOOL(KviOption_boolUseLagMeterEngine));
44
KviUIntSelector * pInterval = addUIntSelector(g, __tr2qs_ctx("Lag meter heartbeat:","options"),KviOption_uintLagMeterHeartbeat,2000,10000,5000,KVI_OPTION_BOOL(KviOption_boolUseLagMeterEngine));
45
pInterval->setSuffix(__tr2qs_ctx(" msec","options"));
47
__tr2qs_ctx("<center>This option allows you to set the lag meter heartbeat interval.<br>" \
48
"The lower the heartbeat interval the higher will be the accuracy of the lag check " \
49
"but also higher cpu usage and data traffic to the server.<br>" \
50
"Please note that this is NOT the interval between pings sent to the server: " \
51
"the pings (if any) will be sent really less often. " \
52
"5000 is a reasonable value.</center>","options"));
53
connect(pUse,SIGNAL(toggled(bool)),pInterval,SLOT(setEnabled(bool)));
55
KviUIntSelector * pAlarm = addUIntSelector(g, __tr2qs_ctx("Trigger event if lag exceeds:","options"), KviOption_uintLagAlarmTime,5000,1000000,30000, KVI_OPTION_BOOL(KviOption_boolUseLagMeterEngine));
56
pAlarm->setSuffix(__tr2qs_ctx(" msec","options"));
57
mergeTip(pAlarm,__tr2qs_ctx("<center>This option controls the threshold for the " \
58
"OnLagAlarmTimeUp and OnLagAlarmTimeDown events. When the lag goes above " \
59
"the threshold OnLagAlarmTimeUp will be triggered and when the lag falls " \
60
"back below the threshold then OnLagAlarmTimeDown will be triggered</center>","options"));
61
connect(pUse,SIGNAL(toggled(bool)),pAlarm,SLOT(setEnabled(bool)));
63
KviBoolSelector * pShow = addBoolSelector(g, __tr2qs_ctx("Show lag in IRC context display","options"), KviOption_boolShowLagOnContextDisplay, KVI_OPTION_BOOL(KviOption_boolUseLagMeterEngine));
64
mergeTip(pShow,__tr2qs_ctx("<center>This makes the IRC context display applet show the current lag after the user's nickname (in seconds)</center>","options"));
66
connect(pUse,SIGNAL(toggled(bool)),pShow,SLOT(setEnabled(bool)));
67
connect(pUse,SIGNAL(toggled(bool)),g,SLOT(setEnabled(bool)));
69
addRowSpacer(0,2,0,2);
73
KviLagOptionsWidget::~KviLagOptionsWidget()
78
#ifndef COMPILE_USE_STANDALONE_MOC_SOURCES
79
#include "m_optw_lag.moc"
80
#endif //!COMPILE_USE_STANDALONE_MOC_SOURCES