/apps/tuxbox/enigma/lib/gui/ewidget.cpp
Code: Alles auswählen
void eWidget::takeFocus()
{
// desktop shouldnt receive global focus
ASSERT (parent);
// childs shouldnt receive global focus
ASSERT (!parent->parent);
if (!have_focus)
{
oldTLfocus=currentFocus;
currentFocus=this;
/*emit*/ globalFocusChanged(currentFocus);
/* if (oldTLfocus)
{
eDebug("focus problem");
eFatal("da hat %s den focus und %s will ihn haben", oldTLfocus->getText().c_str(), getText().c_str());
} */
addActionMap(&i_focusActions->map);
}
++have_focus;
}
void eWidget::releaseFocus()
{
// desktop shouldnt receive global focus
ASSERT (parent);
// childs shouldnt receive global focus
ASSERT (!parent->parent);
ASSERT (have_focus);
if (have_focus)
{
--have_focus;
if (!have_focus)
{
removeActionMap(&i_focusActions->map);
if (currentFocus==this) // if we don't have lost the focus, ...
{
currentFocus=oldTLfocus; // give it back
/*emit*/ globalFocusChanged(currentFocus);
}
else
eFatal("someone has stolen the focus");
}
}
}
/apps/tuxbox/enigma/lib/base/eerror.cpp
Code: Alles auswählen
void eFatal(const char* fmt, ...)
{
char buf[1024];
char timestr[32];
va_list ap;
va_start(ap, fmt);
vsnprintf(buf, 1024, fmt, ap);
va_end(ap);
{
singleLock s(signalLock);
logOutput(lvlFatal, buf);
if (logOutputSyslog)
{
syslog(LOG_DEBUG, "%s", buf);
}
fprintf(stderr, "%s: %s\n", printtime(timestr, sizeof(timestr)), buf);
}
if (!infatal)
{
infatal=1;
eMessageBox msg(buf, "FATAL ERROR", eMessageBox::iconError|eMessageBox::btOK);
msg.show();
msg.exec();
}
_exit(-1);
}
so sieht meine start_enigma aus
/etc/init.d/start_enigma
Code: Alles auswählen
#!/bin/sh
# $Id: start_enigma,v 1.6 2005/06/10 10:49:13 saruman Exp $
unset TZ
while true ;
do
/bin/enigma
ENIGMARC=$?
echo "Enigma has finished with exit code $ENIGMARC"
case "$ENIGMARC" in
0)
echo "Shutdown"
/sbin/halt
;;
2)
echo "Restart Enigma"
;;
4)
echo "Reboot"
/sbin/reboot
;;
*)
echo "Something went wrong"
echo "enigma crash ? restart..."
;;
esac
done
mrvica