From 7b743e61af3195bfb9a7e6d771dc5ce7a5d7beff Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sun, 24 Jul 2011 23:42:05 +0000 Subject: [PATCH] Improve layout of citation tree view svn: r17962 --- src/gui/views/treemodels/citationmodel.py | 4 ++-- src/plugins/lib/libcitationview.py | 27 +++++++++-------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/gui/views/treemodels/citationmodel.py b/src/gui/views/treemodels/citationmodel.py index 2d4cdd7c1..f9bfe9d58 100644 --- a/src/gui/views/treemodels/citationmodel.py +++ b/src/gui/views/treemodels/citationmodel.py @@ -151,7 +151,7 @@ class CitationBaseModel(object): return format_time(data[COLUMN_CHANGE]) def sort_change(self,data): - return "%012x" % data[8] + return "%012x" % data[COLUMN_CHANGE] def column_src_title(self,data): source_handle = data[COLUMN_SOURCE] @@ -278,7 +278,7 @@ class CitationTreeModel(CitationBaseModel, TreeBaseModel): # FIXME: What should the number in the next line be? # FIXME: Only the first element of hmap ever seems to be populated. # Why is this, and is it correct? - self.hmap = [self.column_header] + [None]*14 + self.hmap = [self.column_header] + [None] * len(self.smap) def get_tree_levels(self): """ diff --git a/src/plugins/lib/libcitationview.py b/src/plugins/lib/libcitationview.py index 16d3bbbb3..9f90b78ec 100644 --- a/src/plugins/lib/libcitationview.py +++ b/src/plugins/lib/libcitationview.py @@ -17,7 +17,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# $Id: sourceview.py 17447 2011-05-07 18:42:31Z nick-h $ +# $Id$ """ Citation View @@ -74,12 +74,11 @@ class BaseCitationView(ListView): """ # The data items here have to correspond, in order, to the items in # src/giu.views/treemodels/citationmodel.py - COL_PAGE = 0 + COL_TITLE_PAGE = 0 COL_ID = 1 COL_DATE = 2 COL_CONFIDENCE = 3 - COL_CHAN = 4 - + COL_CHAN = 4 COL_SRC_TITLE = 5 COL_SRC_ID = 6 COL_SRC_AUTH = 7 @@ -88,13 +87,13 @@ class BaseCitationView(ListView): COL_SRC_CHAN = 10 # name of the columns COLUMN_NAMES = [ - _('Volume/Page'), + _('Title/Page'), _('ID'), _('Date'), _('Confidence'), _('Last Changed'), - _('Source: Title'), _('Source: ID'), + _('Source: Title'), _('Source: Author'), _('Source: Abbreviation'), _('Source: Publication Information'), @@ -102,16 +101,12 @@ class BaseCitationView(ListView): ] # default setting with visible columns, order of the col, and their size CONFIGSETTINGS = ( - ('columns.visible', [COL_SRC_TITLE, - COL_PAGE, COL_ID, COL_DATE, COL_CONFIDENCE]), - ('columns.rank', [COL_SRC_TITLE, COL_SRC_ID, COL_SRC_AUTH, - COL_SRC_ABBR, COL_SRC_PINFO, COL_SRC_CHAN, - COL_PAGE, COL_ID, COL_DATE, COL_CONFIDENCE, - COL_CHAN]), - ('columns.size', [200, 75, 150, - 100, 150, 100, - 75, 75, 100, 100, - 100]) + ('columns.visible', [COL_TITLE_PAGE, COL_ID, COL_DATE, + COL_CONFIDENCE]), + ('columns.rank', [COL_TITLE_PAGE, COL_ID, COL_DATE, COL_CONFIDENCE, + COL_CHAN, COL_SRC_TITLE, COL_SRC_ID, COL_SRC_AUTH, + COL_SRC_ABBR, COL_SRC_PINFO, COL_SRC_CHAN]), + ('columns.size', [200, 75, 100, 100, 100, 200, 75, 75, 100, 150, 100]) ) ADD_MSG = _("Add a new citation") EDIT_MSG = _("Edit the selected citation")