On Thu, Jan 29, 2015 at 04:11:07PM -0200, Tomaz Canabrava wrote: > On Thu, Jan 29, 2015 at 2:56 PM, Robert Helling <hell...@lmu.de> wrote: > > > > I am lost. I am trying to get > > > > void MainTab::divetype_Changed(int index) > > > > in maintab.cpp to work. This is called when the combo box with the > > divetype is changed (to pSCR for example). This function gets called and > > sets the divetype of the displayed_dive accordingly. But then I want a > > replete (to reflect the different divemode in the profile picture. So I > > call > > > > > MainWindow::instance()->graphics()->replot(); > > > > > > But somehow this copies the current dive over the displayed dive and thus > > resets the value of displayed_dive.dc.divetype.
There is an interesting balance here. If you make changes to the displayed_dive, you need to enter edit mode and need to make sure that edit more actually handles the UI change. I don't think we have this correct right now. > > How do I do this correctly? Tomaz (master of profile)? Dirk (master of > > displayed_dive/current_dive)? > > You wanna to live-update the profile when changing the divetype, without > losing the things you had on the displayed_dive ? > I *think* you can't do that *right now* - as the replot copies the dive. MainWindow::instance()->graphics()->replot() calls plotDive with force=TRUE which means it WILL copy the current_dive over the displayed_dive. So what we need is a mode where it does the replotting simply based on the existing displayed_dive? > > I am lost. If I comment out the replot line it works (after pressing the > > apply changes button) but an updated profile would be nice. > > Do that for now, we need a bit of api-change on the replot to be able to do > that for 4.4, so my guess is that we can do for 4.5, unless dirk allows me > to do that. I'm quite worried about a change to something this central this late in the game. /D _______________________________________________ subsurface mailing list subsurface@subsurface-divelog.org http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface