From ab7a2112f96bb48ee2713ada4c9ce73322cf3cba Mon Sep 17 00:00:00 2001 From: Sascha Volkenandt Date: Sun, 7 Jan 2007 18:42:45 +0000 Subject: - simplified error handling - moved error_widget to error.ecpp as subcomponent - introduced error handling where necessary - moved creation of timer settings string from page to code - added redirect to edit_timer.ecpp after saving a timer --- timers.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'timers.cpp') diff --git a/timers.cpp b/timers.cpp index 131e65f..efe8451 100644 --- a/timers.cpp +++ b/timers.cpp @@ -1,6 +1,7 @@ #include #include #include +#include "exception.h" #include "timers.h" #include "tools.h" @@ -78,16 +79,26 @@ TimerManager::TimerManager() { } -string TimerManager::UpdateTimer( cTimer* timer, std::string const& timerString ) +void TimerManager::UpdateTimer( cTimer* timer, int flags, string const& channel, string const& weekdays, string const& day, + int start, int stop, int priority, int lifetime, string const& title, string const& aux ) { - TimerPair timerData( timer, timerString ); + ostringstream builder; + builder << flags << ":" << channel << ":" << ( weekdays != "-------" ? weekdays : "" ) + << ( weekdays == "-------" || day.empty() ? "" : "@" ) << day << ":" << start << ":" << stop << ":" + << priority << ":" << lifetime << ":" << title << ":" << aux; + dsyslog("%s", builder.str().c_str()); + + TimerPair timerData( timer, builder.str() ); dsyslog("SV: in UpdateTimer"); m_updateTimers.push_back( timerData ); dsyslog("SV: wait for update"); m_updateWait.Wait( *this ); dsyslog("SV: update done"); - return GetError( timerData ); + + string error = GetError( timerData ); + if ( !error.empty() ) + throw HtmlError( error ); } void TimerManager::DoPendingWork() -- cgit v1.2.3