[glom] test_glade_derived_instantiation: Avoid warnings about no connection.



commit f9ae382b6720071cc1266c0727669c460114da5e
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Dec 9 02:08:43 2011 +0100

    test_glade_derived_instantiation: Avoid warnings about no connection.
    
    	* glom/mode_design/users/dialog_groups_list.cc: Constructor:
    	Do not call fill_groups_list(). This happens already in load_from_document(),
    	where we can expect more to have a connection.
    	* glom/mode_design/users/dialog_users_list.[h|cc]: Make fill_list public
    	and expect the caller of the constructor to call it.

 ChangeLog                                    |   10 ++++++++++
 glom/mode_design/users/dialog_groups_list.cc |    4 +++-
 glom/mode_design/users/dialog_users_list.cc  |    2 --
 glom/mode_design/users/dialog_users_list.h   |   11 +++++++++--
 4 files changed, 22 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7eb6936..63be55b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-12-09  Murray Cumming  <murrayc murrayc com>
+
+	test_glade_derived_instantiation: Avoid warnings about no connection.
+
+	* glom/mode_design/users/dialog_groups_list.cc: Constructor:
+	Do not call fill_groups_list(). This happens already in load_from_document(),
+	where we can expect more to have a connection.
+	* glom/mode_design/users/dialog_users_list.[h|cc]: Make fill_list public
+	and expect the caller of the constructor to call it.
+
 2011-12-08  Murray Cumming  <murrayc murrayc com>
 
 	test_fake_connection: Avoid unnecessary warnings about metadata.
diff --git a/glom/mode_design/users/dialog_groups_list.cc b/glom/mode_design/users/dialog_groups_list.cc
index dc34bc7..cc29599 100644
--- a/glom/mode_design/users/dialog_groups_list.cc
+++ b/glom/mode_design/users/dialog_groups_list.cc
@@ -51,7 +51,8 @@ Dialog_GroupsList::Dialog_GroupsList(BaseObjectType* cobject, const Glib::RefPtr
   m_model_groups = Gtk::ListStore::create(m_model_columns_groups);
   m_model_tables = Gtk::ListStore::create(m_model_columns_tables);
 
-  fill_group_list();
+  //Do this only in load_from_document(), to avoid ever doing it too early, before there is a connection:
+  //fill_group_list();
   //fill_table_list();
 
   m_treeview_groups->set_model(m_model_groups);
@@ -300,6 +301,7 @@ void Dialog_GroupsList::on_button_group_users()
       dialog->set_transient_for(*this);
       add_view(dialog); //Give it access to the document.
 
+      dialog->fill_list();
       dialog->set_group(group_name);
 
       Glom::Utils::dialog_run_with_help(dialog);
diff --git a/glom/mode_design/users/dialog_users_list.cc b/glom/mode_design/users/dialog_users_list.cc
index 7269c78..44ad9c2 100644
--- a/glom/mode_design/users/dialog_users_list.cc
+++ b/glom/mode_design/users/dialog_users_list.cc
@@ -59,8 +59,6 @@ Dialog_UsersList::Dialog_UsersList(BaseObjectType* cobject, const Glib::RefPtr<G
 
     m_model_users = Gtk::ListStore::create(m_model_columns_users);
 
-    fill_list();
-
     m_treeview_users->set_model(m_model_users);
 
 
diff --git a/glom/mode_design/users/dialog_users_list.h b/glom/mode_design/users/dialog_users_list.h
index 8acc956..064be3d 100644
--- a/glom/mode_design/users/dialog_users_list.h
+++ b/glom/mode_design/users/dialog_users_list.h
@@ -30,6 +30,9 @@
 namespace Glom
 {
 
+/** A dialog that lists the users in a group,
+ * or all users if no group is selected.
+ */
 class Dialog_UsersList
   : public Gtk::Dialog,
     public Base_DB
@@ -38,15 +41,19 @@ public:
   static const char* glade_id;
   static const bool glade_developer;
 
+  /** Call fill_list() after instantiating this class.
+   */
   Dialog_UsersList(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder);
   virtual ~Dialog_UsersList();
 
+  /** Fill the list of users.
+   */
+  void fill_list();
+
   virtual void set_group(const Glib::ustring& group_name);
 
 private:
 
-  void fill_list();
-
   //Enable/disable buttons, depending on treeview selection:
   virtual void enable_buttons();
 



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