summaryrefslogtreecommitdiffstats
path: root/abs/mv-core/myth/release-fixes/mythtv-release-fixes/reload.patch
blob: 9cc2044e6249bd09532a8ee9855d9d3a47fdf5c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--- programs/mythfrontend/main.cpp	2007-11-13 15:34:40.000000000 +0000
+++ programs/mythfrontend/main.cpp.new	2007-11-13 15:36:15.000000000 +0000
@@ -72,6 +72,9 @@
     RunProgramGuide(chanid, channum);
 }
 
+
+
+
 void startFinder(void)
 {
     RunProgramFind();
@@ -761,6 +764,7 @@
     }
 }
 
+
 void InitJumpPoints(void)
 {
     REG_JUMP("Reload Theme", "", "", reloadTheme);
@@ -784,6 +788,17 @@
     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.", 
@@ -1411,7 +1426,12 @@
 
         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()));