[glom] Avoid GTK+ stock-id warnings by using Gtk::StockID constructor



commit f963c6a710c820642ab581f4fb878507b869fdc8
Author: David King <davidk openismus com>
Date:   Tue Sep 1 15:27:06 2009 +0200

    Avoid GTK+ stock-id warnings by using Gtk::StockID constructor
    
    * glom/dialog_existing_or_new.cc:
    * glom/utility_widgets/db_adddel/db_adddel.cc: Use Gtk::StockID
    constructor with builtin stock items so that GTK+ warnings are not
    triggered.

 ChangeLog                                   |    7 +++++++
 glom/dialog_existing_or_new.cc              |   26 +++++++++++++-------------
 glom/utility_widgets/db_adddel/db_adddel.cc |    2 +-
 3 files changed, 21 insertions(+), 14 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 554256b..b2a2bb1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-09-01  David King  <davidk openismus com>
+
+	* glom/dialog_existing_or_new.cc:
+	* glom/utility_widgets/db_adddel/db_adddel.cc: Use Gtk::StockID
+	constructor with builtin stock items so that GTK+ warnings are not
+	triggered.
+
 2009-09-01  Johannes Schmid  <jschmid openismus com>
 
 	* glom/base_db.cc: Fixed small build problem with disabled exceptions
