7 Principal::Principal(BaseObjectType *co, const Glib::RefPtr<Gnome::Glade::Xml> &rg):Gtk::Window(co),refXml(rg)
9 Gtk::MenuItem *conect=0, *exit=0, *about=0;
10 rg->get_widget("mnu_file_connect", conect);
11 rg->get_widget("mnu_file_exit", exit);
12 rg->get_widget("mnu_help_about", about);
13 rg->get_widget_derived("dlgConectar", dlg_conectar);
15 dlg_conectar->get_ok_button()->signal_clicked().connect( SigC::slot(*this, &Principal::on_dlg_connect_ok) );
16 conect->signal_activate().connect( SigC::slot(*this, &Principal::on_mnu_file_connect));
17 exit->signal_activate().connect( SigC::slot(*this, &Principal::on_mnu_file_exit));
18 about->signal_activate().connect( SigC::slot(*this, &Principal::on_mnu_help_about));
21 Principal::~Principal()
25 void Principal::on_dlg_connect_ok()
27 std::cout << "Conectando ..." << std::endl;
28 std::cout << dlg_conectar->get_server_name() << ":" << dlg_conectar->get_server_port() << std::endl;
32 void Principal::on_mnu_file_exit()
37 void Principal::on_mnu_file_connect()
42 void Principal::on_mnu_help_about()
44 // preparo para leer el archivo ChangeLog
45 /* Glib::RefPtr<Gnome::Glade::Xml> xml;
47 Glib::RefPtr<Gtk::TextBuffer> log_buffer;
48 Glib::RefPtr<Glib::IOChannel> log_io;
50 log_buffer = Gtk::TextBuffer::create();
51 log_io = Glib::IOChannel::create_from_file("../ChangeLog", "r");
52 while (log_io->read_line(line) != Glib::IO_STATUS_EOF) {
53 log_buffer->insert_at_cursor(line);
57 xml = Gnome::Glade::Xml::create("client.glade", "dlgAbout");
59 catch(const Gnome::Glade::XmlError &ex) {
60 std::cerr << ex.what() << std::endl;
64 Gtk::Button *btn_cerrar = 0;
65 Gtk::TextView *txt_changelog = 0;
66 xml->get_widget("dlgAbout", dlg);
67 xml->get_widget("btn_close", btn_cerrar);
68 xml->get_widget("txt_changelog", txt_changelog);
69 btn_cerrar->signal_clicked().connect(SigC::slot(*dlg, &Gtk::Dialog::hide));
70 txt_changelog->set_buffer(log_buffer);