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
14 #include "ButtonControllerBase.h"
15 #include "ControlChanges.h"
16 #include "frontends/Dialogs.h"
17 #include "frontends/LyXView.h"
22 #include "BufferView.h"
23 #include "support/lstrings.h"
24 #include "funcrequest.h"
27 ControlChanges::ControlChanges(LyXView & lv, Dialogs & d)
28 : ControlDialogBD(lv, d)
33 void ControlChanges::find()
35 lyxfind::findNextChange(bufferview());
39 string const ControlChanges::getChangeDate()
41 Change c(bufferview()->getCurrentChange());
42 if (c.type == Change::UNCHANGED || !c.changetime)
44 return ctime(&c.changetime);
48 string const ControlChanges::getChangeAuthor()
50 Change c(bufferview()->getCurrentChange());
51 if (c.type == Change::UNCHANGED)
54 Author const & a(bufferview()->buffer()->authors().get(c.author));
56 string author(a.name());
58 if (!a.email().empty()) {
60 author += a.email() + ")";
67 void ControlChanges::accept()
69 lv_.dispatch(FuncRequest(LFUN_ACCEPT_CHANGE));
70 lyxfind::findNextChange(bufferview());
74 void ControlChanges::reject()
76 lv_.dispatch(FuncRequest(LFUN_REJECT_CHANGE));
77 lyxfind::findNextChange(bufferview());