*
* \author John Levon
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*/
#include <config.h>
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
#include "ControlChanges.h"
-#include "frontends/Dialogs.h"
-#include "frontends/LyXView.h"
+
+#include "author.h"
#include "buffer.h"
-#include "lyxfind.h"
-#include "lyxfunc.h"
-#include "debug.h"
+#include "bufferparams.h"
#include "BufferView.h"
-#include "support/lstrings.h"
+#include "changes.h"
#include "funcrequest.h"
-#include "author.h"
+#include "lyxfind.h"
+#include "support/lyxtime.h"
-ControlChanges::ControlChanges(LyXView & lv, Dialogs & d)
- : ControlDialogBD(lv, d)
-{
-}
+using std::string;
+namespace lyx {
-void ControlChanges::find()
+namespace frontend {
+
+
+ControlChanges::ControlChanges(Dialog & parent)
+ : Dialog::Controller(parent)
+{}
+
+
+bool ControlChanges::find()
{
- lyxfind::findNextChange(bufferview());
+ return find::findNextChange(kernel().bufferview());
}
string const ControlChanges::getChangeDate()
{
- Change c(bufferview()->getCurrentChange());
+ Change c(kernel().bufferview()->getCurrentChange());
if (c.type == Change::UNCHANGED || !c.changetime)
return string();
- return ctime(&c.changetime);
+
+ return formatted_time(c.changetime);
}
string const ControlChanges::getChangeAuthor()
{
- Change c(bufferview()->getCurrentChange());
+ Change c(kernel().bufferview()->getCurrentChange());
if (c.type == Change::UNCHANGED)
return string();
- Author const & a(bufferview()->buffer()->authors().get(c.author));
+ Author const & a(kernel().buffer().params().authors().get(c.author));
string author(a.name());
}
-void ControlChanges::accept()
+bool ControlChanges::accept()
{
- lv_.dispatch(FuncRequest(LFUN_ACCEPT_CHANGE));
- lyxfind::findNextChange(bufferview());
+ kernel().dispatch(FuncRequest(LFUN_ACCEPT_CHANGE));
+ return find::findNextChange(kernel().bufferview());
}
-void ControlChanges::reject()
+bool ControlChanges::reject()
{
- lv_.dispatch(FuncRequest(LFUN_REJECT_CHANGE));
- lyxfind::findNextChange(bufferview());
+ kernel().dispatch(FuncRequest(LFUN_REJECT_CHANGE));
+ return find::findNextChange(kernel().bufferview());
}
+
+
+} // namespace frontend
+} // namespace lyx