@@ -433,7 +433,7 @@ def __init__(self, parent, config, theme,
433433 self ._applied_color_pair = applied_color_pair
434434 self ._normal_color_pair = normal_color_pair
435435 self ._transparent = is_transparent
436- self ._is_watched = is_watched
436+ self ._theme_is_watched = is_watched
437437 self ._a_lock = a_lock
438438 a_lock .acquire ()
439439 if log_file :
@@ -447,6 +447,12 @@ def __init__(self, parent, config, theme,
447447 logger .error ('applied_theme_name = {}' .format (applied_theme_name ))
448448 logger .error ('config_theme_name = {}' .format (config_theme_name ))
449449 logger .error ('========== Theme Window End\n \n ' )
450+ for n in self ._cnf .opts .keys ():
451+ logger .error ('{0}: {1}' .format (n , self ._cnf .opts [n ]))
452+
453+ @property
454+ def theme_is_watched (self ):
455+ return self ._theme_is_watched
450456
451457 def set_global_functions (self , global_functions ):
452458 self ._global_functions = {}
@@ -474,6 +480,12 @@ def show(self, touch_selection=True):
474480 self ._themes .extend (themes_to_add )
475481 self ._items = len (self ._themes )
476482 self ._get_titles_ids ()
483+ self ._first_theme_to_watch = 0
484+ for i , n in enumerate (self ._themes ):
485+ if 'User Themes' in n [0 ]:
486+ self ._first_theme_to_watch = i
487+ if self ._first_theme_to_watch == 0 :
488+ self ._first_theme_to_watch = len (self ._themes )
477489
478490 for a_theme in self ._themes :
479491 if len (a_theme [0 ]) > self ._max_title_width :
@@ -694,7 +706,7 @@ def refresh(self):
694706 col = curses .color_pair (self ._normal_color_pair )
695707 self ._win .hline (i + 1 , 1 , ' ' , self ._max_title_width + 2 , col )
696708 if an_item == self ._config_theme :
697- if self ._is_watched == self . _themes [ an_item ][ 0 ] :
709+ if self ._theme_is_watched :
698710 token = '+'
699711 else :
700712 token = '*'
@@ -832,16 +844,17 @@ def keypress(self, char):
832844 if not self .changed_from_config :
833845 self ._config_theme = self ._selection
834846 self ._config_theme_name = self ._themes [self ._selection ][0 ]
835- if char in ( ord ( 'c' ), ord ( 'C' )):
836- if self . _themes [ self . _selection ][ 1 ] :
837- self ._applied_theme_is_watched = self ._config_theme_is_watched = self . _themes [ self . _selection ][ 0 ]
838- else :
839- self . _applied_theme_is_watched = self . _config_theme_is_watched = ''
840- if char in ( ord ( 's' ), ord ( 'C' )):
841- ''' close window '''
842- curses . ungetch ( 'q' )
847+ self . _theme_is_watched = False
848+ if char == ord ( 'c' ) :
849+ if self ._selection > self ._first_theme_to_watch and \
850+ self . _themes [ self . _selection ][ 1 ] :
851+ logger . error ( 'first = {0}, selection = {1}' . format ( self . _first_theme_to_watch , self . _selection ))
852+ self . _theme_is_watched = True
853+ else :
854+ self . _theme_is_watched = False
843855 else :
844- self .refresh ()
856+ self ._theme_is_watched = False
857+ self .refresh ()
845858 return self ._selection , True
846859 elif char in (curses .KEY_UP , ord ('k' )):
847860 self .jumpnr = ''
0 commit comments