diff --git a/glom/dialog_existing_or_new.cc b/glom/dialog_existing_or_new.cc
index 94f314c..f95ca66 100644
--- a/glom/dialog_existing_or_new.cc
+++ b/glom/dialog_existing_or_new.cc
@@ -428,18 +428,18 @@ void Dialog_ExistingOrNew::existing_icon_data_func(Gtk::CellRenderer* renderer,
   pixbuf_renderer->property_pixbuf() = Glib::RefPtr<Gdk::Pixbuf>();
 
   if(iter == m_iter_existing_recent)
-    pixbuf_renderer->property_stock_id() = Gtk::Stock::INDEX.id; // TODO: More meaningful icon?
+    pixbuf_renderer->property_stock_id() = Gtk::StockID(Gtk::Stock::INDEX); // TODO: More meaningful icon?
 #ifndef G_OS_WIN32
   else if(iter == m_iter_existing_network)
-    pixbuf_renderer->property_stock_id() = Gtk::Stock::NETWORK.id;
+    pixbuf_renderer->property_stock_id() = Gtk::StockID(Gtk::Stock::NETWORK);
 #endif
   else if(iter == m_iter_existing_other)
-    pixbuf_renderer->property_stock_id() = Gtk::Stock::OPEN.id;
+    pixbuf_renderer->property_stock_id() = Gtk::StockID(Gtk::Stock::OPEN);
   else if(m_iter_existing_recent_dummy.get() != NULL && iter == *m_iter_existing_recent_dummy)
-    pixbuf_renderer->property_stock_id() = Gtk::Stock::DIALOG_ERROR.id; // TODO: Use Stock::STOP instead?
+    pixbuf_renderer->property_stock_id() = Gtk::StockID(Gtk::Stock::DIALOG_ERROR); // TODO: Use Stock::STOP instead?
 #ifndef G_OS_WIN32
   else if(m_iter_existing_network_dummy.get() != NULL && iter == *m_iter_existing_network_dummy)
-    pixbuf_renderer->property_stock_id() = Gtk::Stock::DIALOG_ERROR.id; // TODO: Use Stock::STOP instead?
+    pixbuf_renderer->property_stock_id() = Gtk::StockID(Gtk::Stock::DIALOG_ERROR); // TODO: Use Stock::STOP instead?
 #endif
 
 #else // Properties enabled
@@ -449,18 +449,18 @@ void Dialog_ExistingOrNew::existing_icon_data_func(Gtk::CellRenderer* renderer,
   pixbuf_renderer->set_property("pixbuf", Glib::RefPtr<Gdk::Pixbuf>());
 
   if(iter == m_iter_existing_recent)
-    pixbuf_renderer->set_property("stock-id", Gtk::Stock::INDEX.id);
+    pixbuf_renderer->set_property("stock-id", Gtk::StockID(Gtk::Stock::INDEX));
 #ifndef G_OS_WIN32
   else if(iter == m_iter_existing_network)
-    pixbuf_renderer->set_property("stock-id", Gtk::Stock::NETWORK.id);
+    pixbuf_renderer->set_property("stock-id", Gtk::StockID(Gtk::Stock::NETWORK));
 #endif
   else if(iter == m_iter_existing_other)
-    pixbuf_renderer->set_property("stock-id", Gtk::Stock::OPEN.id);
+    pixbuf_renderer->set_property("stock-id", Gtk::StockID(Gtk::Stock::OPEN));
   else if(m_iter_existing_recent_dummy.get() != NULL && iter == *m_iter_existing_recent_dummy)
-    pixbuf_renderer->set_property("stock-id", Gtk::Stock::DIALOG_ERROR.id); // TODO: Use Stock::STOP instead?
+    pixbuf_renderer->set_property("stock-id", Gtk::StockID(Gtk::Stock::DIALOG_ERROR)); // TODO: Use Stock::STOP instead?
 #ifndef G_OS_WIN32
   else if(m_iter_existing_network_dummy.get() != NULL && iter == *m_iter_existing_network_dummy)
-    pixbuf_renderer->set_property("stock-id", Gtk::Stock::DIALOG_ERROR.id); // TODO: Use Stock::STOP instead?
+    pixbuf_renderer->set_property("stock-id", Gtk::StockID(Gtk::Stock::DIALOG_ERROR)); // TODO: Use Stock::STOP instead?
 #endif
 
 #endif // Properties enabled
@@ -571,11 +571,11 @@ void Dialog_ExistingOrNew::new_icon_data_func(Gtk::CellRenderer* renderer, const
   pixbuf_renderer->set_property("pixbuf", Glib::RefPtr<Gdk::Pixbuf>());
       
   if(iter == m_iter_new_empty)
-    pixbuf_renderer->set_property("stock-id", Gtk::Stock::NEW.id);
+    pixbuf_renderer->set_property("stock-id", Gtk::StockID(Gtk::Stock::NEW));
   else if(iter == m_iter_new_template)
-    pixbuf_renderer->set_property("stock-id", Gtk::Stock::EDIT.id); // TODO: More meaningful icon?
+    pixbuf_renderer->set_property("stock-id", Gtk::StockID(Gtk::Stock::EDIT)); // TODO: More meaningful icon?
   else if(m_iter_new_template_dummy.get() != NULL && iter == *m_iter_new_template_dummy)
-    pixbuf_renderer->set_property("stock-id", Gtk::Stock::DIALOG_ERROR.id); // TODO: Use Stock::STOP instead?
+    pixbuf_renderer->set_property("stock-id", Gtk::StockID(Gtk::Stock::DIALOG_ERROR)); // TODO: Use Stock::STOP instead?
   else
   {
     if(m_new_model->is_ancestor(m_iter_new_template, iter))
diff --git a/glom/utility_widgets/db_adddel/db_adddel.cc b/glom/utility_widgets/db_adddel/db_adddel.cc
index 281c9e8..a78c898 100644
--- a/glom/utility_widgets/db_adddel/db_adddel.cc
+++ b/glom/utility_widgets/db_adddel/db_adddel.cc
@@ -658,7 +658,7 @@ Gtk::CellRenderer* DbAddDel::construct_specified_columns_cellrenderer(const shar
        if(pixbuf)
          pixbuf_renderer->set_property("pixbuf", pixbuf);
        else
-         pixbuf_renderer->set_property("stock-id", Gtk::Stock::MISSING_IMAGE);
+         pixbuf_renderer->set_property("stock-id", Gtk::StockID(Gtk::Stock::MISSING_IMAGE));
 
        pCellRenderer = pixbuf_renderer;
      }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]