3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Michael Koziarski
8 * Full author contact details are available in file CREDITS.
16 #include <gtkmm/button.h>
17 #include <gtkmm/textview.h>
21 : GnomeCB<ControlChanges>("GChanges")
29 void GChanges::build()
31 // Connect the buttons.
32 cancel_btn()->signal_clicked().connect(SigC::slot(*this, &GChanges::CancelClicked));
33 accept_btn()->signal_clicked().connect(SigC::slot(*this, &GChanges::accept));
34 reject_btn()->signal_clicked().connect(SigC::slot(*this, &GChanges::reject));
36 bc().setCancel(cancel_btn());
38 // Manage the read-only aware widgets.
39 bc().addReadOnly(accept_btn());
40 bc().addReadOnly(cancel_btn());
41 bc().addReadOnly(reject_btn());
43 // Make sure everything is in the correct state.
48 void GChanges::connect_signals()
52 void GChanges::disconnect_signals()
55 void GChanges::accept()
57 controller().accept();
60 void GChanges::reject()
62 controller().reject();
65 void GChanges::apply()
69 void GChanges::update()
76 string author(controller().getChangeAuthor());
77 string date(controller().getChangeDate());
80 text += "Change by " + author + "\n\n";
82 text += "Change made at " + date + "\n";
84 changes()->get_buffer()->set_text(Glib::locale_to_utf8(text));
90 bool GChanges::validate() const
94 Gtk::Button * GChanges::next_btn() const
96 return getWidget<Gtk::Button>("r_next_btn");
98 Gtk::Button * GChanges::cancel_btn() const
100 return getWidget<Gtk::Button>("r_cancel_btn");
102 Gtk::TextView * GChanges::changes() const
104 return getWidget<Gtk::TextView>("r_changes");
106 Gtk::Button * GChanges::accept_btn() const
108 return getWidget<Gtk::Button>("r_accept_btn");
110 Gtk::Button * GChanges::reject_btn() const
112 return getWidget<Gtk::Button>("r_reject_btn");