Commit 2ec32d1b authored by Murray Cumming's avatar Murray Cumming Committed by Murray Cumming
Browse files

set_value(): When clearing the image, also clear m_pixbuf_original, so

2006-03-14  Murray Cumming  <murrayc@murrayc.com>

        * glom/utility_widgets/imageglom.cc: set_value(): When clearing the image,
        also clear m_pixbuf_original, so that it doesn't come back when the image
        is rescaled. For instance, this makes sure that picture fields are empty when
        adding new records on the detail view.
parent a2de38f4
2006-03-14 Murray Cumming <murrayc@murrayc.com>
* glom/utility_widgets/imageglom.cc: set_value(): When clearing the image,
also clear m_pixbuf_original, so that it doesn't come back when the image
is rescaled. For instance, this makes sure that picture fields are empty when
adding new records on the detail view.
2006-03-14 Murray Cumming <murrayc@murrayc.com>
* glom/document/document_glom.cc: set_userlevel(): Add some debug output.
......
......@@ -235,7 +235,12 @@ void DataWidget::set_value(const Gnome::Gda::Value& value)
Gtk::Widget* widget = get_data_child_widget();
LayoutWidgetField* generic_field_widget = dynamic_cast<LayoutWidgetField*>(widget);
if(generic_field_widget)
{
//if(generic_field_widget->get_layout_item())
// std::cout << "DataWidget::set_value(): generic_field_widget->get_layout_item()->get_name()=" << generic_field_widget->get_layout_item()->get_name() << std::endl;
generic_field_widget->set_value(value);
}
else
{
Gtk::CheckButton* checkbutton = dynamic_cast<Gtk::CheckButton*>(widget);
......
......@@ -129,7 +129,12 @@ void EntryGlom::set_value(const Gnome::Gda::Value& value)
{
sharedptr<const LayoutItem_Field> layout_item = sharedptr<LayoutItem_Field>::cast_dynamic(get_layout_item());
if(layout_item)
set_text(GlomConversions::get_text_for_gda_value(m_glom_type, value, layout_item->get_formatting_used().m_numeric_format));
{
const Glib::ustring text = GlomConversions::get_text_for_gda_value(m_glom_type, value, layout_item->get_formatting_used().m_numeric_format);
set_text(text);
//std::cout << "debug: EntryGlom::set_value(): name=" << layout_item->get_name() << ", text=" << text << std::endl;
}
}
void EntryGlom::set_text(const Glib::ustring& text)
......
......@@ -204,7 +204,53 @@ void ImageGlom::set_value(const Gnome::Gda::Value& value)
if(!pixbuf_set)
{
m_image.set(Gtk::Stock::MISSING_IMAGE, Gtk::ICON_SIZE_DIALOG);
/*
std::cout << "Debug: Setting MISSING_IMAGE" << std::endl;
//Check that this stock icon size is really available,
//though it would be a distro error if it is not.
Glib::RefPtr<Gtk::Style> style = get_style();
if(style)
{
std::cout << "Debug: Setting MISSING_IMAGE 3" << std::endl;
const Gtk::IconSet iconset = style->lookup_icon_set(Gtk::Stock::MISSING_IMAGE);
std::cout << "Debug: Setting MISSING_IMAGE 4" << std::endl;
typedef std::vector<Gtk::IconSize> type_vecSizes;
type_vecSizes sizes = iconset.get_sizes();
type_vecSizes::iterator iterFind = std::find(sizes.begin(), sizes.end(), Gtk::ICON_SIZE_DIALOG);
if(iterFind != sizes.end())
{
*/
m_image.set(Gtk::Stock::MISSING_IMAGE, Gtk::ICON_SIZE_DIALOG);
/*
}
else
{
std::cerr << "Glom: The current theme does not seem to havae the Gtk::Stock::MISSING_IMAGE icon in size Gtk::ICON_SIZE_DIALOG" << std::endl;
if(!sizes.empty() && (sizes[0] > 0))
{
std::cerr << " Using alternative stock icon size." << std::endl;
m_image.set(Gtk::Stock::MISSING_IMAGE, sizes[0]);
}
else
{
std::cerr << " No alternative stock icon size available either, for this stock icon." << std::endl;
m_image.set("");
}
}
}
else
{
std::cerr << "Glom: No Gtk::Style available for this widget (yet), so not setting MISSING_IMAGE icon." << std::endl;
m_image.set("");
}
*/
m_pixbuf_original = Glib::RefPtr<Gdk::Pixbuf>();
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment