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"
33 ControlChanges::ControlChanges(Dialog & parent)
34 : Dialog::Controller(parent)
38 bool ControlChanges::find()
40 return find::findNextChange(kernel().bufferview());
44 bool ControlChanges::changed()
46 Change c(kernel().bufferview()->getCurrentChange());
47 return c.type != Change::UNCHANGED;
51 docstring const ControlChanges::getChangeDate()
53 Change c(kernel().bufferview()->getCurrentChange());
54 if (c.type == Change::UNCHANGED || !c.changetime)
58 return lyx::from_utf8(formatted_time(c.changetime));
62 docstring const ControlChanges::getChangeAuthor()
64 Change c(kernel().bufferview()->getCurrentChange());
65 if (c.type == Change::UNCHANGED)
68 Author const & a(kernel().buffer().params().authors().get(c.author));
70 // FIXME UNICODE in Author class
71 docstring author(lyx::from_utf8(a.name()));
73 if (!a.email().empty()) {
75 author += lyx::from_utf8(a.email());
83 bool ControlChanges::accept()
85 kernel().dispatch(FuncRequest(LFUN_CHANGE_ACCEPT));
86 return find::findNextChange(kernel().bufferview());
90 bool ControlChanges::reject()
92 kernel().dispatch(FuncRequest(LFUN_CHANGE_REJECT));
93 return find::findNextChange(kernel().bufferview());
97 } // namespace frontend