/[svn]/gigedit/trunk/src/gigedit/dimensionmanager.cpp
ViewVC logotype

Diff of /gigedit/trunk/src/gigedit/dimensionmanager.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2845 by persson, Sun Sep 20 10:18:22 2015 UTC revision 2919 by schoenebeck, Wed May 18 11:37:31 2016 UTC
# Line 392  void DimensionManager::set_region(gig::R Line 392  void DimensionManager::set_region(gig::R
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;
# Line 438  void DimensionManager::onColumnClicked() Line 445  void DimensionManager::onColumnClicked()
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;
# Line 446  void DimensionManager::onColumnClicked() Line 454  void DimensionManager::onColumnClicked()
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

Legend:
Removed from v.2845  
changed lines
  Added in v.2919

  ViewVC Help
Powered by ViewVC