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, lyx::to_utf8(_("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()
66 if (controller().changed())
73 void GChanges::onAccept()
75 if (controller().accept()) {
83 void GChanges::onReject()
85 if (controller().reject()) {
93 void GChanges::onNext()
95 if (controller().find()) {
103 void GChanges::promptChange()
105 string const header = lyx::to_utf8(_("Accept highlighted change?"));
106 string author = controller().getChangeAuthor();
107 string date = controller().getChangeDate();
109 author = lyx::to_utf8(_("unknown author"));
111 date = lyx::to_utf8(_("unknown date"));
113 messagelabel_->set_markup("<big><b>" + header +
114 "</b></big>\n\nChanged by <b>" + author
115 + "</b> on <b>" + date + "</b>");
117 acceptbutton_->set_sensitive(true && !readOnly());
118 rejectbutton_->set_sensitive(true && !readOnly());
119 nextbutton_->set_sensitive(true);
123 void GChanges::promptDismiss()
125 string const header = lyx::to_utf8(_("Done merging changes"));
127 messagelabel_->set_markup("<big><b>" + header +
130 // Disable all buttons but close.
131 acceptbutton_->set_sensitive(false);
132 rejectbutton_->set_sensitive(false);
133 nextbutton_->set_sensitive(false);
137 } // namespace frontend