[mythtv] [PATCH] MythFrontend Status Page exits when theme cannot be loaded

Harvard Pan harvardpan at gmail.com
Sat Apr 30 03:59:32 UTC 2005


This patch changes the behavior from exiting the program, to simply
displaying an error message to the user while continuing to function.
I found that when I upgraded to 0.18, for some reason the
status-ui.xml file was missing from my theme directory as well as the
default directory. This caused mythfrontend to simply exit whenever
the status page was accessed.

Steps to reproduce:
1. Remove status-ui.xml from default and theme directories if it's there
2. Load mythfrontend
3. navigate to the status page. Note that mythfrontend exits

Changes made:
- added isInitialized boolean member variable and getter function to
StatusBox class
- changed LoadTheme to return bool instead of void
- instead of calling exit(-1) on errors, simply return false in LoadTheme
- in the StatusBox constructor, if the theme cannot be loaded, it will
return (isInitialized remains false)
- in main.cpp, check whether the status box was initialized. if not,
display a dialog.

This is my first patch with strings, so i'm not sure what the process
is for internationalization. let me know if there's something else
that i need to do and i'll submit it. I have attached the 3 diff
files.

--Harvard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp.diff
Type: text/x-patch
Size: 585 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20050429/e35c3a32/main.cpp.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: statusbox.cpp.diff
Type: text/x-patch
Size: 1348 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20050429/e35c3a32/statusbox.cpp.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: statusbox.h.diff
Type: text/x-patch
Size: 328 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20050429/e35c3a32/statusbox.h.bin


More information about the mythtv-dev mailing list