mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Profile: store animation speed in profile object
When exporting dive pictures we don't want animations. Therefore, store the animation speed in the profile object to avoid nasty hacks with the preferences. This actually removes such a hack. Pictures and tooltips for now still use the values stored in the preferences, because their animations happen only on user-interactions. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
2d9dc40171
commit
f93e0aafd5
3 changed files with 15 additions and 19 deletions
|
@ -594,10 +594,9 @@ void ProfileWidget2::plotDive(const struct dive *d, bool force, bool doClearPict
|
|||
}
|
||||
|
||||
// special handling for the first time we display things
|
||||
int animSpeedBackup = 0;
|
||||
animSpeed = qPrefDisplay::animation_speed();
|
||||
if (firstCall && haveFilesOnCommandLine()) {
|
||||
animSpeedBackup = qPrefDisplay::animation_speed();
|
||||
qPrefDisplay::set_animation_speed(0);
|
||||
animSpeed = 0;
|
||||
firstCall = false;
|
||||
}
|
||||
|
||||
|
@ -814,9 +813,6 @@ void ProfileWidget2::plotDive(const struct dive *d, bool force, bool doClearPict
|
|||
dcText += tr(" (#%1 of %2)").arg(dc_number + 1).arg(nr);
|
||||
#endif
|
||||
diveComputerText->setText(dcText);
|
||||
if (haveFilesOnCommandLine() && animSpeedBackup != 0) {
|
||||
qPrefDisplay::set_animation_speed(animSpeedBackup);
|
||||
}
|
||||
|
||||
#ifndef SUBSURFACE_MOBILE
|
||||
if (currentState == ADD || currentState == PLAN) { // TODO: figure a way to move this from here.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue