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"
14 #include "frontends/Dialogs.h"
15 #include "frontends/LyXView.h"
17 #include "BufferView.h"
18 #include "funcrequest.h"
21 #include "support/lstrings.h"
24 ControlChanges::ControlChanges(Dialog & parent)
25 : Dialog::Controller(parent)
29 void ControlChanges::find()
31 lyxfind::findNextChange(kernel().bufferview());
35 string const ControlChanges::getChangeDate()
37 Change c(kernel().bufferview()->getCurrentChange());
38 if (c.type == Change::UNCHANGED || !c.changetime)
40 return ctime(&c.changetime);
44 string const ControlChanges::getChangeAuthor()
46 Change c(kernel().bufferview()->getCurrentChange());
47 if (c.type == Change::UNCHANGED)
50 Author const & a(kernel().buffer()->authors().get(c.author));
52 string author(a.name());
54 if (!a.email().empty()) {
56 author += a.email() + ")";
63 void ControlChanges::accept()
65 kernel().dispatch(FuncRequest(LFUN_ACCEPT_CHANGE));
66 lyxfind::findNextChange(kernel().bufferview());
70 void ControlChanges::reject()
72 kernel().dispatch(FuncRequest(LFUN_REJECT_CHANGE));
73 lyxfind::findNextChange(kernel().bufferview());