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 #pragma implementation
18 #include "ButtonControllerBase.h"
19 #include "ControlChanges.h"
20 #include "frontends/Dialogs.h"
21 #include "frontends/LyXView.h"
26 #include "BufferView.h"
27 #include "support/lstrings.h"
28 #include "funcrequest.h"
31 ControlChanges::ControlChanges(LyXView & lv, Dialogs & d)
32 : ControlDialogBD(lv, d)
37 void ControlChanges::find()
39 lyxfind::findNextChange(bufferview());
43 string const ControlChanges::getChangeDate()
45 Change c(bufferview()->getCurrentChange());
46 if (c.type == Change::UNCHANGED || !c.changetime)
48 return ctime(&c.changetime);
52 string const ControlChanges::getChangeAuthor()
54 Change c(bufferview()->getCurrentChange());
55 if (c.type == Change::UNCHANGED)
58 Author const & a(bufferview()->buffer()->authors().get(c.author));
60 string author(a.name());
62 if (!a.email().empty()) {
64 author += a.email() + ")";
71 void ControlChanges::accept()
73 lv_.dispatch(FuncRequest(LFUN_ACCEPT_CHANGE));
74 lyxfind::findNextChange(bufferview());
78 void ControlChanges::reject()
80 lv_.dispatch(FuncRequest(LFUN_REJECT_CHANGE));
81 lyxfind::findNextChange(bufferview());