]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QChanges.C
some tabular fixes for the problems reported by Helge
[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 "QChanges.h"
14 #include "QChangesDialog.h"
15 #include "Qt2BC.h"
16 #include "qt_helpers.h"
17
18 #include "controllers/ControlChanges.h"
19
20 #include <qpushbutton.h>
21 #include <qtextview.h>
22
23
24 using std::string;
25
26 namespace lyx {
27 namespace frontend {
28
29 typedef QController<ControlChanges, QView<QChangesDialog> > base_class;
30
31
32 QChanges::QChanges(Dialog & parent)
33         : base_class(parent, _("LyX: Merge Changes"))
34 {
35 }
36
37
38 void QChanges::build_dialog()
39 {
40         dialog_.reset(new QChangesDialog(this));
41
42         bcview().setCancel(dialog_->closePB);
43         bcview().addReadOnly(dialog_->acceptPB);
44         bcview().addReadOnly(dialog_->rejectPB);
45 }
46
47
48 void QChanges::next()
49 {
50         controller().find();
51
52         string text;
53         string author(controller().getChangeAuthor());
54         string date(controller().getChangeDate());
55
56         if (!author.empty())
57                 text += "Change by " + author + "\n\n";
58         if (!date.empty())
59                 text += "Change made at " + date + "\n";
60
61         dialog_->changeTV->setText(toqstr(text));
62 }
63
64
65 void QChanges::accept()
66 {
67         controller().accept();
68 }
69
70
71 void QChanges::reject()
72 {
73         controller().reject();
74 }
75
76 } // namespace frontend
77 } // namespace lyx