summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/mainwindow.cpp4
-rw-r--r--qt-ui/profilegraphics.cpp23
2 files changed, 14 insertions, 13 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index e8134a5f6..8ac0ad871 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -67,7 +67,6 @@ void MainWindow::on_actionOpen_triggered()
g_error_free(error);
error = NULL;
}
-
process_dives(FALSE, FALSE);
ui->InfoWidget->reload();
@@ -94,8 +93,7 @@ void MainWindow::dive_selection_changed(const QItemSelection& newSelection, cons
continue;
select_dive(get_divenr(d));
}
-
- ui->ProfileWidget->plot( get_dive(selected_dive) );
+ ui->ProfileWidget->plot(get_dive(selected_dive));
}
void MainWindow::on_actionSave_triggered()
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp
index c5421659c..053e3db0f 100644
--- a/qt-ui/profilegraphics.cpp
+++ b/qt-ui/profilegraphics.cpp
@@ -42,11 +42,12 @@ typedef enum {
CEILING_SHALLOW, CEILING_DEEP, CALC_CEILING_SHALLOW, CALC_CEILING_DEEP
} color_indice_t;
+
+#define COLOR(x, y, z) QVector<QColor>() << x << y << z;
/* profile_color[color indice] = COLOR(screen color, b/w printer color, color printer}} printer & screen colours could be different */
QMap<color_indice_t, QVector<QColor> > profile_color;
void fill_profile_color()
{
-#define COLOR(x, y, z) QVector<QColor>() << x << y << z;
profile_color[SAC_1] = COLOR(FUNGREEN1, BLACK1_LOW_TRANS, FUNGREEN1);
profile_color[SAC_2] = COLOR(APPLE1, BLACK1_LOW_TRANS, APPLE1);
profile_color[SAC_3] = COLOR(ATLANTIS1, BLACK1_LOW_TRANS, ATLANTIS1);
@@ -95,8 +96,9 @@ void fill_profile_color()
profile_color[CEILING_DEEP] = COLOR(RED1_MED_TRANS, BLACK1_HIGH_TRANS, RED1_MED_TRANS);
profile_color[CALC_CEILING_SHALLOW] = COLOR(FUNGREEN1_HIGH_TRANS, BLACK1_HIGH_TRANS, FUNGREEN1_HIGH_TRANS);
profile_color[CALC_CEILING_DEEP] = COLOR(APPLE1_HIGH_TRANS, BLACK1_HIGH_TRANS, APPLE1_HIGH_TRANS);
-#undef COLOR
+
}
+#undef COLOR
ProfileGraphicsView::ProfileGraphicsView(QWidget* parent) : QGraphicsView(parent)
{
@@ -175,8 +177,8 @@ void ProfileGraphicsView::plot(struct dive *dive)
* Snif. What a pity.
*/
QRectF drawing_area = scene()->sceneRect();
- gc.maxx = (drawing_area.width() - 2*drawing_area.x());
- gc.maxy = (drawing_area.height() - 2*drawing_area.y());
+ gc.maxx = (drawing_area.width() - 2 * drawing_area.x());
+ gc.maxy = (drawing_area.height() - 2 * drawing_area.y());
dc = select_dc(dc);
@@ -304,8 +306,12 @@ void ProfileGraphicsView::plot_depth_profile(struct graphics_context *gc, struct
gc->leftx = 0; gc->rightx = 1.0;
gc->topy = 0; gc->bottomy = maxdepth;
switch (prefs.units.length) {
- case units::METERS: marker = 10000; break;
- case units::FEET: marker = 9144; break; /* 30 ft */
+ case units::METERS:
+ marker = 10000;
+ break;
+ case units::FEET:
+ marker = 9144;
+ break; /* 30 ft */
}
maxline = MAX(pi->maxdepth + marker, maxdepth * 2 / 3);
@@ -344,10 +350,9 @@ void ProfileGraphicsView::plot_depth_profile(struct graphics_context *gc, struct
entry = pi->entry;
-
QPolygonF p;
QLinearGradient pat(0.0,0.0,0.0,scene()->height());
- QGraphicsPolygonItem *neatFill = 0;
+ QGraphicsPolygonItem *neatFill = NULL;
for (i = 0; i < pi->nr; i++, entry++)
p.append( QPointF( SCALE(gc, entry->sec, entry->depth) ));
@@ -364,7 +369,6 @@ void ProfileGraphicsView::plot_depth_profile(struct graphics_context *gc, struct
}
}
-;
pat.setColorAt(1, profile_color[DEPTH_BOTTOM].first());
pat.setColorAt(0, profile_color[DEPTH_TOP].first());
@@ -457,7 +461,6 @@ void ProfileGraphicsView::plot_depth_profile(struct graphics_context *gc, struct
/* we want to draw the segments in different colors
* representing the vertical velocity, so we need to
* chop this into short segments */
-
depth = entry->depth;
QGraphicsLineItem *colorLine = new QGraphicsLineItem( SCALE(gc, entry[-1].sec, entry[-1].depth), SCALE(gc, sec, depth));
colorLine->setPen(QPen(QBrush(profile_color[ (color_indice_t) (VELOCITY_COLORS_START_IDX + entry->velocity)].first()), 2 ));