From 1758320b6a90c3b382b343364aaa25ec42f0955e Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Mon, 2 Mar 2009 20:36:44 +0000 Subject: Initialise our dropdown at contruction and just repopulate it when the cardinfo callback is received --- src/pavucontrol.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/pavucontrol.cc b/src/pavucontrol.cc index 4a13fcd..3f940d3 100644 --- a/src/pavucontrol.cc +++ b/src/pavucontrol.cc @@ -490,6 +490,10 @@ CardWidget::CardWidget(BaseObjectType* cobject, const Glib::RefPtrget_widget("profileList", profileList); x->get_widget("iconImage", iconImage); + treeModel = Gtk::ListStore::create(profileModel); + profileList->set_model(treeModel); + profileList->pack_start(profileModel.desc); + profileList->signal_changed().connect( sigc::mem_fun(*this, &CardWidget::onProfileChange)); } @@ -505,10 +509,7 @@ void CardWidget::prepareMenu() { int idx = 0; int active_idx = -1; - //m_refTreeModel = Gtk::TreeStore::create(m_Columns); - treeModel = Gtk::ListStore::create(profileModel); - profileList->set_model(treeModel); - + treeModel->clear(); //Fill the ComboBox's Tree Model: for (std::map::iterator i = profiles.begin(); i != profiles.end(); ++i) { Gtk::TreeModel::Row row = *(treeModel->append()); @@ -519,9 +520,6 @@ void CardWidget::prepareMenu() { idx++; } - //Add the model columns to the Combo (which is a kind of view), - //rendering them in the default way: - profileList->pack_start(profileModel.desc); if (active_idx >= 0) profileList->set_active(active_idx); } -- cgit