]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QChanges.C
Minipage is no more (long live the box inset)
[lyx.git] / src / frontends / qt2 / QChanges.C
1 /**
2  * \file QChanges.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "debug.h"
14 #include "ControlChanges.h"
15 #include "qt_helpers.h"
16
17 #include <qpushbutton.h>
18 #include <qtextview.h>
19
20 #include "QChangesDialog.h"
21 #include "QChanges.h"
22 #include "Qt2BC.h"
23
24
25 using std::string;
26
27
28 typedef QController<ControlChanges, QView<QChangesDialog> > base_class;
29
30
31 QChanges::QChanges(Dialog & parent)
32         : base_class(parent, _("LyX: Merge Changes"))
33 {
34 }
35
36
37 void QChanges::build_dialog()
38 {
39         dialog_.reset(new QChangesDialog(this));
40
41         bcview().setCancel(dialog_->closePB);
42         bcview().addReadOnly(dialog_->acceptPB);
43         bcview().addReadOnly(dialog_->rejectPB);
44 }
45
46
47 void QChanges::next()
48 {
49         controller().find();
50
51         string text;
52         string author(controller().getChangeAuthor());
53         string date(controller().getChangeDate());
54
55         if (!author.empty())
56                 text += "Change by " + author + "\n\n";
57         if (!date.empty())
58                 text += "Change made at " + date + "\n";
59
60         dialog_->changeTV->setText(toqstr(text));
61 }
62
63
64 void QChanges::accept()
65 {
66         controller().accept();
67 }
68
69
70 void QChanges::reject()
71 {
72         controller().reject();
73 }