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