##// END OF EJS Templates
crecord: move status window text calculation to a separate method...
Jun Wu -
r30544:d4035372 default
parent child Browse files
Show More
@@ -946,6 +946,17 b' class curseschunkselector(object):'
946 946 self.linesprintedtopadsofar += linesprinted
947 947 return t
948 948
949 def _getstatuslines(self):
950 """() -> [str]. return short help used in the top status window"""
951 if self.errorstr is not None:
952 lines = [self.errorstr, _('Press any key to continue')]
953 else:
954 lines = [_("SELECT CHUNKS: (j/k/up/dn/pgup/pgdn) move cursor; "
955 "(space/A) toggle hunk/all; (e)dit hunk;"),
956 _(" (f)old/unfold; (c)onfirm applied; (q)uit; (?) help "
957 "| [X]=hunk applied **=folded, toggle [a]mend mode")]
958 return [util.ellipsis(l, self.xscreensize - 1) for l in lines]
959
949 960 def updatescreen(self):
950 961 self.statuswin.erase()
951 962 self.chunkpad.erase()
@@ -954,25 +965,13 b' class curseschunkselector(object):'
954 965
955 966 # print out the status lines at the top
956 967 try:
957 if self.errorstr is not None:
958 printstring(self.statuswin, self.errorstr, pairname='legend')
959 printstring(self.statuswin, 'Press any key to continue',
960 pairname='legend')
961 self.statuswin.refresh()
962 return
963 line1 = _("SELECT CHUNKS: (j/k/up/dn/pgup/pgdn) move cursor; "
964 "(space/A) toggle hunk/all; (e)dit hunk;")
965 line2 = _(" (f)old/unfold; (c)onfirm applied; (q)uit; (?) help "
966 "| [X]=hunk applied **=folded, toggle [a]mend mode")
967
968 printstring(self.statuswin,
969 util.ellipsis(line1, self.xscreensize - 1),
970 pairname="legend")
971 printstring(self.statuswin,
972 util.ellipsis(line2, self.xscreensize - 1),
973 pairname="legend")
968 for line in self._getstatuslines():
969 printstring(self.statuswin, line, pairname="legend")
970 self.statuswin.refresh()
974 971 except curses.error:
975 972 pass
973 if self.errorstr is not None:
974 return
976 975
977 976 # print out the patch in the remaining part of the window
978 977 try:
@@ -985,9 +984,6 b' class curseschunkselector(object):'
985 984 except curses.error:
986 985 pass
987 986
988 # refresh([pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol])
989 self.statuswin.refresh()
990
991 987 def getstatusprefixstring(self, item):
992 988 """
993 989 create a string to prefix a line with which indicates whether 'item'
General Comments 0
You need to be logged in to leave comments. Login now