Ticket #4236: reload.patch

File reload.patch, 1.4 KB (added by james.meyer@…, 18 years ago)
  • programs/mythfrontend/main.cpp

    old new  
    7272    RunProgramGuide(chanid, channum);
    7373}
    7474
     75
     76
     77
    7578void startFinder(void)
    7679{
    7780    RunProgramFind();
     
    761764    }
    762765}
    763766
     767
    764768void InitJumpPoints(void)
    765769{
    766770    REG_JUMP("Reload Theme", "", "", reloadTheme);
     
    784788    TV::SetEmbedPbbFunc(PlaybackBox::RunPlaybackBox);
    785789}
    786790
     791
     792void signal_USR1_handler(int){
     793      VERBOSE(VB_GENERAL, "SIG USR1 received, reloading theme");       
     794      RemoteSendMessage("CLEAR_SETTINGS_CACHE");
     795      gContext->ActivateSettingsCache(false);
     796      qApp->processEvents();
     797      GetMythMainWindow()->JumpTo("Reload Theme");
     798      gContext->removeCurrentLocation();
     799      gContext->ActivateSettingsCache(true);
     800}
     801
    787802int internal_media_init()
    788803{
    789804    REG_MEDIAPLAYER("Internal", "MythTV's native media player.",
     
    14111426
    14121427        if (!RunMenu(themedir))
    14131428            break;
    1414 
     1429         struct sigaction new_action, old_action;
     1430        /* Set up the structure to specify the new action. */
     1431        new_action.sa_handler = signal_USR1_handler;
     1432        ::sigemptyset(&new_action.sa_mask);
     1433        new_action.sa_flags = 0;
     1434        ::sigaction (SIGUSR1, &new_action, &old_action);
    14151435        qApp->setMainWidget(mainWindow);
    14161436        qApp->exec();
    14171437    } while (!(exitstatus = handleExit()));