Remove text alignment from rating/bool type columns

This commit is contained in:
Kovid Goyal 2010-05-20 09:22:05 -06:00
parent 0376c0a6ef
commit a28c63dc1f

View File

@ -111,17 +111,21 @@ class BooksView(QTableView): # {{{
ac = a if self._model.sorted_on[1] == Qt.AscendingOrder else d ac = a if self._model.sorted_on[1] == Qt.AscendingOrder else d
ac.setCheckable(True) ac.setCheckable(True)
ac.setChecked(True) ac.setChecked(True)
m = self.column_header_context_menu.addMenu( if col not in ('ondevice', 'rating', 'inlibrary') and \
_('Change text alignment for %s') % name) (not self.model().is_custom_column(col) or \
al = self._model.alignment_map.get(col, 'left') self.model().custom_columns[col]['datatype'] not in ('bool',
for x, t in (('left', _('Left')), ('right', _('Right')), ('center', 'rating')):
_('Center'))): m = self.column_header_context_menu.addMenu(
a = m.addAction(t, _('Change text alignment for %s') % name)
partial(self.column_header_context_handler, al = self._model.alignment_map.get(col, 'left')
action='align_'+x, column=col)) for x, t in (('left', _('Left')), ('right', _('Right')), ('center',
if al == x: _('Center'))):
a.setCheckable(True) a = m.addAction(t,
a.setChecked(True) partial(self.column_header_context_handler,
action='align_'+x, column=col))
if al == x:
a.setCheckable(True)
a.setChecked(True)