summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorColin Guthrie <cguthrie@mandriva.org>2009-03-02 20:36:44 +0000
committerColin Guthrie <cguthrie@mandriva.org>2009-03-02 20:36:44 +0000
commit1758320b6a90c3b382b343364aaa25ec42f0955e (patch)
tree649f57faf3ed0ab182666b9336885e614bd68998 /src
parent3d5133064ebc92761eb939009f2e84c1dd0615c7 (diff)
Initialise our dropdown at contruction and just repopulate it when the cardinfo callback is received
Diffstat (limited to 'src')
-rw-r--r--src/pavucontrol.cc12
1 files changed, 5 insertions, 7 deletions
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::RefPtr<Gnome::Glade:
x->get_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<Glib::ustring, Glib::ustring>::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);
}