2 * \file ControlChanges.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS
13 #include "ControlChanges.h"
15 #include "BufferView.h"
16 #include "funcrequest.h"
19 #include "support/lstrings.h"
22 ControlChanges::ControlChanges(Dialog & parent)
23 : Dialog::Controller(parent)
27 bool ControlChanges::find()
29 return lyxfind::findNextChange(kernel().bufferview());
33 string const ControlChanges::getChangeDate()
35 Change c(kernel().bufferview()->getCurrentChange());
36 if (c.type == Change::UNCHANGED || !c.changetime)
39 // ctime adds newline; trim it off!
40 string const date = rtrim(ctime(&c.changetime), "\n");
45 string const ControlChanges::getChangeAuthor()
47 Change c(kernel().bufferview()->getCurrentChange());
48 if (c.type == Change::UNCHANGED)
51 Author const & a(kernel().buffer()->authors().get(c.author));
53 string author(a.name());
55 if (!a.email().empty()) {
57 author += a.email() + ")";
64 void ControlChanges::accept()
66 kernel().dispatch(FuncRequest(LFUN_ACCEPT_CHANGE));
67 lyxfind::findNextChange(kernel().bufferview());
71 void ControlChanges::reject()
73 kernel().dispatch(FuncRequest(LFUN_REJECT_CHANGE));
74 lyxfind::findNextChange(kernel().bufferview());