4 #include "dlg_conectar.h"
6 MiMenuBar::MiMenuBar(BaseObjectType *co, const Glib::RefPtr<Gnome::Glade::Xml> &rg):Gtk::MenuBar(co),refXml(rg)
8 Gtk::MenuItem *conect=0, *exit=0, *about=0;
9 rg->get_widget("mnu_file_connect", conect);
10 rg->get_widget("mnu_file_exit", exit);
11 rg->get_widget("mnu_help_about", about);
12 conect->signal_activate().connect( SigC::slot(*this, &MiMenuBar::on_mnu_file_connect));
13 exit->signal_activate().connect( SigC::slot(*this, &MiMenuBar::on_mnu_file_exit));
14 about->signal_activate().connect( SigC::slot(*this, &MiMenuBar::on_mnu_help_about));
17 MiMenuBar::~MiMenuBar()
21 void MiMenuBar::on_mnu_file_exit()
26 void MiMenuBar::on_mnu_file_connect()
28 // preparo para leer el archivo ChangeLog
29 Glib::RefPtr<Gnome::Glade::Xml> xml;
32 xml = Gnome::Glade::Xml::create("client.glade", "dlgConectar");
34 catch(const Gnome::Glade::XmlError &ex) {
35 std::cerr << ex.what() << std::endl;
39 xml->get_widget_derived("dlgConectar", dlg);
43 void MiMenuBar::on_mnu_help_about()
45 // preparo para leer el archivo ChangeLog
46 Glib::RefPtr<Gnome::Glade::Xml> xml;
48 Glib::RefPtr<Gtk::TextBuffer> log_buffer;
49 Glib::RefPtr<Glib::IOChannel> log_io;
51 log_buffer = Gtk::TextBuffer::create();
52 log_io = Glib::IOChannel::create_from_file("../ChangeLog", "r");
53 while (log_io->read_line(line) != Glib::IO_STATUS_EOF) {
54 log_buffer->insert_at_cursor(line);
58 xml = Gnome::Glade::Xml::create("client.glade", "dlgAbout");
60 catch(const Gnome::Glade::XmlError &ex) {
61 std::cerr << ex.what() << std::endl;
65 Gtk::Button *btn_cerrar = 0;
66 Gtk::TextView *txt_changelog = 0;
67 xml->get_widget("dlgAbout", dlg);
68 xml->get_widget("btn_close", btn_cerrar);
69 xml->get_widget("txt_changelog", txt_changelog);
70 btn_cerrar->signal_clicked().connect(SigC::slot(*dlg, &Gtk::Dialog::hide));
71 txt_changelog->set_buffer(log_buffer);