comparison frontends/primitivus/files_management.py @ 192:879beacb8e16

Primitivus: major changes in SelectableText, menu can now be used with mouse, TabsContainer show wich tab is selected - SelectableText is a WidgetWrap of urwid.Text, and manage attributes and complexe combination like urwid.Text (list of tuples (attribute,text)) - Menu now use a ColumnsRoller, and can't anymore be displayed on 2 rows, avoiding potential bug when display MenuBox - Mouse can be used in menu. Right click on MenuBox make it disappear - Tab container now display which tab is selected by putting a 'title' attribute on the corresponding button /!\ as SelectableText is heavily used, there can be regressions
author Goffi <goffi@goffi.org>
date Thu, 19 Aug 2010 21:11:22 +0800
parents d6c0c5dca9b9
children
comparison
equal deleted inserted replaced
191:1438a1337732 192:879beacb8e16
104 except OSError: 104 except OSError:
105 self.files_list.append(urwid.Text(("warning",_("Impossible to list directory")),'center')) 105 self.files_list.append(urwid.Text(("warning",_("Impossible to list directory")),'center'))
106 directories.sort() 106 directories.sort()
107 files.sort() 107 files.sort()
108 if os.path.abspath(path)!='/' and os.path.abspath(path) != '//': 108 if os.path.abspath(path)!='/' and os.path.abspath(path) != '//':
109 previous_wid = custom_widgets.ClickableText('..',default_attr='directory') 109 previous_wid = custom_widgets.ClickableText(('directory','..'))
110 urwid.connect_signal(previous_wid,'click',self.onPreviousDir) 110 urwid.connect_signal(previous_wid,'click',self.onPreviousDir)
111 self.files_list.append(previous_wid) 111 self.files_list.append(previous_wid)
112 for directory in directories: 112 for directory in directories:
113 if directory.startswith('.') and not self.show_hidden: 113 if directory.startswith('.') and not self.show_hidden:
114 continue 114 continue
115 dir_wid = custom_widgets.ClickableText(directory,default_attr='directory') 115 dir_wid = custom_widgets.ClickableText(('directory',directory))
116 urwid.connect_signal(dir_wid,'click',self.onDirClick) 116 urwid.connect_signal(dir_wid,'click',self.onDirClick)
117 self.files_list.append(dir_wid) 117 self.files_list.append(dir_wid)
118 self.files_list.append(urwid.AttrMap(urwid.Divider('-'),'separator')) 118 self.files_list.append(urwid.AttrMap(urwid.Divider('-'),'separator'))
119 for filename in files: 119 for filename in files:
120 if filename.startswith('.') and not self.show_hidden: 120 if filename.startswith('.') and not self.show_hidden: