mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
selection: move current dc logic to profile widget
The current dc global makes no sense on mobile. Therefore, move the logic of the currently displayed dive computer to the profile widget and remove the dc_number global variable. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
19baae449d
commit
cad80e5a53
10 changed files with 92 additions and 66 deletions
|
@ -10,20 +10,9 @@
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
|
||||||
struct dive *current_dive = NULL;
|
struct dive *current_dive = NULL;
|
||||||
unsigned int dc_number = 0;
|
|
||||||
int amount_selected;
|
int amount_selected;
|
||||||
static int amount_trips_selected;
|
static int amount_trips_selected;
|
||||||
|
|
||||||
static void fixup_current_dc()
|
|
||||||
{
|
|
||||||
// Every dive is guaranteed to have a dc
|
|
||||||
if (!current_dive || dc_number == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Note that number_of_computers returns at least 1, so subtraction is valid.
|
|
||||||
dc_number = std::min(dc_number, number_of_computers(current_dive) - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" struct dive *first_selected_dive()
|
extern "C" struct dive *first_selected_dive()
|
||||||
{
|
{
|
||||||
int idx;
|
int idx;
|
||||||
|
@ -139,7 +128,7 @@ static void setClosestCurrentDive(timestamp_t when, const std::vector<dive *> &s
|
||||||
// Set the current dive to "currentDive". "currentDive" must be an element of "selection" (or
|
// Set the current dive to "currentDive". "currentDive" must be an element of "selection" (or
|
||||||
// null if "selection" is empty).
|
// null if "selection" is empty).
|
||||||
// Does not send signals or clear the trip selection.
|
// Does not send signals or clear the trip selection.
|
||||||
QVector<dive *> setSelectionCore(const std::vector<dive *> &selection, dive *currentDive, int currentDc)
|
QVector<dive *> setSelectionCore(const std::vector<dive *> &selection, dive *currentDive)
|
||||||
{
|
{
|
||||||
// To do so, generate vectors of dives to be selected and deselected.
|
// To do so, generate vectors of dives to be selected and deselected.
|
||||||
// We send signals batched by trip, so keep track of trip/dive pairs.
|
// We send signals batched by trip, so keep track of trip/dive pairs.
|
||||||
|
@ -177,9 +166,6 @@ QVector<dive *> setSelectionCore(const std::vector<dive *> &selection, dive *cur
|
||||||
setClosestCurrentDive(currentDive->when, selection, divesToSelect);
|
setClosestCurrentDive(currentDive->when, selection, divesToSelect);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentDc >= 0)
|
|
||||||
dc_number = currentDc;
|
|
||||||
fixup_current_dc();
|
|
||||||
return divesToSelect;
|
return divesToSelect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +185,7 @@ void setSelection(const std::vector<dive *> &selection, dive *currentDive, int c
|
||||||
// Since we select only dives, there are no selected trips!
|
// Since we select only dives, there are no selected trips!
|
||||||
clear_trip_selection();
|
clear_trip_selection();
|
||||||
|
|
||||||
auto selectedDives = setSelectionCore(selection, currentDive, currentDc);
|
auto selectedDives = setSelectionCore(selection, currentDive);
|
||||||
|
|
||||||
// Send the new selection to the UI.
|
// Send the new selection to the UI.
|
||||||
emit diveListNotifier.divesSelected(selectedDives, current_dive, currentDc);
|
emit diveListNotifier.divesSelected(selectedDives, current_dive, currentDc);
|
||||||
|
@ -219,7 +205,7 @@ bool setSelectionKeepCurrent(const std::vector<dive *> &selection)
|
||||||
dive *newCurrent = current_dive;
|
dive *newCurrent = current_dive;
|
||||||
if (current_dive && std::find(selection.begin(), selection.end(), current_dive) == selection.end())
|
if (current_dive && std::find(selection.begin(), selection.end(), current_dive) == selection.end())
|
||||||
newCurrent = closestInSelection(current_dive->when, selection);
|
newCurrent = closestInSelection(current_dive->when, selection);
|
||||||
setSelectionCore(selection, newCurrent, -1);
|
setSelectionCore(selection, newCurrent);
|
||||||
|
|
||||||
return current_dive != oldCurrent;
|
return current_dive != oldCurrent;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
struct dive;
|
struct dive;
|
||||||
|
|
||||||
extern int amount_selected;
|
extern int amount_selected;
|
||||||
extern unsigned int dc_number;
|
|
||||||
extern struct dive *current_dive;
|
extern struct dive *current_dive;
|
||||||
|
|
||||||
/*** C and C++ functions ***/
|
/*** C and C++ functions ***/
|
||||||
|
@ -45,7 +44,7 @@ extern void dump_selection(void);
|
||||||
// "currentDive" must be an element of "selection" (or null if "seletion" is empty).
|
// "currentDive" must be an element of "selection" (or null if "seletion" is empty).
|
||||||
// If "currentDc" is negative, an attempt will be made to keep the current computer number.
|
// If "currentDc" is negative, an attempt will be made to keep the current computer number.
|
||||||
// Returns the list of selected dives
|
// Returns the list of selected dives
|
||||||
QVector<dive *> setSelectionCore(const std::vector<dive *> &selection, dive *currentDive, int currentDc);
|
QVector<dive *> setSelectionCore(const std::vector<dive *> &selection, dive *currentDive);
|
||||||
|
|
||||||
// As above, but sends a signal to inform the frontend of the changed selection.
|
// As above, but sends a signal to inform the frontend of the changed selection.
|
||||||
// Returns true if the current dive changed.
|
// Returns true if the current dive changed.
|
||||||
|
|
|
@ -527,7 +527,7 @@ void DiveListView::selectionChanged(const QItemSelection &selected, const QItemS
|
||||||
std::vector<dive *> selection = getDiveSelection();
|
std::vector<dive *> selection = getDiveSelection();
|
||||||
updateSelection(selection, addToSelection, removeFromSelection);
|
updateSelection(selection, addToSelection, removeFromSelection);
|
||||||
dive *newCurrent = selection.empty() ? nullptr : selection.front();
|
dive *newCurrent = selection.empty() ? nullptr : selection.front();
|
||||||
setSelectionCore(selection, newCurrent, -1);
|
setSelectionCore(selection, newCurrent);
|
||||||
|
|
||||||
// Display the new, processed, selection
|
// Display the new, processed, selection
|
||||||
QTreeView::selectionChanged(selectionModel()->selection(), newDeselected);
|
QTreeView::selectionChanged(selectionModel()->selection(), newDeselected);
|
||||||
|
|
|
@ -548,7 +548,6 @@ PlannerWidgets::PlannerWidgets()
|
||||||
void PlannerWidgets::planDive(dive *currentDive)
|
void PlannerWidgets::planDive(dive *currentDive)
|
||||||
{
|
{
|
||||||
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
|
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
|
||||||
dc_number = 0;
|
|
||||||
|
|
||||||
// create a simple starting dive, using the first gas from the just copied cylinders
|
// create a simple starting dive, using the first gas from the just copied cylinders
|
||||||
DivePlannerPointsModel::instance()->createSimpleDive(&displayed_dive);
|
DivePlannerPointsModel::instance()->createSimpleDive(&displayed_dive);
|
||||||
|
|
|
@ -300,14 +300,6 @@ void MainWindow::enableDisableCloudActions()
|
||||||
ui.actionCloudstoragesave->setEnabled(prefs.cloud_verification_status == qPrefCloudStorage::CS_VERIFIED);
|
ui.actionCloudstoragesave->setEnabled(prefs.cloud_verification_status == qPrefCloudStorage::CS_VERIFIED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::enableDisableOtherDCsActions()
|
|
||||||
{
|
|
||||||
bool nr = number_of_computers(current_dive) > 1;
|
|
||||||
enableShortcuts();
|
|
||||||
ui.actionNextDC->setEnabled(nr);
|
|
||||||
ui.actionPreviousDC->setEnabled(nr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::setDefaultState()
|
void MainWindow::setDefaultState()
|
||||||
{
|
{
|
||||||
setApplicationState(ApplicationState::Default);
|
setApplicationState(ApplicationState::Default);
|
||||||
|
@ -333,10 +325,19 @@ void MainWindow::updateAutogroup()
|
||||||
|
|
||||||
void MainWindow::divesSelected(const std::vector<dive *> &selection, dive *currentDive, int currentDC)
|
void MainWindow::divesSelected(const std::vector<dive *> &selection, dive *currentDive, int currentDC)
|
||||||
{
|
{
|
||||||
mainTab->updateDiveInfo(selection, currentDive, currentDC);
|
// We call plotDive first, so that the profile can decide which
|
||||||
if (currentDive)
|
// dive computer to plot. The plotted dive computer is then
|
||||||
enableDisableOtherDCsActions();
|
// used for displaying data in the tab-widgets.
|
||||||
profile->plotCurrentDive();
|
profile->plotDive(currentDive, currentDC);
|
||||||
|
mainTab->updateDiveInfo(selection, profile->d, profile->dc);
|
||||||
|
|
||||||
|
// Activate cursor keys to switch through DCs if there are more than one DC.
|
||||||
|
if (currentDive) {
|
||||||
|
bool nr = number_of_computers(current_dive) > 1;
|
||||||
|
enableShortcuts();
|
||||||
|
ui.actionNextDC->setEnabled(nr);
|
||||||
|
ui.actionPreviousDC->setEnabled(nr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionNew_triggered()
|
void MainWindow::on_actionNew_triggered()
|
||||||
|
@ -665,8 +666,8 @@ void MainWindow::on_actionReplanDive_triggered()
|
||||||
|
|
||||||
disableShortcuts(true);
|
disableShortcuts(true);
|
||||||
copy_dive(current_dive, &displayed_dive); // Planning works on a copy of the dive (for now).
|
copy_dive(current_dive, &displayed_dive); // Planning works on a copy of the dive (for now).
|
||||||
profile->setPlanState(&displayed_dive, dc_number);
|
profile->setPlanState(&displayed_dive, profile->dc);
|
||||||
plannerWidgets->replanDive(dc_number);
|
plannerWidgets->replanDive(profile->dc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionDivePlanner_triggered()
|
void MainWindow::on_actionDivePlanner_triggered()
|
||||||
|
@ -825,20 +826,16 @@ void MainWindow::restoreSplitterSizes()
|
||||||
|
|
||||||
void MainWindow::on_actionPreviousDC_triggered()
|
void MainWindow::on_actionPreviousDC_triggered()
|
||||||
{
|
{
|
||||||
unsigned nrdc = number_of_computers(current_dive);
|
profile->prevDC();
|
||||||
dc_number = (dc_number + nrdc - 1) % nrdc;
|
|
||||||
profile->plotCurrentDive();
|
|
||||||
// TODO: remove
|
// TODO: remove
|
||||||
mainTab->updateDiveInfo(getDiveSelection(), current_dive, dc_number);
|
mainTab->updateDiveInfo(getDiveSelection(), profile->d, profile->dc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionNextDC_triggered()
|
void MainWindow::on_actionNextDC_triggered()
|
||||||
{
|
{
|
||||||
unsigned nrdc = number_of_computers(current_dive);
|
profile->nextDC();
|
||||||
dc_number = (dc_number + 1) % nrdc;
|
|
||||||
profile->plotCurrentDive();
|
|
||||||
// TODO: remove
|
// TODO: remove
|
||||||
mainTab->updateDiveInfo(getDiveSelection(), current_dive, dc_number);
|
mainTab->updateDiveInfo(getDiveSelection(), profile->d, profile->dc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionFullScreen_triggered(bool checked)
|
void MainWindow::on_actionFullScreen_triggered(bool checked)
|
||||||
|
|
|
@ -75,7 +75,6 @@ public:
|
||||||
void enterPreviousState();
|
void enterPreviousState();
|
||||||
NotificationWidget *getNotificationWidget();
|
NotificationWidget *getNotificationWidget();
|
||||||
void enableDisableCloudActions();
|
void enableDisableCloudActions();
|
||||||
void enableDisableOtherDCsActions();
|
|
||||||
void editDiveSite(dive_site *ds);
|
void editDiveSite(dive_site *ds);
|
||||||
void setEnabledToolbar(bool arg1);
|
void setEnabledToolbar(bool arg1);
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ void EmptyView::resizeEvent(QResizeEvent *)
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfileWidget::ProfileWidget() : originalDive(nullptr), placingCommand(false)
|
ProfileWidget::ProfileWidget() : d(nullptr), dc(0), originalDive(nullptr), placingCommand(false)
|
||||||
{
|
{
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
|
||||||
|
@ -183,34 +183,72 @@ void ProfileWidget::setDive(const struct dive *d)
|
||||||
|
|
||||||
void ProfileWidget::plotCurrentDive()
|
void ProfileWidget::plotCurrentDive()
|
||||||
{
|
{
|
||||||
|
plotDive(d, dc);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProfileWidget::plotDive(dive *dIn, int dcIn)
|
||||||
|
{
|
||||||
|
d = dIn;
|
||||||
|
|
||||||
|
if (dcIn >= 0)
|
||||||
|
dc = dcIn;
|
||||||
|
|
||||||
|
// The following is valid because number_of_computers is always at least 1.
|
||||||
|
if (d)
|
||||||
|
dc = std::min(dc, (int)number_of_computers(current_dive) - 1);
|
||||||
|
|
||||||
// Exit edit mode if the dive changed
|
// Exit edit mode if the dive changed
|
||||||
if (editedDive && (originalDive != current_dive || editedDc != dc_number))
|
if (editedDive && (originalDive != d || editedDc != dc))
|
||||||
exitEditMode();
|
exitEditMode();
|
||||||
|
|
||||||
// If this is a manually added dive and we are not in the planner
|
// If this is a manually added dive and we are not in the planner
|
||||||
// or already editing the dive, switch to edit mode.
|
// or already editing the dive, switch to edit mode.
|
||||||
if (current_dive && !editedDive &&
|
if (d && !editedDive &&
|
||||||
DivePlannerPointsModel::instance()->currentMode() == DivePlannerPointsModel::NOTHING) {
|
DivePlannerPointsModel::instance()->currentMode() == DivePlannerPointsModel::NOTHING) {
|
||||||
struct divecomputer *dc = get_dive_dc(current_dive, dc_number);
|
struct divecomputer *comp = get_dive_dc(d, dc);
|
||||||
if (dc && is_manually_added_dc(dc) && dc->samples)
|
if (comp && is_manually_added_dc(comp) && comp->samples)
|
||||||
editDive();
|
editDive();
|
||||||
}
|
}
|
||||||
|
|
||||||
setEnabledToolbar(current_dive != nullptr);
|
setEnabledToolbar(d != nullptr);
|
||||||
if (editedDive) {
|
if (editedDive) {
|
||||||
view->plotDive(editedDive.get(), editedDc);
|
view->plotDive(editedDive.get(), editedDc);
|
||||||
setDive(editedDive.get());
|
setDive(editedDive.get());
|
||||||
} else if (current_dive) {
|
} else if (d) {
|
||||||
view->setProfileState(current_dive, dc_number);
|
view->setProfileState(d, dc);
|
||||||
view->resetZoom(); // when switching dive, reset the zoomLevel
|
view->resetZoom(); // when switching dive, reset the zoomLevel
|
||||||
view->plotDive(current_dive, dc_number);
|
view->plotDive(d, dc);
|
||||||
setDive(current_dive);
|
setDive(d);
|
||||||
} else {
|
} else {
|
||||||
view->clear();
|
view->clear();
|
||||||
stack->setCurrentIndex(0);
|
stack->setCurrentIndex(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProfileWidget::nextDC()
|
||||||
|
{
|
||||||
|
rotateDC(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProfileWidget::prevDC()
|
||||||
|
{
|
||||||
|
rotateDC(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProfileWidget::rotateDC(int dir)
|
||||||
|
{
|
||||||
|
if (!d)
|
||||||
|
return;
|
||||||
|
int numDC = number_of_computers(d);
|
||||||
|
int newDC = (dc + dir) % numDC;
|
||||||
|
if (newDC < 0)
|
||||||
|
newDC += numDC;
|
||||||
|
if (newDC == dc)
|
||||||
|
return;
|
||||||
|
|
||||||
|
plotDive(d, newDC);
|
||||||
|
}
|
||||||
|
|
||||||
void ProfileWidget::divesChanged(const QVector<dive *> &dives, DiveField field)
|
void ProfileWidget::divesChanged(const QVector<dive *> &dives, DiveField field)
|
||||||
{
|
{
|
||||||
// If the current dive is not in list of changed dives, do nothing.
|
// If the current dive is not in list of changed dives, do nothing.
|
||||||
|
@ -218,13 +256,13 @@ void ProfileWidget::divesChanged(const QVector<dive *> &dives, DiveField field)
|
||||||
// Also, if we are currently placing a command, don't do anything.
|
// Also, if we are currently placing a command, don't do anything.
|
||||||
// Note that we cannot use Command::placingCommand(), because placing
|
// Note that we cannot use Command::placingCommand(), because placing
|
||||||
// a depth or time change on the maintab requires an update.
|
// a depth or time change on the maintab requires an update.
|
||||||
if (!current_dive || !dives.contains(current_dive) || !(field.duration || field.depth) || placingCommand)
|
if (!d || !dives.contains(d) || !(field.duration || field.depth) || placingCommand)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// If were editing the current dive and not currently
|
// If were editing the current dive and not currently
|
||||||
// placing command, we have to update the edited dive.
|
// placing command, we have to update the edited dive.
|
||||||
if (editedDive) {
|
if (editedDive) {
|
||||||
copy_dive(current_dive, editedDive.get());
|
copy_dive(d, editedDive.get());
|
||||||
// TODO: Holy moly that function sends too many signals. Fix it!
|
// TODO: Holy moly that function sends too many signals. Fix it!
|
||||||
DivePlannerPointsModel::instance()->loadFromDive(editedDive.get(), editedDc);
|
DivePlannerPointsModel::instance()->loadFromDive(editedDive.get(), editedDc);
|
||||||
}
|
}
|
||||||
|
@ -254,9 +292,9 @@ void ProfileWidget::unsetProfTissues()
|
||||||
void ProfileWidget::editDive()
|
void ProfileWidget::editDive()
|
||||||
{
|
{
|
||||||
editedDive.reset(alloc_dive());
|
editedDive.reset(alloc_dive());
|
||||||
editedDc = dc_number;
|
editedDc = dc;
|
||||||
copy_dive(current_dive, editedDive.get()); // Work on a copy of the dive
|
copy_dive(d, editedDive.get()); // Work on a copy of the dive
|
||||||
originalDive = current_dive;
|
originalDive = d;
|
||||||
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD);
|
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD);
|
||||||
DivePlannerPointsModel::instance()->loadFromDive(editedDive.get(), editedDc);
|
DivePlannerPointsModel::instance()->loadFromDive(editedDive.get(), editedDc);
|
||||||
view->setEditState(editedDive.get(), editedDc);
|
view->setEditState(editedDive.get(), editedDc);
|
||||||
|
@ -267,7 +305,7 @@ void ProfileWidget::exitEditMode()
|
||||||
if (!editedDive)
|
if (!editedDive)
|
||||||
return;
|
return;
|
||||||
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::NOTHING);
|
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::NOTHING);
|
||||||
view->setProfileState(current_dive, dc_number); // switch back to original dive before erasing the copy.
|
view->setProfileState(d, dc); // switch back to original dive before erasing the copy.
|
||||||
editedDive.reset();
|
editedDive.reset();
|
||||||
originalDive = nullptr;
|
originalDive = nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,9 +23,14 @@ public:
|
||||||
ProfileWidget();
|
ProfileWidget();
|
||||||
~ProfileWidget();
|
~ProfileWidget();
|
||||||
std::unique_ptr<ProfileWidget2> view;
|
std::unique_ptr<ProfileWidget2> view;
|
||||||
|
void plotDive(struct dive *d, int dc); // Attempt to keep DC number id dc < 0
|
||||||
void plotCurrentDive();
|
void plotCurrentDive();
|
||||||
void setPlanState(const struct dive *d, int dc);
|
void setPlanState(const struct dive *d, int dc);
|
||||||
void setEnabledToolbar(bool enabled);
|
void setEnabledToolbar(bool enabled);
|
||||||
|
void nextDC();
|
||||||
|
void prevDC();
|
||||||
|
dive *d;
|
||||||
|
int dc;
|
||||||
private
|
private
|
||||||
slots:
|
slots:
|
||||||
void divesChanged(const QVector<dive *> &dives, DiveField field);
|
void divesChanged(const QVector<dive *> &dives, DiveField field);
|
||||||
|
@ -47,8 +52,9 @@ private:
|
||||||
void setDive(const struct dive *d);
|
void setDive(const struct dive *d);
|
||||||
void editDive();
|
void editDive();
|
||||||
void exitEditMode();
|
void exitEditMode();
|
||||||
|
void rotateDC(int dir);
|
||||||
std::unique_ptr<dive, DiveDeleter> editedDive;
|
std::unique_ptr<dive, DiveDeleter> editedDive;
|
||||||
unsigned int editedDc;
|
int editedDc;
|
||||||
dive *originalDive;
|
dive *originalDive;
|
||||||
bool placingCommand;
|
bool placingCommand;
|
||||||
};
|
};
|
||||||
|
|
|
@ -79,12 +79,14 @@ protected slots:
|
||||||
signals:
|
signals:
|
||||||
// The propagation of selection changes is complex.
|
// The propagation of selection changes is complex.
|
||||||
// The control flow of programmatical dive-selection goes:
|
// The control flow of programmatical dive-selection goes:
|
||||||
// Commands/DiveListNotifier ---(dive */dive_trip *)---> DiveTripModel ---(QModelIndex)---> DiveListView
|
// Commands/DiveListNotifier ---(dive */dive_trip *)---> DiveTripModel
|
||||||
|
// ---(QModelIndex)---> MultiFilterSortModel
|
||||||
|
// ---(QModelIndex)---> DiveListView
|
||||||
// i.e. The command objects send changes in terms of pointer-to-dives, which the DiveTripModel transforms
|
// i.e. The command objects send changes in terms of pointer-to-dives, which the DiveTripModel transforms
|
||||||
// into QModelIndexes according to the current view (tree/list). Finally, the DiveListView transforms these
|
// into QModelIndexes according to the current view (tree/list). These are modified according to current
|
||||||
// indices into local indices according to current sorting/filtering and instructs the QSelectionModel to
|
// filtering/sorting. Finally, the DiveListView instructs the QSelectionModel to
|
||||||
// perform the appropriate actions.
|
// perform the appropriate actions.
|
||||||
void divesSelected(const QVector<QModelIndex> &indices, QModelIndex currentDive, int currentDC);
|
void divesSelected(const QVector<QModelIndex> &indices, QModelIndex currentDive, int currentDC); // currentDC < 0 -> keep DC.
|
||||||
void tripSelected(QModelIndex trip, QModelIndex currentDive);
|
void tripSelected(QModelIndex trip, QModelIndex currentDive);
|
||||||
protected:
|
protected:
|
||||||
dive *oldCurrent;
|
dive *oldCurrent;
|
||||||
|
|
|
@ -18,7 +18,7 @@ public:
|
||||||
|
|
||||||
void resetModel(DiveTripModelBase::Layout layout);
|
void resetModel(DiveTripModelBase::Layout layout);
|
||||||
signals:
|
signals:
|
||||||
void divesSelected(const QVector<QModelIndex> &indices, QModelIndex currentDive, int currentDC);
|
void divesSelected(const QVector<QModelIndex> &indices, QModelIndex currentDive, int currentDC); // currentDC < 0 -> keep DC.
|
||||||
void tripSelected(QModelIndex trip, QModelIndex currentDive);
|
void tripSelected(QModelIndex trip, QModelIndex currentDive);
|
||||||
private slots:
|
private slots:
|
||||||
void divesSelectedSlot(const QVector<QModelIndex> &indices, QModelIndex currentDive, int currentDC);
|
void divesSelectedSlot(const QVector<QModelIndex> &indices, QModelIndex currentDive, int currentDC);
|
||||||
|
|
Loading…
Add table
Reference in a new issue