1
1
/* This file is part of KNemo
2
2
Copyright (C) 2004 Percy Leonhardt <percy@eris23.de>
3
Copyright (C) 2009 John Stamp <jstamp@users.sourceforge.net>
3
Copyright (C) 2009, 2010 John Stamp <jstamp@users.sourceforge.net>
5
5
KNemo is free software; you can redistribute it and/or modify
6
6
it under the terms of the GNU Library General Public License as
77
123
static const char confg_general[] = "General";
78
124
static const char confg_interface[] = "Interface_";
79
125
static const char confg_plotter[] = "Plotter_";
126
static const char confg_statsRule[] = "StatsRule_";
127
static const char confg_warnRule[] = "WarnRule_";
81
129
static const char conf_firstStart[] = "FirstStart";
82
130
static const char conf_autoStart[] = "AutoStart";
105
153
// interface statistics
106
154
static const char conf_activateStatistics[] = "ActivateStatistics";
107
static const char conf_customBilling[] = "CustomBilling";
108
155
static const char conf_calendar[] = "Calendar";
109
static const char conf_billingStart[] = "BillingStart";
110
static const char conf_billingMonths[] = "BillingMonths";
111
static const char conf_billingWarnThresh[] = "BillingWarnThreshold";
112
static const char conf_billingWarnUnits[] = "BillingWarnUnits";
113
static const char conf_billingWarnType[] = "BillingWarnType";
114
static const char conf_billingWarnRxTx[] = "BillingWarnRxTx";
156
static const char conf_statsRules[] = "StatsRules";
157
static const char conf_warnRules[] = "WarnRules";
160
static const char conf_statsStartDate[] = "StartDate";
161
static const char conf_statsPeriodUnits[] = "PeriodUnits";
162
static const char conf_statsPeriodCount[] = "PeriodCount";
163
static const char conf_logOffpeak[] = "LogOffpeak";
164
static const char conf_offpeakStartTime[] = "OffpeakStartTime";
165
static const char conf_offpeakEndTime[] = "OffpeakEndTime";
166
static const char conf_weekendIsOffpeak[] = "WeekendIsOffpeak";
167
static const char conf_weekendDayStart[] = "WeekendDayStart";
168
static const char conf_weekendDayEnd[] = "WeekendDayEnd";
169
static const char conf_weekendTimeStart[] = "WeekendTimeStart";
170
static const char conf_weekendTimeEnd[] = "WeekendTimeEnd";
173
static const char conf_warnPeriodUnits[] = "PeriodUnits";
174
static const char conf_warnPeriodCount[] = "PeriodCount";
175
static const char conf_warnTrafficType[] = "TrafficType";
176
static const char conf_warnTrafficDirection[] = "TrafficDirection";
177
static const char conf_warnTrafficUnits[] = "TrafficUnits";
178
static const char conf_warnThreshold[] = "Threshold";
179
static const char conf_warnCustomText[] = "CustomText";
116
181
// interface context menu
117
182
static const char conf_numCommands[] = "NumCommands";
137
202
static const char conf_dayState[] = "DayState";
138
203
static const char conf_weekState[] = "WeekState";
139
204
static const char conf_monthState[] = "MonthState";
205
static const char conf_billingState[] = "BillingState";
140
206
static const char conf_yearState[] = "YearState";
142
208
enum ToolTipEnums
266
332
KUrl statisticsDir;
341
periodUnits( KNemoStats::Month ),
343
offpeakStartTime( QTime( 23, 0) ),
344
offpeakEndTime( QTime( 7, 0) ),
345
weekendIsOffpeak( false ),
346
weekendDayStart( 5 ),
348
weekendTimeStart( QTime( 23, 0) ),
349
weekendTimeEnd( QTime( 7, 0) )
352
bool operator==( StatsRule &r );
353
bool isValid( KCalendarSystem *cal );
358
QTime offpeakStartTime;
359
QTime offpeakEndTime;
360
bool weekendIsOffpeak;
363
QTime weekendTimeStart;
364
QTime weekendTimeEnd;
370
: periodUnits( KNemoStats::Month ),
372
trafficType( KNemoStats::PeakOffpeak ),
373
trafficDirection( KNemoStats::TrafficIn ),
374
trafficUnits( KNemoStats::UnitG ),
379
bool operator==( WarnRule &r )
381
if ( periodUnits == r.periodUnits &&
382
periodCount == r.periodCount &&
383
trafficType == r.trafficType &&
384
trafficDirection == r.trafficDirection &&
385
trafficUnits == r.trafficUnits &&
386
threshold == r.threshold )
394
int trafficDirection;
269
401
struct InterfaceSettings
271
403
InterfaceSettings()
274
406
colorOutgoing( 0xFF7F08 ),
275
407
colorDisabled( 0x888786 ),
276
408
colorUnavailable( 0x888786 ),
409
colorBackground( 0x888786 ),
277
410
dynamicColor( false ),
278
411
colorIncomingMax( 0x96FFFF ),
279
412
colorOutgoingMax( 0xFFC868 ),
283
416
iconFont( KGlobalSettings::generalFont() ),
284
417
numCommands( 0 ),
285
418
trafficThreshold( 0 ),
286
warnThreshold( 0.0 ),
289
warnTotalTraffic( false ),
290
419
hideWhenUnavailable( false ),
291
420
hideWhenDisconnected( false ),
292
activateStatistics( false ),
293
customBilling( false ),
421
activateStatistics( false )
297
424
QString iconTheme;
310
438
unsigned int trafficThreshold;
311
double warnThreshold;
314
bool warnTotalTraffic;
315
439
bool hideWhenUnavailable;
316
440
bool hideWhenDisconnected;
317
441
bool activateStatistics;
442
QList<StatsRule> statsRules;
443
QList<WarnRule> warnRules;
321
444
QString calendar;
323
446
QList<InterfaceCommand> commands;