[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/utils/rsibreak/src
From: Bram Schoenmakers <bramschoenmakers () kde ! nl>
Date: 2006-03-31 20:12:59
Message-ID: 1143835979.214017.17868.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 525102 by bram:
While toma is still offline, I can safely postpone the feature freeze. :)
o Only update last tiny/big break when activity occurs
o New stat: show time currently idle. I thought I needed it for the change above, but \
didn't seem so. So I upgraded it to a new statistic.
M +1 -0 rsiglobals.h
M +7 -2 rsistats.cpp
M +1 -0 rsistatwidget.cpp
M +6 -0 rsitimer.cpp
--- trunk/playground/utils/rsibreak/src/rsiglobals.h #525101:525102
@@ -32,6 +32,7 @@
IDLENESS,
ACTIVITY_PERC,
MAX_IDLENESS,
+ CURRENT_IDLE_TIME,
IDLENESS_CAUSED_SKIP_TINY,
IDLENESS_CAUSED_SKIP_BIG,
TINY_BREAKS,
--- trunk/playground/utils/rsibreak/src/rsistats.cpp #525101:525102
@@ -31,11 +31,11 @@
m_statistics.insert( TOTAL_TIME, RSIStatItem(i18n("Total recorded time") ) );
m_statistics[TOTAL_TIME].addDerivedItem( ACTIVITY_PERC );
- m_statistics[TOTAL_TIME].addDerivedItem( LAST_TINY_BREAK_COLOR );
- m_statistics[TOTAL_TIME].addDerivedItem( LAST_BIG_BREAK_COLOR );
m_statistics.insert( ACTIVITY, RSIStatItem(i18n("Total time of activity") ) );
m_statistics[ACTIVITY].addDerivedItem( ACTIVITY_PERC );
+ m_statistics[ACTIVITY].addDerivedItem( LAST_TINY_BREAK_COLOR );
+ m_statistics[ACTIVITY].addDerivedItem( LAST_BIG_BREAK_COLOR );
m_statistics.insert( IDLENESS, RSIStatItem(i18n("Total time being idle") ) );
@@ -44,6 +44,8 @@
m_statistics.insert( MAX_IDLENESS, RSIStatItem(i18n("Maximum idle period") ) );
m_statistics[MAX_IDLENESS].addDerivedItem( IDLENESS );
+ m_statistics.insert( CURRENT_IDLE_TIME, RSIStatItem(i18n("Currently idle for") ) \
); +
m_statistics.insert( TINY_BREAKS, RSIStatItem(i18n("Total amount of tiny \
breaks") ) ); m_statistics[TINY_BREAKS].addDerivedItem( PAUSE_SCORE );
m_statistics[TINY_BREAKS].addDerivedItem( LAST_TINY_BREAK );
@@ -203,6 +205,7 @@
increaseStat( IDLENESS );
break;
}
+
case ACTIVITY_PERC:
{
/*
@@ -280,6 +283,7 @@
case ACTIVITY:
case IDLENESS:
case MAX_IDLENESS:
+ case CURRENT_IDLE_TIME:
l->setText( RSIGlobals::instance()->formatSeconds(
m_statistics[ stat ].getValue().toInt() ) );
break;
@@ -389,6 +393,7 @@
"which are skipped because you where idle." );
case PAUSE_SCORE: return i18n("This is an indication how well you bahaved "
"with the brakes.");
+ case CURRENT_IDLE_TIME: return i18n("This is the current idle time.");
default: ;
}
--- trunk/playground/utils/rsibreak/src/rsistatwidget.cpp #525101:525102
@@ -41,6 +41,7 @@
addStat( TOTAL_TIME, subgrid );
addStat( ACTIVITY, subgrid );
addStat( IDLENESS, subgrid );
+ addStat( CURRENT_IDLE_TIME, subgrid );
addStat( MAX_IDLENESS, subgrid );
mGrid->addWidget( gb, 0, 0 );
--- trunk/playground/utils/rsibreak/src/rsitimer.cpp #525101:525102
@@ -238,9 +238,15 @@
int t = idleTime();
if ( t == 0 )
+ {
RSIGlobals::instance()->stats()->increaseStat( ACTIVITY );
+ RSIGlobals::instance()->stats()->setStat( CURRENT_IDLE_TIME, 0 );
+ }
else
+ {
RSIGlobals::instance()->stats()->setStat( MAX_IDLENESS, t, true );
+ RSIGlobals::instance()->stats()->setStat( CURRENT_IDLE_TIME, t );
+ }
/*
kdDebug() << m_intervals["tiny_maximized"] << " " << \
m_intervals["big_maximized"] << " " << t << endl;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic