392 |
} |
} |
393 |
|
|
394 |
void DimensionManager::onColumnClicked() { |
void DimensionManager::onColumnClicked() { |
395 |
|
printf("DimensionManager::onColumnClicked()\n"); |
396 |
|
|
397 |
|
//FIXME: BUG: this method is currently very unreliably called, it should actually be called when the user selects another column, it is ATM however also called when the table content changed programmatically causing the dialog below to popup at undesired times ! |
398 |
|
|
399 |
//HACK: Prevents that onColumnClicked() gets called multiple times or at times where it is not desired |
//HACK: Prevents that onColumnClicked() gets called multiple times or at times where it is not desired |
400 |
if (ignoreColumnClicked) { |
if (ignoreColumnClicked) { |
401 |
ignoreColumnClicked = false; |
ignoreColumnClicked = false; |
402 |
return; |
return; |
403 |
} |
} |
404 |
|
// prevents app to crash if this dialog is closed |
405 |
|
if (!get_visible()) |
406 |
|
return; |
407 |
|
|
408 |
Gtk::TreeModel::Path path; |
Gtk::TreeModel::Path path; |
409 |
Gtk::TreeViewColumn* focus_column; |
Gtk::TreeViewColumn* focus_column; |
445 |
comboDimType.set_active(oldTypeIndex); |
comboDimType.set_active(oldTypeIndex); |
446 |
|
|
447 |
if (!dialog.run()) { // OK selected ... |
if (!dialog.run()) { // OK selected ... |
448 |
|
ignoreColumnClicked = true; |
449 |
Gtk::TreeModel::iterator iterType = comboDimType.get_active(); |
Gtk::TreeModel::iterator iterType = comboDimType.get_active(); |
450 |
if (!iterType) return; |
if (!iterType) return; |
451 |
Gtk::TreeModel::Row rowType = *iterType; |
Gtk::TreeModel::Row rowType = *iterType; |
454 |
gig::dimension_t newType = static_cast<gig::dimension_t>(iTypeID); |
gig::dimension_t newType = static_cast<gig::dimension_t>(iTypeID); |
455 |
if (newType == oldType) return; |
if (newType == oldType) return; |
456 |
//printf("change 0x%x -> 0x%x\n", oldType, newType); |
//printf("change 0x%x -> 0x%x\n", oldType, newType); |
|
ignoreColumnClicked = true; |
|
457 |
|
|
458 |
// assemble the list of regions where the selected dimension type |
// assemble the list of regions where the selected dimension type |
459 |
// shall be changed |
// shall be changed |