-
Notifications
You must be signed in to change notification settings - Fork 0
/
presentation_mode.py
78 lines (61 loc) · 2.43 KB
/
presentation_mode.py
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import sublime
import sublime_plugin
DEBUG = False
# TODO: Expand this list
settings = [
'color_scheme',
'font_face',
'font_size',
'theme'
]
class PresentationModeCommand(sublime_plugin.ApplicationCommand):
def run(self):
presentation_settings = sublime.load_settings("PresentationMode.sublime-settings")
s = sublime.load_settings("Preferences.sublime-settings")
if presentation_settings.get("in_presentation_mode"):
return
for setting in settings:
presentation_settings.set("bak_" + setting, s.get(setting))
if presentation_settings.has(setting):
if DEBUG:
print("====")
print(setting)
print(presentation_settings.get(setting))
print(presentation_settings.get("bak_" + setting))
print("====")
s.set(setting, presentation_settings.get(setting))
presentation_settings.set("in_presentation_mode", True)
sublime.save_settings("PresentationMode.sublime-settings")
sublime.save_settings("Preferences.sublime-settings")
class RevertPresentationModeCommand(sublime_plugin.ApplicationCommand):
def run(self):
presentation_settings = sublime.load_settings("PresentationMode.sublime-settings")
s = sublime.load_settings("Preferences.sublime-settings")
if not presentation_settings.get("in_presentation_mode"):
return
for setting in settings:
if DEBUG:
print("====")
print(setting)
print(presentation_settings.get(setting))
print(presentation_settings.get("bak_" + setting))
print("====")
if presentation_settings.has("bak_" + setting):
s.set(setting, presentation_settings.get("bak_" + setting))
presentation_settings.set("in_presentation_mode", False)
sublime.save_settings("PresentationMode.sublime-settings")
sublime.save_settings("Preferences.sublime-settings")
class SaveCurrentCommand(sublime_plugin.ApplicationCommand):
def run(self):
presentation_settings = sublime.load_settings("PresentationMode.sublime-settings")
s = sublime.load_settings("Preferences.sublime-settings")
for setting in settings:
if DEBUG:
print("====")
print(setting)
print(presentation_settings.get(setting))
print(s.get(setting))
print("====")
presentation_settings.set(setting, s.get(setting))
sublime.save_settings("PresentationMode.sublime-settings")
sublime.save_settings("Preferences.sublime-settings")