"someone has stolen the focus"

Alles rund um das grafische Benutzerinterface Enigma
Antworten
mrvica
Einsteiger
Einsteiger
Beiträge: 342
Registriert: Freitag 24. September 2004, 12:48

"someone has stolen the focus"

Beitrag von mrvica »

was mich in Enigma seit langer Zeit irritiert ist der Fehler "someone hast stolen the focus", "jemand hat den focus gestohlen", die Fehlermeldung ist nicht grad aussagekräftig, Enigma quittiert ohne Vorwarnung immer mit shutdown, sehr ärgerlich, der Fehler kommt vor, wenn man sich an der blauen Taste irgendwie ungünstig verdrückt oder an derselben lange genug rumdrückt, etwas Abhilfe schafft Umsortieren von Plugins indem man ein harmloses Plugin auf den blauen Knopf legt, am besten vom Type 3 (.sh Plugin), der Fehler tritt weniger öfter auf, aber immernoch, bin der Sache etwas näher gekommen, habe aber immernoch keine Lösung, der Fehler kommt vor in

/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");
		}
 	}
}
kann man da was machen dass die Box bei dem Fehler nicht herunterfährt, eFatal ist definiert in:
/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);
}
ich habe /etc/init.d/start_enigma etwas abgeändert damit ich den Fehler abfangen kann, in dem Fall soll Enigma neustarten und nicht shutdown machen, leider ist der exit code bei dem Fehler "0" was eben dem Shutdown entspricht, fals man den Fehler nicht fixen kann, könnte man Enigma veranlassen einen anderen exit code zurückzugeben

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
hat jemand eine Idee?

mrvica
mrvica
Einsteiger
Einsteiger
Beiträge: 342
Registriert: Freitag 24. September 2004, 12:48

Re: "someone has stolen the focus"

Beitrag von mrvica »

mrvica hat geschrieben:in dem Fall soll Enigma neustarten und nicht shutdown machen, leider ist der exit code bei dem Fehler "0" was eben dem Shutdown entspricht, fals man den Fehler nicht fixen kann, könnte man Enigma veranlassen einen anderen exit code zurückzugeben
ich antworte mir selbst, klar geht das, mit _exit(2) in eerorr.cpp, hatte bei mir mehrere Sourcen auf der Platte (Pli, Merlin, CVS), habe sie durcheinander gebracht, bei PLi steht da _exit(-1), habe mich immer gewundert, warum die Box bei dem Fehler shutdown macht, in CVS steht _exit(0) und ich hatte CVS Image compiliert, deswegen, jetzt ist aber OK, jetzt macht bei mir die Box nie Shutdown, ausser wenn ich das will, ihr werdet die angepasste start_enigma brauchen und einige Änderungen in /apps/tuxbox/enigma/src/enigma_main.cpp (und _exit(2) in eerror.cpp)

Code: Alles auswählen

--- enigma_main.cpp	Sat Nov 14 17:27:48 2009
+++ enigma_main.cpp	Sun Nov 07 18:51:36 2010
@@ -3142,6 +3142,9 @@
 			case 4: // reboot
 					eZap::getInstance()->quit(4);
 					break;
+			case 5: // restart enigma
+					eZap::getInstance()->quit(2);
+					break;
 			case 1: // shutdown
 /*				if (handleState())*/
 					eZap::getInstance()->quit();
@@ -8013,9 +8016,11 @@
 		case eSystemInfo::DM5600:
 		case eSystemInfo::DM5620:
 			new eListBoxEntryText(&list, _("reboot now"), (void*)4, 0, _("restart your dreambox"));
+			new eListBoxEntryText(&list, _("restart enigma"), (void*)5, 0, _("only restart the software, without rebooting the receiver"));
 			break;
 		case eSystemInfo::TR_DVB272S:
 			new eListBoxEntryText(&list, _("reboot now"), (void*)4, 0, _("restart your receiver"));
+			new eListBoxEntryText(&list, _("restart enigma"), (void*)5, 0, _("only restart the software, without rebooting the receiver"));
 			break;
 		case eSystemInfo::DM500PLUS:
 		case eSystemInfo::DM600PVR:
@@ -8023,10 +8028,12 @@
 		case eSystemInfo::DM7020:
 			new eListBoxEntryText(&list, _("shutdown now"), (void*)1, 0, _("shutdown your dreambox"));
 			new eListBoxEntryText(&list, _("restart"), (void*)4, 0, _("restart your dreambox"));
+			new eListBoxEntryText(&list, _("restart enigma"), (void*)5, 0, _("only restart the software, without rebooting the receiver"));
 			break;
 		case eSystemInfo::dbox2Nokia ... eSystemInfo::dbox2Philips:
 			new eListBoxEntryText(&list, _("shutdown now"), (void*)1, 0, _("shutdown your dbox-2"));
 			new eListBoxEntryText(&list, _("restart"), (void*)4, 0, _("restart your dbox-2"));
+			new eListBoxEntryText(&list, _("restart enigma"), (void*)5, 0, _("only restart the software, without rebooting the receiver"));
 			break;
 	}
 	new eListBoxEntryTextSeparator(&list, eSkin::getActive()->queryImage("listbox.separator"), 0, true );
mrvica
Antworten