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/lyxtime.h"
31 ControlChanges::ControlChanges(Dialog & parent)
32 : Dialog::Controller(parent)
36 bool ControlChanges::find()
38 return findNextChange(kernel().bufferview());
42 bool ControlChanges::changed()
44 Change c(kernel().bufferview()->getCurrentChange());
45 return c.type != Change::UNCHANGED;
49 docstring const ControlChanges::getChangeDate()
51 Change c(kernel().bufferview()->getCurrentChange());
52 if (c.type == Change::UNCHANGED || !c.changetime)
56 return from_utf8(formatted_time(c.changetime));
60 docstring const ControlChanges::getChangeAuthor()
62 Change c(kernel().bufferview()->getCurrentChange());
63 if (c.type == Change::UNCHANGED)
66 Author const & a(kernel().buffer().params().authors().get(c.author));
68 // FIXME UNICODE in Author class
69 docstring author(from_utf8(a.name()));
71 if (!a.email().empty()) {
73 author += from_utf8(a.email());
81 bool ControlChanges::accept()
83 kernel().dispatch(FuncRequest(LFUN_CHANGE_ACCEPT));
84 return findNextChange(kernel().bufferview());
88 bool ControlChanges::reject()
90 kernel().dispatch(FuncRequest(LFUN_CHANGE_REJECT));
91 return findNextChange(kernel().bufferview());
95 } // namespace frontend