46
48
mColorOutgoing( 0xFF7F08 ),
47
49
mColorBackground( 0x313031 )
51
generalSettings = new GeneralSettings();
49
52
backend = BackendFactory::backend();
50
53
QDBusConnection::sessionBus().registerObject("/knemo", this, QDBusConnection::ExportScriptableSlots);
51
54
mPollTimer = new QTimer();
74
78
config->reparseConfiguration();
77
82
KConfigGroup generalGroup( config, confg_general );
78
mGeneralData.pollInterval = clamp<double>(generalGroup.readEntry( conf_pollInterval, 1.0 ), 0.1, 2.0 );
79
mGeneralData.pollInterval = validatePoll( mGeneralData.pollInterval );
80
mGeneralData.saveInterval = clamp<int>(generalGroup.readEntry( conf_saveInterval, 60 ), 0, 300 );
81
mGeneralData.statisticsDir = generalGroup.readEntry( conf_statisticsDir, KGlobal::dirs()->saveLocation( "data", "knemo/" ) );
82
mGeneralData.toolTipContent = generalGroup.readEntry( conf_toolTipContent, defaultTip );
83
generalSettings->pollInterval = clamp<double>(generalGroup.readEntry( conf_pollInterval, g.pollInterval ), 0.1, 2.0 );
84
generalSettings->pollInterval = validatePoll( generalSettings->pollInterval );
85
generalSettings->useBitrate = generalGroup.readEntry( conf_useBitrate, g.useBitrate );
86
generalSettings->saveInterval = clamp<int>(generalGroup.readEntry( conf_saveInterval, g.saveInterval ), 0, 300 );
87
generalSettings->statisticsDir = generalGroup.readEntry( conf_statisticsDir, g.statisticsDir );
88
generalSettings->toolTipContent = generalGroup.readEntry( conf_toolTipContent, g.toolTipContent );
83
89
// If we already have an Interfaces key--even if its empty--then we
84
90
// shouldn't try to set up a default interface
85
91
if ( generalGroup.hasKey( conf_interfaces ) )
124
130
if ( !mInterfaceHash.contains( key ) )
126
132
const BackendData * data = backend->add( key );
127
Interface *iface = new Interface( key, data, mGeneralData );
133
Interface *iface = new Interface( key, data );
128
134
mInterfaceHash.insert( key, iface );
129
135
newIfaces << key;
145
151
connect( backend, SIGNAL( updateComplete() ), iface, SLOT( processUpdate() ) );
148
mPollTimer->start( mGeneralData.pollInterval * 1000 );
154
mPollTimer->start( generalSettings->pollInterval * 1000 );
151
157
void KNemoDaemon::reparseConfiguration()
178
184
ki18n( description ),
179
185
KAboutData::License_GPL_V2,
180
186
KLocalizedString(),
181
ki18n( "Copyright (C) 2004, 2005, 2006 Percy Leonhardt\nCopyright (C) 2009 John Stamp\n\nSignal plotter taken from KSysGuard\nCopyright (C) 1999 - 2002, Chris Schlaeger\nCopyright (C) 2006 John Tapsell" ),
187
ki18n( "Copyright (C) 2004, 2005, 2006 Percy Leonhardt\nCopyright (C) 2009 John Stamp\n\nSignal plotter taken from KSysGuard\nCopyright (C) 2006 - 2009 John Tapsell" ),
182
188
"http://extragear.kde.org/apps/knemo/",
183
189
"jstamp@users.sourceforge.net");