Jean-Marc,
attached please find a simple patch that improves CT in LyX 1.4.
Essentially, the patch consists of three parts:
1. The change bar is smarter (reduced width, more margin)
The code changes are trivial and please your eyes :-)
2. "next change" is introduced
This feature makes it easier to find changes in the document.
A must-have feature for CT! The code changes are rather
straight-forward and make use of functionality that is
already available in LyX.
3. accept/reject change is de-activated in non-CT mode
A cosmetic thing; please have a look at the patch before
committing this part.
I would be happy if you considered this patch for 1.4.3. I am pretty
sure that it does not have any negative side-effects. But, of course,
you take the final decision.
Please commit the patch if you are happy with it. I may not be able to
do so next week.
Regards,
Michael
Index: src/LyXAction.C
===================================================================
--- src/LyXAction.C (Revision 15023)
+++ src/LyXAction.C (Arbeitskopie)
@@ -311,6 +311,7 @@
{ LFUN_TRACK_CHANGES, "track-changes", Noop },
{ LFUN_OUTPUT_CHANGES, "output-changes", Noop },
{ LFUN_MERGE_CHANGES, "merge-changes", Noop },
+ { LFUN_CHANGE_NEXT, "change-next", ReadOnly },
{ LFUN_ACCEPT_CHANGE, "accept-change", Noop },
{ LFUN_REJECT_CHANGE, "reject-change", Noop },
{ LFUN_ACCEPT_ALL_CHANGES, "accept-all-changes", Noop },
Index: src/BufferView_pimpl.C
===================================================================
--- src/BufferView_pimpl.C (Revision 15023)
+++ src/BufferView_pimpl.C (Arbeitskopie)
@@ -1081,8 +1081,7 @@
}
case LFUN_MERGE_CHANGES:
- case LFUN_ACCEPT_CHANGE: // what about these two
- case LFUN_REJECT_CHANGE: // what about these two
+ case LFUN_CHANGE_NEXT:
case LFUN_ACCEPT_ALL_CHANGES:
case LFUN_REJECT_ALL_CHANGES:
flag.enabled(buffer_ && buffer_->params().tracking_changes);
@@ -1230,6 +1229,10 @@
owner_->getDialogs().show("changes");
break;
+ case LFUN_CHANGE_NEXT:
+ lyx::find::findNextChange(bv_);
+ break;
+
case LFUN_ACCEPT_ALL_CHANGES: {
cursor_.reset(buffer_->inset());
#ifdef WITH_WARNINGS
Index: src/ChangeLog
===================================================================
--- src/ChangeLog (Revision 15023)
+++ src/ChangeLog (Arbeitskopie)
@@ -1,3 +1,15 @@
+2006-09-16 Michael Gerz <[EMAIL PROTECTED]>
+
+ * src/rowpainter.h: improve change bar margin
+ * src/rowpainter.C: improve change bar size
+
+ * src/lfuns.h:
+ * src/BufferView_pimpl.C:
+ * src/LyXAction.C: introduce LFUN_CHANGE_NEXT
+
+ * BufferView_pimpl.C:
+ * text3.C: activate LFUN_ACCEPT/REJECT_CHANGE only in CT mode
+
2006-09-15 Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
* text.C (setCursorFromCoordinates):
Index: src/text3.C
===================================================================
--- src/text3.C (Revision 15023)
+++ src/text3.C (Arbeitskopie)
@@ -1760,8 +1760,6 @@
case LFUN_HUNG_UMLAUT:
case LFUN_CIRCLE:
case LFUN_OGONEK:
- case LFUN_ACCEPT_CHANGE:
- case LFUN_REJECT_CHANGE:
case LFUN_THESAURUS_ENTRY:
case LFUN_PARAGRAPH_APPLY:
case LFUN_ESCAPE:
@@ -1772,7 +1770,10 @@
// these are handled in our dispatch()
enable = true;
break;
-
+ case LFUN_ACCEPT_CHANGE:
+ case LFUN_REJECT_CHANGE:
+ enable = cur.buffer().params().tracking_changes;
+ break;
default:
return false;
}
Index: src/rowpainter.C
===================================================================
--- src/rowpainter.C (Revision 15023)
+++ src/rowpainter.C (Arbeitskopie)
@@ -363,7 +363,7 @@
? row_.ascent()
: row_.height();
- pain_.fillRectangle(4, yo_ - row_.ascent(), 5, height, LColor::changebar);
+ pain_.fillRectangle(5, yo_ - row_.ascent(), 3, height, LColor::changebar);
}
Index: src/lfuns.h
===================================================================
--- src/lfuns.h (Revision 15023)
+++ src/lfuns.h (Arbeitskopie)
@@ -360,6 +360,7 @@
LFUN_TOGGLE_COMPRESSION, // bpeng 20060427
// 275
LFUN_INSET_DISSOLVE, // jspitzm 20060807
+ LFUN_CHANGE_NEXT,
LFUN_LASTACTION // end of the table
};
Index: src/rowpainter.h
===================================================================
--- src/rowpainter.h (Revision 15023)
+++ src/rowpainter.h (Arbeitskopie)
@@ -32,7 +32,7 @@
inline int nestMargin() { return 15; }
/// margin for changebar
-inline int changebarMargin() { return 10; }
+inline int changebarMargin() { return 12; }
/// right margin
inline int rightMargin() { return 10; }
Index: lib/ChangeLog
===================================================================
--- lib/ChangeLog (Revision 15023)
+++ lib/ChangeLog (Arbeitskopie)
@@ -1,5 +1,9 @@
2006-09-16 Michael Gerz <[EMAIL PROTECTED]>
+ * stdmenus.ui: add "Next change"
+
+2006-09-16 Michael Gerz <[EMAIL PROTECTED]>
+
* stdmenus.ui: add entry for phonetic symbols;
add entries for accepting/rejecting a single change
Index: lib/ui/stdmenus.ui
===================================================================
--- lib/ui/stdmenus.ui (Revision 15023)
+++ lib/ui/stdmenus.ui (Arbeitskopie)
@@ -402,6 +402,7 @@
Menu "navigate"
Submenu "Bookmarks|B" "navigate_bookmarks"
Item "Next Note|N" "note-next"
+ Item "Next Change|C" "change-next"
Item "Go to Label|L" "label-goto"
Separator
Toc