Skip to content
Browse files

Move the hdmi mode translation intot the rpiconf class

  • Loading branch information...
1 parent f40b036 commit 2652cc26d5421cdb56c27132757081aa9156ad1d @Huulivoide committed May 14, 2012
Showing with 11 additions and 12 deletions.
  1. +1 −1 gtk3.py
  2. +10 −11 rpiconf.py
View
2 gtk3.py
@@ -205,7 +205,7 @@ def on_save(self, menu):
global generated_config
config.overscan_state()
- config.hdmi_mode = rpiconf.translate_hdmi_mode(raw_hdmi_mode)
+ config.translate_hdmi_mode(raw_hdmi_mode)
for option in rpiconf.options:
generated_config += (rpiconf.include_option(
option, getattr(config, option)))
View
21 rpiconf.py
@@ -72,6 +72,16 @@ def overscan_state(self):
self.disable_overscan = 1
else:
self.disable_overscan = 0
+
+ def translate_hdmi_mode(self, raw_mode):
+ if raw_mode[0] == "AUTO":
+ self.hdmi_mode = 0
+ elif raw_mode[0] == "VGA":
+ self.hdmi_mode = 1
+ elif raw_mode[0] == "":
+ self.hdmi_mode = 0
+ elif raw_mode[0] != "":
+ self.hdmi_mode = hdtv_modes[raw_mode[0]+raw_mode[1]]
####End functions#####################################################
#Some lists of options
@@ -143,17 +153,6 @@ def get_configfile(_file):
configfile = "config.txt"
return configfile
-def translate_hdmi_mode(raw_mode):
- if raw_mode[0] == "AUTO":
- return 0
- elif raw_mode[0] == "VGA":
- return 1
- elif raw_mode[0] == "":
- return 0
- elif raw_mode[0] != "":
- mode = hdtv_modes[raw_mode[0]+raw_mode[1]]
- return mode
-
def include_option(option, value):
#Make 100% sure we get the value in string format
value = str(value)

0 comments on commit 2652cc2

Please sign in to comment.
Something went wrong with that request. Please try again.