]> www.vanbest.org Git - motioneye-debian/commitdiff
fixed text overlay disabling issue; left and right text overlays can now
authorCalin Crisan <ccrisan@gmail.com>
Sun, 8 Feb 2015 15:37:53 +0000 (17:37 +0200)
committerCalin Crisan <ccrisan@gmail.com>
Sun, 8 Feb 2015 15:37:53 +0000 (17:37 +0200)
be individually disabled

src/config.py
templates/main.html

index 1a636a1f8defa0feefdfbc01837987c3242d9248..44f7a71dd50c52e8d669cf72e40c405ef7b8a55d 100644 (file)
@@ -664,6 +664,9 @@ def camera_ui_to_dict(ui):
         elif left_text == 'timestamp':
             data['text_left'] = '%Y-%m-%d\\n%T'
             
+        elif left_text == 'disabled':
+            data['text_left'] = ''
+            
         else:
             data['text_left'] = ui['custom_left_text']
         
@@ -674,6 +677,9 @@ def camera_ui_to_dict(ui):
         elif right_text == 'timestamp':
             data['text_right'] = '%Y-%m-%d\\n%T'
             
+        elif right_text == 'disabled':
+            data['text_right'] = ''
+            
         else:
             data['text_right'] = ui['custom_right_text']
         
@@ -960,6 +966,9 @@ def camera_dict_to_ui(data):
             
         elif text_left == '%Y-%m-%d\\n%T':
             ui['left_text'] = 'timestamp'
+
+        elif text_left == '':
+            ui['left_text'] = 'disabled'
             
         else:
             ui['left_text'] = 'custom-text'
@@ -971,6 +980,9 @@ def camera_dict_to_ui(data):
         elif text_right == '%Y-%m-%d\\n%T':
             ui['right_text'] = 'timestamp'
             
+        elif text_right == '':
+            ui['right_text'] = 'disabled'
+
         else:
             ui['right_text'] = 'custom-text'
             ui['custom_right_text'] = text_right
@@ -1129,8 +1141,8 @@ def _conf_to_dict(lines, list_names=[], no_convert=[]):
             line = line.split('#')[0] # everything up to the first #
             
             parts = line.split(None, 1)
-            if len(parts) != 2:  # invalid line format
-                continue
+            if len(parts) == 1: # empty value
+                parts.append('')
 
             (name, value) = parts
             value = value.strip()
index 0d5a47aee8a1a55fef743850117a0161022bc189..9fcedbab7fed6604fdd76d6bf0f4cf1d69f2a5e7 100644 (file)
                                 <option value="camera-name">Camera Name</option>
                                 <option value="timestamp">Timestamp</option>
                                 <option value="custom-text">Custom Text</option>
+                                <option value="disabled">Disabled</option>
                             </select>
                         </td>
                         <td><span class="help-mark" title="sets the text displayed on the movies and images, on the lower left corner">?</span></td>
                                 <option value="camera-name">Camera Name</option>
                                 <option value="timestamp">Timestamp</option>
                                 <option value="custom-text">Custom Text</option>
+                                <option value="disabled">Disabled</option>
                             </select>
                         </td>
                         <td><span class="help-mark" title="sets the text displayed on the movies and images, on the lower right corner">?</span></td>