On Mon, 2006-02-13 at 23:16 +0100, Jean-Marc Lasgouttes wrote: > >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes: > > Martin> Attached, please verify. - Martin > > Is that a qt-only bug?
No. Attached what is needed to fix it for xforms also. (Same wrong logic there as in qt2. Ouch.) BTW xforms is unusably slow over my ADSL. - Martin
Index: xforms/FormChanges.C =================================================================== --- xforms/FormChanges.C (revision 13229) +++ xforms/FormChanges.C (working copy) @@ -48,7 +48,17 @@ void FormChanges::update() { - input(dialog_->button_next, 0); + if (!dialog_.get()) return; + bool exist = controller().changed(); + setEnabled(dialog_->button_accept, exist); + setEnabled(dialog_->button_reject, exist); + setEnabled(dialog_->button_next, exist); + + string const author = exist ? controller().getChangeAuthor() : ""; + fl_set_object_label(dialog_->text_author, author.c_str()); + + string const date = exist ? controller().getChangeDate() : ""; + fl_set_object_label(dialog_->text_date, date.c_str()); } @@ -56,23 +66,16 @@ { if (obj == dialog_->button_accept) { controller().accept(); + update(); } else if (obj == dialog_->button_reject) { controller().reject(); + update(); } else if (obj == dialog_->button_next) { + controller().find(); + update(); - bool const exist = controller().find(); - setEnabled(dialog_->button_accept, exist); - setEnabled(dialog_->button_reject, exist); - setEnabled(dialog_->button_next, exist); - - string const author = exist ? controller().getChangeAuthor() : ""; - fl_set_object_label(dialog_->text_author, author.c_str()); - - string const date = exist ? controller().getChangeDate() : ""; - fl_set_object_label(dialog_->text_date, date.c_str()); - // Yes, this is needed. fl_redraw_form(form()); } Index: controllers/ControlChanges.C =================================================================== --- controllers/ControlChanges.C (revision 13229) +++ controllers/ControlChanges.C (working copy) @@ -39,6 +39,13 @@ } +bool ControlChanges::changed() +{ + Change c(kernel().bufferview()->getCurrentChange()); + return c.type != Change::UNCHANGED; +} + + string const ControlChanges::getChangeDate() { Change c(kernel().bufferview()->getCurrentChange()); Index: controllers/ControlChanges.h =================================================================== --- controllers/ControlChanges.h (revision 13229) +++ controllers/ControlChanges.h (working copy) @@ -38,6 +38,9 @@ /// find the next merge chunk and highlight it bool find(); + /// Has current location been changed? + bool changed(); + /// return date of change std::string const getChangeDate();
signature.asc
Description: This is a digitally signed message part