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.
11 // Too hard to make concept checks work with this file
12 #ifdef _GLIBCXX_CONCEPT_CHECKS
13 #undef _GLIBCXX_CONCEPT_CHECKS
17 #include "ControlChanges.h"
27 GChanges::GChanges(Dialog & parent)
28 : GViewCB<ControlChanges, GViewGladeB>(parent, _("Merge Changes"), false)
32 void GChanges::doBuild()
34 string const gladeName = findGladeFile("changes");
35 xml_ = Gnome::Glade::Xml::create(gladeName);
37 xml_->get_widget("Message", messagelabel_);
39 Gtk::Button * closebutton;
40 xml_->get_widget("Close", closebutton);
41 setCancel(closebutton);
43 xml_->get_widget("Accept", acceptbutton_);
44 bcview().addReadOnly(acceptbutton_);
45 acceptbutton_->signal_clicked().connect(
46 sigc::mem_fun(*this, &GChanges::onAccept));
48 xml_->get_widget("Reject", rejectbutton_);
49 bcview().addReadOnly(rejectbutton_);
50 rejectbutton_->signal_clicked().connect(
51 sigc::mem_fun(*this, &GChanges::onReject));
53 xml_->get_widget("Next", nextbutton_);
54 nextbutton_->signal_clicked().connect(
55 sigc::mem_fun(*this, &GChanges::onNext));
59 void GChanges::update()
65 void GChanges::onAccept()
67 if (controller().accept()) {
75 void GChanges::onReject()
77 if (controller().reject()) {
85 void GChanges::onNext()
87 if (controller().find()) {
95 void GChanges::promptChange()
97 string const header = _("Accept highlighted change?");
98 string author = controller().getChangeAuthor();
99 string date = controller().getChangeDate();
101 author = _("unknown author");
103 date = _("unknown date");
105 messagelabel_->set_markup("<big><b>" + header +
106 "</b></big>\n\nChanged by <b>" + author
107 + "</b> on <b>" + date + "</b>");
109 acceptbutton_->set_sensitive(true && !readOnly());
110 rejectbutton_->set_sensitive(true && !readOnly());
111 nextbutton_->set_sensitive(true);
115 void GChanges::promptDismiss()
117 string const header = _("Done merging changes");
119 messagelabel_->set_markup("<big><b>" + header +
122 // Disable all buttons but close.
123 acceptbutton_->set_sensitive(false);
124 rejectbutton_->set_sensitive(false);
125 nextbutton_->set_sensitive(false);
129 } // namespace frontend