mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Planner: Re-enable using the new profile.
This correctly enables the planner on the new profile, but it doesn't triggers the correct paint on the canvas. [Dirk Hohndel: remove other remnants of the disabled planner as well] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d1366257f0
commit
feff22c222
9 changed files with 13 additions and 34 deletions
|
@ -15,10 +15,6 @@ A2X = a2x
|
||||||
BROWSER = firefox
|
BROWSER = firefox
|
||||||
THEME = compact_subsurface
|
THEME = compact_subsurface
|
||||||
PWD = $(realpath .)
|
PWD = $(realpath .)
|
||||||
ENABLE_PLANNER := 0
|
|
||||||
ifeq ($(ENABLE_PLANNER), 1)
|
|
||||||
ENABLE_PLANNER_ATTR=-a ENABLE_PLANNER=$(ENABLE_PLANNER)
|
|
||||||
endif
|
|
||||||
|
|
||||||
all: doc $(addprefix $(DOCNAME).,pdf text)
|
all: doc $(addprefix $(DOCNAME).,pdf text)
|
||||||
|
|
||||||
|
@ -33,11 +29,11 @@ $(OUT)$(DOCNAME).pdf: $(DOCSOURCE)
|
||||||
$(OUT)$(HTMLDOC): $(DOCSOURCE)
|
$(OUT)$(HTMLDOC): $(DOCSOURCE)
|
||||||
@echo "if asciidoc isn't found the html file included in the sources is copied"
|
@echo "if asciidoc isn't found the html file included in the sources is copied"
|
||||||
$(ASCIIDOC) -a toc -a toclevels=3 -a themedir=$(PWD) -a theme=$(THEME) -a stylesdir=$(PWD) \
|
$(ASCIIDOC) -a toc -a toclevels=3 -a themedir=$(PWD) -a theme=$(THEME) -a stylesdir=$(PWD) \
|
||||||
$(ENABLE_PLANNER_ATTR) -o $(OUT)$(HTMLDOC) $< || cp $(HTMLDOC).git $(OUT)$(HTMLDOC)
|
-o $(OUT)$(HTMLDOC) $< || cp $(HTMLDOC).git $(OUT)$(HTMLDOC)
|
||||||
|
|
||||||
# Alternatively::
|
# Alternatively::
|
||||||
$(OUT)$(DOCNAME).xhtml: $(DOCSOURCE)
|
$(OUT)$(DOCNAME).xhtml: $(DOCSOURCE)
|
||||||
$(A2X) $(ENABLE_PLANNER_ATTR) --icons -f xhtml $<
|
$(A2X) --icons -f xhtml $<
|
||||||
|
|
||||||
show: $(HTMLDOC)
|
show: $(HTMLDOC)
|
||||||
$(BROWSER) $<
|
$(BROWSER) $<
|
||||||
|
|
|
@ -1889,7 +1889,6 @@ language / country settings as the underlying OS. If this is for some reason
|
||||||
undesirable users can uncheck this checkbox and pick a language / country
|
undesirable users can uncheck this checkbox and pick a language / country
|
||||||
combination from the list of included localizations.
|
combination from the list of included localizations.
|
||||||
|
|
||||||
ifdef::ENABLE_PLANNER[]
|
|
||||||
[[S_DivePlanner]]
|
[[S_DivePlanner]]
|
||||||
== The Subsurface dive planner
|
== The Subsurface dive planner
|
||||||
The dive planner is accessed by selecting _Log -> Plan Dive_ from the main menu. This
|
The dive planner is accessed by selecting _Log -> Plan Dive_ from the main menu. This
|
||||||
|
@ -1983,7 +1982,6 @@ there is no provision for any reserve gas.
|
||||||
image::images/Planner2.jpg["FIGURE: Planning a dive: evaluation",align="center"]
|
image::images/Planner2.jpg["FIGURE: Planning a dive: evaluation",align="center"]
|
||||||
|
|
||||||
This part of the software is in active development.
|
This part of the software is in active development.
|
||||||
endif::ENABLE_PLANNER[]
|
|
||||||
|
|
||||||
== Description of the Subsurface Main Menu items
|
== Description of the Subsurface Main Menu items
|
||||||
|
|
||||||
|
@ -2023,9 +2021,7 @@ from _www.Divelogs.de_.
|
||||||
- <<S_EnterData,_Add Dive_>> - Manually add a new dive to the *Dive List* panel.
|
- <<S_EnterData,_Add Dive_>> - Manually add a new dive to the *Dive List* panel.
|
||||||
- <<S_Renumber,_Renumber_>> - Renumber the dives listed in the *Dive List*
|
- <<S_Renumber,_Renumber_>> - Renumber the dives listed in the *Dive List*
|
||||||
panel.
|
panel.
|
||||||
ifdef::ENABLE_PLANNER[]
|
|
||||||
-_Plan Dive_ - This experimental feature allows planning of simple dives.
|
-_Plan Dive_ - This experimental feature allows planning of simple dives.
|
||||||
endif::ENABLE_PLANNER[]
|
|
||||||
- <<S_Group,_Auto Group_>> - Group the dives in the *Dive List* panel into dive
|
- <<S_Group,_Auto Group_>> - Group the dives in the *Dive List* panel into dive
|
||||||
trips.
|
trips.
|
||||||
- _Edit Device Names_ - Edit the names of dive computers.
|
- _Edit Device Names_ - Edit the names of dive computers.
|
||||||
|
|
|
@ -215,9 +215,7 @@ DivePlannerWidget::DivePlannerWidget(QWidget *parent, Qt::WindowFlags f) : QWidg
|
||||||
QTableView *view = ui.cylinderTableWidget->view();
|
QTableView *view = ui.cylinderTableWidget->view();
|
||||||
view->setColumnHidden(CylindersModel::START, true);
|
view->setColumnHidden(CylindersModel::START, true);
|
||||||
view->setColumnHidden(CylindersModel::END, true);
|
view->setColumnHidden(CylindersModel::END, true);
|
||||||
#ifdef ENABLE_PLANNER
|
|
||||||
view->setColumnHidden(CylindersModel::DEPTH, false);
|
view->setColumnHidden(CylindersModel::DEPTH, false);
|
||||||
#endif
|
|
||||||
view->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate(this));
|
view->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate(this));
|
||||||
connect(ui.cylinderTableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addCylinder_clicked()));
|
connect(ui.cylinderTableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addCylinder_clicked()));
|
||||||
connect(ui.tableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addStop()));
|
connect(ui.tableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addStop()));
|
||||||
|
|
|
@ -88,9 +88,7 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
|
||||||
|
|
||||||
ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate(this));
|
ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate(this));
|
||||||
ui.weights->view()->setItemDelegateForColumn(WeightModel::TYPE, new WSInfoDelegate(this));
|
ui.weights->view()->setItemDelegateForColumn(WeightModel::TYPE, new WSInfoDelegate(this));
|
||||||
#ifdef ENABLE_PLANNER
|
|
||||||
ui.cylinders->view()->setColumnHidden(CylindersModel::DEPTH, true);
|
ui.cylinders->view()->setColumnHidden(CylindersModel::DEPTH, true);
|
||||||
#endif
|
|
||||||
completers.buddy = new QCompleter(&buddyModel, ui.buddy);
|
completers.buddy = new QCompleter(&buddyModel, ui.buddy);
|
||||||
completers.divemaster = new QCompleter(&diveMasterModel, ui.divemaster);
|
completers.divemaster = new QCompleter(&diveMasterModel, ui.divemaster);
|
||||||
completers.location = new QCompleter(&locationModel, ui.location);
|
completers.location = new QCompleter(&locationModel, ui.location);
|
||||||
|
|
|
@ -87,9 +87,6 @@ MainWindow::MainWindow() : QMainWindow(),
|
||||||
ui.ListWidget->scrollTo(ui.ListWidget->model()->index(0, 0), QAbstractItemView::PositionAtCenter);
|
ui.ListWidget->scrollTo(ui.ListWidget->model()->index(0, 0), QAbstractItemView::PositionAtCenter);
|
||||||
ui.divePlannerWidget->settingsChanged();
|
ui.divePlannerWidget->settingsChanged();
|
||||||
|
|
||||||
#ifndef ENABLE_PLANNER
|
|
||||||
ui.menuLog->removeAction(ui.actionDivePlanner);
|
|
||||||
#endif
|
|
||||||
#ifdef NO_MARBLE
|
#ifdef NO_MARBLE
|
||||||
ui.layoutWidget->hide();
|
ui.layoutWidget->hide();
|
||||||
ui.menuView->removeAction(ui.actionViewGlobe);
|
ui.menuView->removeAction(ui.actionViewGlobe);
|
||||||
|
@ -318,6 +315,7 @@ void MainWindow::on_actionDivePlanner_triggered()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ui.newProfile->setPlanState();
|
||||||
ui.infoPane->setCurrentIndex(PLANNERWIDGET);
|
ui.infoPane->setCurrentIndex(PLANNERWIDGET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,9 +67,7 @@ CylindersModel::CylindersModel(QObject *parent) : current(0), rows(0)
|
||||||
{
|
{
|
||||||
// enum {REMOVE, TYPE, SIZE, WORKINGPRESS, START, END, O2, HE, DEPTH};
|
// enum {REMOVE, TYPE, SIZE, WORKINGPRESS, START, END, O2, HE, DEPTH};
|
||||||
setHeaderDataStrings(QStringList() << "" << tr("Type") << tr("Size") << tr("WorkPress") << tr("StartPress") << tr("EndPress") << trUtf8("O" UTF8_SUBSCRIPT_2 "%") << tr("He%")
|
setHeaderDataStrings(QStringList() << "" << tr("Type") << tr("Size") << tr("WorkPress") << tr("StartPress") << tr("EndPress") << trUtf8("O" UTF8_SUBSCRIPT_2 "%") << tr("He%")
|
||||||
#ifdef ENABLE_PLANNER
|
|
||||||
<< tr("Switch at")
|
<< tr("Switch at")
|
||||||
#endif
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,11 +143,9 @@ QVariant CylindersModel::data(const QModelIndex &index, int role) const
|
||||||
case HE:
|
case HE:
|
||||||
ret = percent_string(cyl->gasmix.he);
|
ret = percent_string(cyl->gasmix.he);
|
||||||
break;
|
break;
|
||||||
#ifdef ENABLE_PLANNER
|
|
||||||
case DEPTH:
|
case DEPTH:
|
||||||
ret = get_depth_string(cyl->depth, true);
|
ret = get_depth_string(cyl->depth, true);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Qt::DecorationRole:
|
case Qt::DecorationRole:
|
||||||
|
@ -263,13 +259,11 @@ bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, in
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifdef ENABLE_PLANNER
|
|
||||||
case DEPTH:
|
case DEPTH:
|
||||||
if (CHANGED()) {
|
if (CHANGED()) {
|
||||||
cyl->depth = string_to_depth(vString.toUtf8().data());
|
cyl->depth = string_to_depth(vString.toUtf8().data());
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
dataChanged(index, index);
|
dataChanged(index, index);
|
||||||
if (addDiveMode)
|
if (addDiveMode)
|
||||||
|
|
|
@ -102,9 +102,7 @@ public:
|
||||||
END,
|
END,
|
||||||
O2,
|
O2,
|
||||||
HE,
|
HE,
|
||||||
#ifdef ENABLE_PLANNER
|
|
||||||
DEPTH,
|
DEPTH,
|
||||||
#endif
|
|
||||||
COLUMNS
|
COLUMNS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -773,6 +773,15 @@ void ProfileWidget2::setPlanState()
|
||||||
setProfileState();
|
setProfileState();
|
||||||
disconnectTemporaryConnections();
|
disconnectTemporaryConnections();
|
||||||
/* show the same stuff that the profile shows. */
|
/* show the same stuff that the profile shows. */
|
||||||
|
|
||||||
|
DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance();
|
||||||
|
connect(plannerModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(replot()));
|
||||||
|
connect(plannerModel, SIGNAL(cylinderModelEdited()), this, SLOT(replot()));
|
||||||
|
connect(plannerModel, SIGNAL(rowsInserted(const QModelIndex &, int, int)),
|
||||||
|
this, SLOT(pointInserted(const QModelIndex &, int, int)));
|
||||||
|
connect(plannerModel, SIGNAL(rowsRemoved(const QModelIndex &, int, int)),
|
||||||
|
this, SLOT(pointsRemoved(const QModelIndex &, int, int)));
|
||||||
|
|
||||||
currentState = PLAN; /* enable the add state. */
|
currentState = PLAN; /* enable the add state. */
|
||||||
setBackgroundBrush(QColor(Qt::green).light());
|
setBackgroundBrush(QColor(Qt::green).light());
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,11 +15,6 @@ else: TARGET = subsurface
|
||||||
|
|
||||||
VERSION = 4.1.0
|
VERSION = 4.1.0
|
||||||
|
|
||||||
# enable or disable the dive planner
|
|
||||||
planner {
|
|
||||||
DEFINES += ENABLE_PLANNER
|
|
||||||
}
|
|
||||||
|
|
||||||
HEADERS = \
|
HEADERS = \
|
||||||
color.h \
|
color.h \
|
||||||
deco.h \
|
deco.h \
|
||||||
|
@ -237,10 +232,7 @@ QTTRANSLATIONS = \
|
||||||
qt_sv.qm \
|
qt_sv.qm \
|
||||||
qt_zh_TW.qm
|
qt_zh_TW.qm
|
||||||
|
|
||||||
# Should we enable the planner sections in the manual?
|
doc.commands += $(CHK_DIR_EXISTS) $$OUT_PWD/Documentation || $(MKDIR) $$OUT_PWD/Documentation $$escape_expand(\\n\\t)$(MAKE) -C $$PWD/Documentation OUT=$$OUT_PWD/Documentation/ doc
|
||||||
planner: ENABLE_PLANNER=1
|
|
||||||
else: ENABLE_PLANNER=0
|
|
||||||
doc.commands += $(CHK_DIR_EXISTS) $$OUT_PWD/Documentation || $(MKDIR) $$OUT_PWD/Documentation $$escape_expand(\\n\\t)$(MAKE) -C $$PWD/Documentation OUT=$$OUT_PWD/Documentation/ ENABLE_PLANNER=$$ENABLE_PLANNER doc
|
|
||||||
all.depends += doc
|
all.depends += doc
|
||||||
QMAKE_EXTRA_TARGETS += doc all
|
QMAKE_EXTRA_TARGETS += doc all
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue