3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
12 #include "ControlChanges.h"
22 GChanges::GChanges(Dialog & parent)
23 : GViewCB<ControlChanges, GViewGladeB>(parent, _("Merge Changes"), false)
27 void GChanges::doBuild()
29 string const gladeName = findGladeFile("changes");
30 xml_ = Gnome::Glade::Xml::create(gladeName);
32 xml_->get_widget("Message", messagelabel_);
34 Gtk::Button * closebutton;
35 xml_->get_widget("Close", closebutton);
36 setCancel(closebutton);
38 xml_->get_widget("Accept", acceptbutton_);
39 bcview().addReadOnly(acceptbutton_);
40 acceptbutton_->signal_clicked().connect(
41 sigc::mem_fun(*this, &GChanges::onAccept));
43 xml_->get_widget("Reject", rejectbutton_);
44 bcview().addReadOnly(rejectbutton_);
45 rejectbutton_->signal_clicked().connect(
46 sigc::mem_fun(*this, &GChanges::onReject));
48 xml_->get_widget("Next", nextbutton_);
49 nextbutton_->signal_clicked().connect(
50 sigc::mem_fun(*this, &GChanges::onNext));
54 void GChanges::update()
60 void GChanges::onAccept()
62 if (controller().accept()) {
70 void GChanges::onReject()
72 if (controller().reject()) {
80 void GChanges::onNext()
82 if (controller().find()) {
90 void GChanges::promptChange()
92 string const header = _("Accept highlighted change?");
93 string author = controller().getChangeAuthor();
94 string date = controller().getChangeDate();
96 author = _("unknown author");
98 date = _("unknown date");
100 messagelabel_->set_markup("<big><b>" + header +
101 "</b></big>\n\nChanged by <b>" + author
102 + "</b> on <b>" + date + "</b>");
104 acceptbutton_->set_sensitive(true && !readOnly());
105 rejectbutton_->set_sensitive(true && !readOnly());
106 nextbutton_->set_sensitive(true);
110 void GChanges::promptDismiss()
112 string const header = _("Done merging changes");
114 messagelabel_->set_markup("<big><b>" + header +
117 // Disable all buttons but close.
118 acceptbutton_->set_sensitive(false);
119 rejectbutton_->set_sensitive(false);
120 nextbutton_->set_sensitive(false);
124 } // namespace frontend