2 * \file ControlChanges.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
14 #include "ControlChanges.h"
18 #include "bufferparams.h"
19 #include "BufferView.h"
21 #include "funcrequest.h"
24 #include "support/lyxtime.h"
32 ControlChanges::ControlChanges(Dialog & parent)
33 : Dialog::Controller(parent)
37 void ControlChanges::next()
39 kernel().dispatch(FuncRequest(LFUN_CHANGE_NEXT));
43 docstring const ControlChanges::getChangeDate()
45 Change const & c = kernel().bufferview()->getCurrentChange();
46 if (c.type == Change::UNCHANGED)
50 return from_utf8(formatted_time(c.changetime));
54 docstring const ControlChanges::getChangeAuthor()
56 Change const & c = kernel().bufferview()->getCurrentChange();
57 if (c.type == Change::UNCHANGED)
60 Author const & a = kernel().buffer().params().authors().get(c.author);
62 docstring author(a.name());
64 if (!a.email().empty()) {
65 author += " (" + a.email() + ")";
72 void ControlChanges::accept()
74 kernel().dispatch(FuncRequest(LFUN_CHANGE_ACCEPT));
79 void ControlChanges::reject()
81 kernel().dispatch(FuncRequest(LFUN_CHANGE_REJECT));
86 } // namespace frontend