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.
13 // Too hard to make concept checks work with this file
14 #ifdef _GLIBCXX_CONCEPT_CHECKS
15 #undef _GLIBCXX_CONCEPT_CHECKS
17 #ifdef _GLIBCPP_CONCEPT_CHECKS
18 #undef _GLIBCPP_CONCEPT_CHECKS
22 #include "ControlChanges.h"
32 GChanges::GChanges(Dialog & parent)
33 : GViewCB<ControlChanges, GViewGladeB>(parent, _("Merge Changes"), false)
37 void GChanges::doBuild()
39 string const gladeName = findGladeFile("changes");
40 xml_ = Gnome::Glade::Xml::create(gladeName);
42 xml_->get_widget("Message", messagelabel_);
44 Gtk::Button * closebutton;
45 xml_->get_widget("Close", closebutton);
46 setCancel(closebutton);
48 xml_->get_widget("Accept", acceptbutton_);
49 bcview().addReadOnly(acceptbutton_);
50 acceptbutton_->signal_clicked().connect(
51 sigc::mem_fun(*this, &GChanges::onAccept));
53 xml_->get_widget("Reject", rejectbutton_);
54 bcview().addReadOnly(rejectbutton_);
55 rejectbutton_->signal_clicked().connect(
56 sigc::mem_fun(*this, &GChanges::onReject));
58 xml_->get_widget("Next", nextbutton_);
59 nextbutton_->signal_clicked().connect(
60 sigc::mem_fun(*this, &GChanges::onNext));
64 void GChanges::update()
70 void GChanges::onAccept()
72 if (controller().accept()) {
80 void GChanges::onReject()
82 if (controller().reject()) {
90 void GChanges::onNext()
92 if (controller().find()) {
100 void GChanges::promptChange()
102 string const header = _("Accept highlighted change?");
103 string author = controller().getChangeAuthor();
104 string date = controller().getChangeDate();
106 author = _("unknown author");
108 date = _("unknown date");
110 messagelabel_->set_markup("<big><b>" + header +
111 "</b></big>\n\nChanged by <b>" + author
112 + "</b> on <b>" + date + "</b>");
114 acceptbutton_->set_sensitive(true && !readOnly());
115 rejectbutton_->set_sensitive(true && !readOnly());
116 nextbutton_->set_sensitive(true);
120 void GChanges::promptDismiss()
122 string const header = _("Done merging changes");
124 messagelabel_->set_markup("<big><b>" + header +
127 // Disable all buttons but close.
128 acceptbutton_->set_sensitive(false);
129 rejectbutton_->set_sensitive(false);
130 nextbutton_->set_sensitive(false);
134 } // namespace frontend