diff options
Diffstat (limited to 'profile-widget')
-rw-r--r-- | profile-widget/profilewidget2.cpp | 9 | ||||
-rw-r--r-- | profile-widget/profilewidget2.h | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 5d282fd95..157ab9fcd 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -1436,8 +1436,10 @@ void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event) // create menu to show when right clicking on dive computer name if (dc_number > 0) m.addAction(tr("Make first dive computer"), this, SLOT(makeFirstDC())); - if (count_divecomputers() > 1) + if (count_divecomputers() > 1) { m.addAction(tr("Delete this dive computer"), this, SLOT(deleteCurrentDC())); + m.addAction(tr("Split this dive computer into own dive"), this, SLOT(splitCurrentDC())); + } m.exec(event->globalPos()); // don't show the regular profile context menu return; @@ -1581,6 +1583,11 @@ void ProfileWidget2::deleteCurrentDC() emit refreshDisplay(true); } +void ProfileWidget2::splitCurrentDC() +{ + Command::splitDiveComputer(current_dive, dc_number); +} + void ProfileWidget2::makeFirstDC() { make_first_dc(); diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h index 443b83c64..4cf69efa6 100644 --- a/profile-widget/profilewidget2.h +++ b/profile-widget/profilewidget2.h @@ -126,6 +126,7 @@ slots: // Necessary to call from QAction's signals. void editName(); void makeFirstDC(); void deleteCurrentDC(); + void splitCurrentDC(); void pointInserted(const QModelIndex &parent, int start, int end); void pointsRemoved(const QModelIndex &, int start, int end); void updateThumbnail(QString filename, QImage thumbnail, duration_t duration); |