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