--- gigedit/trunk/src/gigedit/dimensionmanager.cpp 2007/06/10 10:56:11 1225 +++ gigedit/trunk/src/gigedit/dimensionmanager.cpp 2007/10/12 17:46:29 1411 @@ -186,12 +186,12 @@ scrolledWindow.add(treeView); vbox.pack_start(scrolledWindow); scrolledWindow.show(); - vbox.pack_start(buttonBox); + vbox.pack_start(buttonBox, Gtk::PACK_SHRINK); buttonBox.set_layout(Gtk::BUTTONBOX_END); buttonBox.set_border_width(5); buttonBox.show(); - buttonBox.pack_start(addButton); - buttonBox.pack_start(removeButton); + buttonBox.pack_start(addButton, Gtk::PACK_SHRINK); + buttonBox.pack_start(removeButton, Gtk::PACK_SHRINK); addButton.show(); removeButton.show(); @@ -199,8 +199,8 @@ refTableModel = Gtk::ListStore::create(tableModel); treeView.set_model(refTableModel); treeView.append_column("Dimension Type", tableModel.m_dim_type); - treeView.append_column_numeric("Bits", tableModel.m_bits, "%d"); - treeView.append_column_numeric("Zones", tableModel.m_zones, "%d"); + treeView.append_column("Bits", tableModel.m_bits); + treeView.append_column("Zones", tableModel.m_zones); treeView.append_column("Description", tableModel.m_description); treeView.show(); @@ -284,15 +284,20 @@ "Adding dimension (type=0x%x, bits=%d, zones=%d)\n", dim.dimension, dim.bits, dim.zones ); + // notify everybody that we're going to update the region + region_to_be_changed_signal.emit(region); // add the new dimension to the region // (implicitly creates new dimension regions) region->AddDimension(&dim); // let everybody know there was a change - articulation_changed_signal.emit(); + region_changed_signal.emit(region); // update all GUI elements refreshManager(); } } catch (RIFF::Exception e) { + // notify that the changes are over (i.e. to avoid dead locks) + region_changed_signal.emit(region); + // show error message Glib::ustring txt = "Could not add dimension: " + e.Message; Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_ERROR); msg.run(); @@ -304,6 +309,8 @@ Gtk::TreeModel::iterator it = sel->get_selected(); if (it) { try { + // notify everybody that we're going to update the region + region_to_be_changed_signal.emit(region); // remove selected dimension Gtk::TreeModel::Row row = *it; gig::dimension_def_t* dim = row[tableModel.m_definition]; @@ -311,8 +318,11 @@ // remove respective row from table refTableModel->erase(it); // let everybody know there was a change - articulation_changed_signal.emit(); + region_changed_signal.emit(region); } catch (RIFF::Exception e) { + // notify that the changes are over (i.e. to avoid dead locks) + region_changed_signal.emit(region); + // show error message Glib::ustring txt = "Could not remove dimension: " + e.Message; Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_ERROR); msg.run();