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"
17 #include "bufferparams.h"
18 #include "BufferView.h"
20 #include "funcrequest.h"
22 #include "support/lstrings.h"
33 ControlChanges::ControlChanges(Dialog & parent)
34 : Dialog::Controller(parent)
38 bool ControlChanges::find()
40 return find::findNextChange(kernel().bufferview());
44 string const ControlChanges::getChangeDate()
46 Change c(kernel().bufferview()->getCurrentChange());
47 if (c.type == Change::UNCHANGED || !c.changetime)
50 // ctime adds newline; trim it off!
51 string const date = rtrim(ctime(&c.changetime), "\n");
56 string const ControlChanges::getChangeAuthor()
58 Change c(kernel().bufferview()->getCurrentChange());
59 if (c.type == Change::UNCHANGED)
62 Author const & a(kernel().buffer().params().authors().get(c.author));
64 string author(a.name());
66 if (!a.email().empty()) {
68 author += a.email() + ")";
75 void ControlChanges::accept()
77 kernel().dispatch(FuncRequest(LFUN_ACCEPT_CHANGE));
78 find::findNextChange(kernel().bufferview());
82 void ControlChanges::reject()
84 kernel().dispatch(FuncRequest(LFUN_REJECT_CHANGE));
85 find::findNextChange(kernel().bufferview());
88 } // namespace frontend