void Gobby::BrowserContextCommands::on_open_response(int response_id,
                                                     InfBrowser* browser,
                                                     InfBrowserIter iter)
{
	FileChooser::Dialog* dialog =
		static_cast<FileChooser::Dialog*>(m_dialog.get());
	if(response_id == Gtk::RESPONSE_ACCEPT)
	{
		Glib::SListHandle<Glib::ustring> uris = dialog->get_uris();

		OperationOpenMultiple::uri_list uri_list(
			uris.begin(), uris.end());

		m_operations.create_documents(
			browser, &iter, m_preferences, uri_list);
	}

	m_watch.reset(NULL);
	m_dialog.reset(NULL);
}
void VistaCrearVideo::on_button_Agregar(){
	/*Abro el dialogo para elegir archivo*/
	Gtk::FileChooserDialog dialog("Elige una o varias imagen/es",
			Gtk::FILE_CHOOSER_ACTION_OPEN);

	dialog.set_select_multiple(true);

	//Add response buttons the the dialog:
	dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
	dialog.add_button("Select", Gtk::RESPONSE_OK);

	int result = dialog.run();

	//Handle the response:
	switch(result){
	case(Gtk::RESPONSE_OK):{
		Glib::SListHandle<Glib::ustring> nombres = dialog.get_filenames();
		Glib::SListHandle<Glib::ustring>::iterator it = nombres.begin();

		for(;it!=nombres.end();++it){
			//std::cerr << "File selected: " << *it << std::endl;
			//Agrego la imagen al listado
			this->agregarImagenALista(*it);
		}
		break;
	}
	case(Gtk::RESPONSE_CANCEL):{
		std::cerr << "Cancel clicked." << std::endl;
		return;
	}
	default:{
		std::cerr << "Exit(?) button clicked." << std::endl;
		return;
	}
	}
	/*Actualizo los frames del reproductor*/
	mutex.bloquear();
	this->actualizarFramesReproductor();
	mutex.desbloquear();
}
Esempio n. 3
0
  void PrintNotesNoteAddin::get_paragraph_attributes(const Glib::RefPtr<Pango::Layout> & layout,
                                                     double dpiX, 
                                                     int & indentation,
                                                     Gtk::TextIter & position, 
                                                     const Gtk::TextIter & limit,
                                                     std::list<Pango::Attribute> & attributes)
  {
    attributes.clear();
    indentation = 0;

    Glib::SListHandle<Glib::RefPtr<Gtk::TextTag> > tags = position.get_tags();
    position.forward_to_tag_toggle(Glib::RefPtr<Gtk::TextTag>(NULL));
    if (position.compare (limit) > 0) {
      position = limit;
    }

    Glib::RefPtr<Gdk::Screen> screen = get_window()->get_screen();
    double screen_dpiX = screen->get_width_mm() * 254 / screen->get_width();

    for(Glib::SListHandle<Glib::RefPtr<Gtk::TextTag> >::const_iterator iter = tags.begin();
        iter != tags.end(); ++iter) {
      
      Glib::RefPtr<Gtk::TextTag> tag(*iter);

      if (tag->property_paragraph_background_set()) {
        Gdk::Color color = tag->property_paragraph_background_gdk();
        attributes.push_back(Pango::Attribute::create_attr_background(
                               color.get_red(), color.get_green(),
                               color.get_blue()));
      }
      if (tag->property_foreground_set()) {
        Gdk::Color color = tag->property_foreground_gdk();;
        attributes.push_back(Pango::Attribute::create_attr_foreground(
                               color.get_red(), color.get_green(), 
                               color.get_blue()));
      }
      if (tag->property_indent_set()) {
        layout->set_indent(tag->property_indent());
      }
      if (tag->property_left_margin_set()) {                                        
        indentation = (int)(tag->property_left_margin() / screen_dpiX * dpiX);
      }
      if (tag->property_right_margin_set()) {
        indentation = (int)(tag->property_right_margin() / screen_dpiX * dpiX);
      }
//      if (tag->property_font_desc()) {
      attributes.push_back(
        Pango::Attribute::create_attr_font_desc (tag->property_font_desc()));
//      }
      if (tag->property_family_set()) {
        attributes.push_back(
          Pango::Attribute::create_attr_family (tag->property_family()));
      }
      if (tag->property_size_set()) {
        attributes.push_back(Pango::Attribute::create_attr_size (
                               tag->property_size()));
      }
      if (tag->property_style_set()) {
        attributes.push_back(Pango::Attribute::create_attr_style (
                               tag->property_style()));
      }
      if (tag->property_underline_set() 
          && tag->property_underline() != Pango::UNDERLINE_ERROR) {
        attributes.push_back(
          Pango::Attribute::create_attr_underline (
            tag->property_underline()));
      }
      if (tag->property_weight_set()) {
        attributes.push_back(
          Pango::Attribute::create_attr_weight(
            Pango::Weight(tag->property_weight().get_value())));
      }
      if (tag->property_strikethrough_set()) {
        attributes.push_back(
          Pango::Attribute::create_attr_strikethrough (
            tag->property_strikethrough()));
      }
      if (tag->property_rise_set()) {
        attributes.push_back(Pango::Attribute::create_attr_rise (
                               tag->property_rise()));
      }
      if (tag->property_scale_set()) {
        attributes.push_back(Pango::Attribute::create_attr_scale (
                               tag->property_scale()));
      }
      if (tag->property_stretch_set()) {
        attributes.push_back(Pango::Attribute::create_attr_stretch (
                               tag->property_stretch()));
      }
    }
  }