Skip to content

Commit

Permalink
Closes #4236. Patch allows you to force a Theme Reload by sending a
Browse files Browse the repository at this point in the history
kill -USR1 to the frontend. Very useful for theme developers to force 
a quick theme reload with a "killall -USR1 mythfrontend"




git-svn-id: http://svn.mythtv.org/svn/trunk@15290 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information
GreyFoxx committed Jan 2, 2008
1 parent 8c67d99 commit 4b67e3e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions mythtv/programs/mythfrontend/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,17 @@ void InitJumpPoints(void)
TV::SetEmbedPbbFunc(PlaybackBox::RunPlaybackBox);
}


void signal_USR1_handler(int){
VERBOSE(VB_GENERAL, "SIG USR1 received, reloading theme");
RemoteSendMessage("CLEAR_SETTINGS_CACHE");
gContext->ActivateSettingsCache(false);
qApp->processEvents();
GetMythMainWindow()->JumpTo("Reload Theme");
gContext->removeCurrentLocation();
gContext->ActivateSettingsCache(true);
}

int internal_media_init()
{
REG_MEDIAPLAYER("Internal", "MythTV's native media player.",
Expand Down Expand Up @@ -1410,6 +1421,13 @@ int main(int argc, char **argv)
if (!RunMenu(themedir))
break;

struct sigaction new_action, old_action;
/* Set up the structure to specify the new action. */
new_action.sa_handler = signal_USR1_handler;
::sigemptyset(&new_action.sa_mask);
new_action.sa_flags = 0;
::sigaction (SIGUSR1, &new_action, &old_action);

qApp->setMainWidget(mainWindow);
qApp->exec();
} while (!(exitstatus = handleExit()));
Expand Down

0 comments on commit 4b67e3e

Please sign in to comment.