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"
25 #include "support/lyxtime.h"
33 ControlChanges::ControlChanges(Dialog & parent)
34 : Dialog::Controller(parent)
38 void ControlChanges::next()
40 kernel().dispatch(FuncRequest(LFUN_CHANGE_NEXT));
44 docstring const ControlChanges::getChangeDate()
46 Change const & c = kernel().bufferview()->getCurrentChange();
47 if (c.type == Change::UNCHANGED)
51 return from_utf8(formatted_time(c.changetime, lyxrc.date_insert_format));
55 docstring const ControlChanges::getChangeAuthor()
57 Change const & c = kernel().bufferview()->getCurrentChange();
58 if (c.type == Change::UNCHANGED)
61 Author const & a = kernel().buffer().params().authors().get(c.author);
63 docstring author(a.name());
65 if (!a.email().empty()) {
66 author += " (" + a.email() + ")";
73 void ControlChanges::accept()
75 kernel().dispatch(FuncRequest(LFUN_CHANGE_ACCEPT));
80 void ControlChanges::reject()
82 kernel().dispatch(FuncRequest(LFUN_CHANGE_REJECT));
87 } // namespace frontend