Changeset 89b914e in subsurface


Ignore:
Timestamp:
Apr 20, 2017, 10:57:11 AM (3 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
abbb0a2
Parents:
9b8fc9f
git-author:
Jan Mulder <jlmulder@…> (04/18/17 23:05:28)
git-committer:
Dirk Hohndel <dirk@…> (04/20/17 10:57:11)
Message:

Preserve dive mode when planning a dive

Data such as cilinders and used gasses are populated fromn the currently
selected dive when starting the planner. It is more logical to use
the dive mode (OC, CCR, pSCR) of the currently selected dive
as well. This commits changes this.

Signed-off-by: Jan Mulder <jlmulder@…>

Location:
desktop-widgets
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • desktop-widgets/diveplanner.cpp

    r597539c r89b914e  
    185185{
    186186        ui.ATMPressure->setValue(surface_pressure);
     187}
     188
     189void PlannerSettingsWidget::setDiveMode(int mode)
     190{
     191        ui.rebreathermode->setCurrentIndex(mode);
    187192}
    188193
  • desktop-widgets/diveplanner.h

    r7f8c3592 r89b914e  
    8686        void setBackgasBreaks(bool dobreaks);
    8787        void disableDecoElements(int mode);
     88        void setDiveMode(int mode);
    8889
    8990private:
  • desktop-widgets/mainwindow.cpp

    rf2d8861 r89b914e  
    909909        DivePlannerPointsModel::instance()->clear();
    910910        DivePlannerPointsModel::instance()->setupCylinders();
     911
    911912}
    912913
     
    952953        DivePlannerPointsModel::instance()->setupStartTime();
    953954        DivePlannerPointsModel::instance()->createSimpleDive();
     955        // plan the dive in the same mode as the currently selected one
     956        divePlannerSettingsWidget()->setDiveMode(current_dive->dc.divemode);
    954957        DivePictureModel::instance()->updateDivePictures();
    955958        divePlannerWidget()->setReplanButton(false);
Note: See TracChangeset for help on using the changeset viewer.