Planner: don't try to update the MainTab dive info while in plan mode

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-05-26 15:17:34 -07:00
parent 0f023791f8
commit 0d58cfb641
3 changed files with 8 additions and 2 deletions

View file

@ -383,8 +383,8 @@ bool MainTab::isEditing()
void MainTab::updateDiveInfo(int dive)
{
// don't execute this while adding a dive
if (editMode == ADD || editMode == MANUALLY_ADDED_DIVE)
// don't execute this while adding / planning a dive
if (editMode == ADD || editMode == MANUALLY_ADDED_DIVE || MainWindow::instance()->graphics()->isPlanner())
return;
if (!isEnabled() && dive != -1)
setEnabled(true);

View file

@ -816,6 +816,11 @@ extern struct ev_select *ev_namelist;
extern int evn_allocated;
extern int evn_used;
bool ProfileWidget2::isPlanner()
{
return currentState == PLAN;
}
void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event)
{
if (currentState == ADD || currentState == PLAN) {

View file

@ -71,6 +71,7 @@ public:
void setupItem(AbstractProfilePolygonItem *item, DiveCartesianAxis *hAxis, DiveCartesianAxis *vAxis, DivePlotDataModel *model, int vData, int hData, int zValue);
void setPrintMode(bool mode, bool grayscale = false);
bool isPointOutOfBoundaries(const QPointF &point) const;
bool isPlanner();
State currentState;
public