Cleanup: rename MainWindow member variables

Instead of the weirdly named "information" and the inconsistent
"dive_list" use the logical "mainTab" and the camel-cased
"diveList", respectively.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-10-12 16:13:42 +02:00 committed by Dirk Hohndel
parent 78e2560296
commit 068b01aef2
10 changed files with 89 additions and 89 deletions

View file

@ -527,7 +527,7 @@ void DownloadFromDCWidget::on_ok_clicked()
delete_dive_from_table(&downloadTable, j);
}
MainWindow::instance()->dive_list->unselectDives();
MainWindow::instance()->diveList->unselectDives();
if (downloadTable.nr > 0) {
// remember the last downloaded dive (on most dive computers this will be the chronologically
@ -542,8 +542,8 @@ void DownloadFromDCWidget::on_ok_clicked()
int idx = get_idx_by_uniq_id(uniqId);
// this shouldn't be necessary - but there are reports that somehow existing dives stay selected
// (but not visible as selected)
MainWindow::instance()->dive_list->unselectDives();
MainWindow::instance()->dive_list->selectDive(idx, true);
MainWindow::instance()->diveList->unselectDives();
MainWindow::instance()->diveList->selectDive(idx, true);
}
if (ostcFirmwareCheck && currentState == DONE) {

View file

@ -255,7 +255,7 @@ void LocationInformationWidget::resetState()
{
modified = false;
resetPallete();
MainWindow::instance()->dive_list->setEnabled(true);
MainWindow::instance()->diveList->setEnabled(true);
MainWindow::instance()->setEnabledToolbar(true);
ui.diveSiteMessage->setText(tr("Dive site management"));
MapWidget::instance()->endGetDiveCoordinates();
@ -267,7 +267,7 @@ void LocationInformationWidget::resetState()
void LocationInformationWidget::enableEdition()
{
MainWindow::instance()->dive_list->setEnabled(false);
MainWindow::instance()->diveList->setEnabled(false);
MainWindow::instance()->setEnabledToolbar(false);
ui.diveSiteMessage->setText(tr("You are editing a dive site"));
}

View file

@ -137,8 +137,8 @@ MainWindow::MainWindow() : QMainWindow(),
// widgets will change on the mainwindow.
// for the "default" mode
information = new MainTab(this);
dive_list = new DiveListView(this);
mainTab = new MainTab(this);
diveList = new DiveListView(this);
graphics = new ProfileWidget2(this);
MapWidget *mapWidget = MapWidget::instance();
@ -178,7 +178,7 @@ MainWindow::MainWindow() : QMainWindow(),
this, &MainWindow::setDefaultState);
connect(diveSiteEdit, SIGNAL(endEditDiveSite()), this, SLOT(refreshDisplay()));
connect(diveSiteEdit, &LocationInformationWidget::endEditDiveSite,
information, &MainTab::refreshDisplayedDiveSite);
mainTab, &MainTab::refreshDisplayedDiveSite);
std::pair<QByteArray, QVariant> enabled = std::make_pair("enabled", QVariant(true));
std::pair<QByteArray, QVariant> disabled = std::make_pair("enabled", QVariant(false));
@ -187,12 +187,12 @@ MainWindow::MainWindow() : QMainWindow(),
enabledList.push_back(enabled);
disabledList.push_back(disabled);
registerApplicationState("Default", information, profileContainer, dive_list, mapWidget );
registerApplicationState("AddDive", information, profileContainer, dive_list, mapWidget );
registerApplicationState("EditDive", information, profileContainer, dive_list, mapWidget );
registerApplicationState("Default", mainTab, profileContainer, diveList, mapWidget );
registerApplicationState("AddDive", mainTab, profileContainer, diveList, mapWidget );
registerApplicationState("EditDive", mainTab, profileContainer, diveList, mapWidget );
registerApplicationState("PlanDive", divePlannerWidget, profileContainer, divePlannerSettingsWidget, plannerDetails );
registerApplicationState("EditPlannedDive", divePlannerWidget, profileContainer, dive_list, mapWidget );
registerApplicationState("EditDiveSite", diveSiteEdit, profileContainer, dive_list, mapWidget);
registerApplicationState("EditPlannedDive", divePlannerWidget, profileContainer, diveList, mapWidget );
registerApplicationState("EditDiveSite", diveSiteEdit, profileContainer, diveList, mapWidget);
setStateProperties("Default", enabledList, enabledList, enabledList,enabledList);
setStateProperties("AddDive", enabledList, enabledList, enabledList,enabledList);
@ -211,9 +211,9 @@ MainWindow::MainWindow() : QMainWindow(),
}
connect(&diveListNotifier, &DiveListNotifier::selectionChanged, this, &MainWindow::selectionChanged);
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(readSettings()));
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), dive_list, SLOT(update()));
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), dive_list, SLOT(reloadHeaderActions()));
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), information, SLOT(updateDiveInfo()));
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), diveList, SLOT(update()));
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), diveList, SLOT(reloadHeaderActions()));
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), mainTab, SLOT(updateDiveInfo()));
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), divePlannerWidget, SLOT(settingsChanged()));
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), divePlannerSettingsWidget, SLOT(settingsChanged()));
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), TankInfoModel::instance(), SLOT(update()));
@ -224,14 +224,14 @@ MainWindow::MainWindow() : QMainWindow(),
connect(actionsRecent[i], SIGNAL(triggered(bool)), this, SLOT(recentFileTriggered(bool)));
}
ui.menuFile->insertSeparator(ui.actionQuit);
connect(information, SIGNAL(addDiveFinished()), graphics, SLOT(setProfileState()));
connect(information, SIGNAL(dateTimeChanged()), graphics, SLOT(dateTimeChanged()));
connect(mainTab, SIGNAL(addDiveFinished()), graphics, SLOT(setProfileState()));
connect(mainTab, SIGNAL(dateTimeChanged()), graphics, SLOT(dateTimeChanged()));
connect(DivePlannerPointsModel::instance(), SIGNAL(planCreated()), this, SLOT(planCreated()));
connect(DivePlannerPointsModel::instance(), SIGNAL(planCanceled()), this, SLOT(planCanceled()));
connect(DivePlannerPointsModel::instance(), SIGNAL(variationsComputed(QString)), this, SLOT(updateVariations(QString)));
connect(plannerDetails->printPlan(), SIGNAL(pressed()), divePlannerWidget, SLOT(printDecoPlan()));
connect(this, SIGNAL(startDiveSiteEdit()), this, SLOT(on_actionDiveSiteEdit_triggered()));
connect(information, &MainTab::diveSiteChanged, mapWidget, &MapWidget::centerOnSelectedDiveSite);
connect(mainTab, &MainTab::diveSiteChanged, mapWidget, &MapWidget::centerOnSelectedDiveSite);
connect(this, &MainWindow::showError, ui.mainErrorMessage, &NotificationWidget::showError, Qt::AutoConnection);
connect(&windowTitleUpdate, &WindowTitleUpdate::updateTitle, this, &MainWindow::setAutomaticTitle);
@ -245,12 +245,12 @@ MainWindow::MainWindow() : QMainWindow(),
graphics->setEmptyState();
initialUiSetup();
readSettings();
dive_list->reload(DiveTripModel::TREE);
dive_list->reloadHeaderActions();
dive_list->setFocus();
diveList->reload(DiveTripModel::TREE);
diveList->reloadHeaderActions();
diveList->setFocus();
MapWidget::instance()->reload();
dive_list->expand(dive_list->model()->index(0, 0));
dive_list->scrollTo(dive_list->model()->index(0, 0), QAbstractItemView::PositionAtCenter);
diveList->expand(diveList->model()->index(0, 0));
diveList->scrollTo(diveList->model()->index(0, 0), QAbstractItemView::PositionAtCenter);
divePlannerWidget->settingsChanged();
divePlannerSettingsWidget->settingsChanged();
#ifdef NO_USERMANUAL
@ -342,7 +342,7 @@ MainWindow::MainWindow() : QMainWindow(),
connect(graphics, &ProfileWidget2::enableShortcuts, this, &MainWindow::enableShortcuts);
connect(graphics, &ProfileWidget2::refreshDisplay, this, &MainWindow::refreshDisplay);
connect(graphics, &ProfileWidget2::editCurrentDive, this, &MainWindow::editCurrentDive);
connect(graphics, &ProfileWidget2::updateDiveInfo, information, &MainTab::updateDiveInfo);
connect(graphics, &ProfileWidget2::updateDiveInfo, mainTab, &MainTab::updateDiveInfo);
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), graphics, SLOT(settingsChanged()));
@ -459,7 +459,7 @@ void MainWindow::enableDisableCloudActions()
void MainWindow::setDefaultState() {
setApplicationState("Default");
if (information->getEditMode() != MainTab::NONE) {
if (mainTab->getEditMode() != MainTab::NONE) {
ui.bottomLeft->currentWidget()->setEnabled(false);
}
}
@ -472,22 +472,22 @@ MainWindow *MainWindow::instance()
// This gets called after one or more dives were added, edited or downloaded for a dive computer
void MainWindow::refreshDisplay(bool doRecreateDiveList)
{
information->reload();
mainTab->reload();
TankInfoModel::instance()->update();
MapWidget::instance()->reload();
if (doRecreateDiveList)
recreateDiveList();
setApplicationState("Default");
dive_list->setEnabled(true);
dive_list->setFocus();
diveList->setEnabled(true);
diveList->setFocus();
WSInfoModel::instance()->updateInfo();
ui.actionAutoGroup->setChecked(autogroup);
}
void MainWindow::recreateDiveList()
{
dive_list->reload(DiveTripModel::CURRENT);
diveList->reload(DiveTripModel::CURRENT);
TagFilterModel::instance()->repopulate();
BuddyFilterModel::instance()->repopulate();
LocationFilterModel::instance()->repopulate();
@ -523,12 +523,12 @@ void MainWindow::configureToolbar() {
void MainWindow::selectionChanged()
{
if (!current_dive) {
information->clearTabs();
information->updateDiveInfo(true);
mainTab->clearTabs();
mainTab->updateDiveInfo(true);
graphics->setEmptyState();
} else {
graphics->plotDive(nullptr, false, true);
information->updateDiveInfo();
mainTab->updateDiveInfo();
configureToolbar();
MapWidget::instance()->reload();
}
@ -639,8 +639,8 @@ void MainWindow::on_actionCloudstoragesave_triggered()
if (verbose)
qDebug() << "Saving cloud storage to:" << filename;
if (information->isEditing())
information->acceptChanges();
if (mainTab->isEditing())
mainTab->acceptChanges();
showProgressBar();
int error = save_dives(qPrintable(filename));
@ -661,7 +661,7 @@ void MainWindow::on_actionCloudOnline_triggered()
// Refuse to go online if there is an edit in progress
if (!isOffline &&
(DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING ||
information->isEditing())) {
mainTab->isEditing())) {
QMessageBox::warning(this, tr("Warning"), tr("Please save or cancel the current dive edit before going online"));
// We didn't switch to online, therefore uncheck the checkbox
ui.actionCloudOnline->setChecked(false);
@ -694,10 +694,10 @@ void MainWindow::on_actionCloudOnline_triggered()
void MainWindow::cleanUpEmpty()
{
information->clearTabs();
information->updateDiveInfo(true);
mainTab->clearTabs();
mainTab->updateDiveInfo(true);
graphics->setEmptyState();
dive_list->reload(DiveTripModel::TREE);
diveList->reload(DiveTripModel::TREE);
MapWidget::instance()->reload();
if (!existing_filename)
setTitle();
@ -707,7 +707,7 @@ void MainWindow::cleanUpEmpty()
bool MainWindow::okToClose(QString message)
{
if (DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING ||
information->isEditing() ) {
mainTab->isEditing() ) {
QMessageBox::warning(this, tr("Warning"), message);
return false;
}
@ -809,9 +809,9 @@ void MainWindow::on_actionPreferences_triggered()
void MainWindow::on_actionQuit_triggered()
{
if (information->isEditing()) {
information->rejectChanges();
if (information->isEditing())
if (mainTab->isEditing()) {
mainTab->rejectChanges();
if (mainTab->isEditing())
// didn't discard the edits
return;
}
@ -852,7 +852,7 @@ bool MainWindow::plannerStateClean()
return false;
if (DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING ||
information->isEditing()) {
mainTab->isEditing()) {
QMessageBox::warning(this, tr("Warning"), tr("Please save or cancel the current dive edit before trying to add a dive."));
return false;
}
@ -880,8 +880,8 @@ void MainWindow::planCreated()
// make sure our UI is in a consistent state
showProfile();
setApplicationState("Default");
dive_list->setEnabled(true);
dive_list->setFocus();
diveList->setEnabled(true);
diveList->setFocus();
}
void MainWindow::setPlanNotes()
@ -1014,9 +1014,9 @@ void MainWindow::on_actionAddDive_triggered()
if (!plannerStateClean())
return;
if (dive_list->selectedTrips().count() >= 1) {
dive_list->rememberSelection();
dive_list->clearSelection();
if (diveList->selectedTrips().count() >= 1) {
diveList->rememberSelection();
diveList->clearSelection();
}
setApplicationState("AddDive");
@ -1026,9 +1026,9 @@ void MainWindow::on_actionAddDive_triggered()
setupForAddAndPlan("manually added dive"); // don't translate, stored in the XML file
// now show the mostly empty main tab
information->updateDiveInfo();
mainTab->updateDiveInfo();
information->addDiveStarted();
mainTab->addDiveStarted();
graphics->setAddState();
DivePlannerPointsModel::instance()->createSimpleDive();
@ -1038,7 +1038,7 @@ void MainWindow::on_actionAddDive_triggered()
displayed_dive.duration = displayed_dive.dc.duration;
// now that we have the correct depth and duration, update the dive info
information->updateDepthDuration();
mainTab->updateDepthDuration();
}
void MainWindow::on_actionRenumber_triggered()
@ -1240,7 +1240,7 @@ void MainWindow::on_actionPreviousDC_triggered()
dc_number = (dc_number + nrdc - 1) % nrdc;
configureToolbar();
graphics->plotDive(nullptr, false, true);
information->updateDiveInfo();
mainTab->updateDiveInfo();
}
void MainWindow::on_actionNextDC_triggered()
@ -1249,7 +1249,7 @@ void MainWindow::on_actionNextDC_triggered()
dc_number = (dc_number + 1) % nrdc;
configureToolbar();
graphics->plotDive(nullptr, false, true);
information->updateDiveInfo();
mainTab->updateDiveInfo();
}
void MainWindow::on_actionFullScreen_triggered(bool checked)
@ -1480,7 +1480,7 @@ void MainWindow::writeSettings()
void MainWindow::closeEvent(QCloseEvent *event)
{
if (DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING ||
information->isEditing()) {
mainTab->isEditing()) {
on_actionQuit_triggered();
event->ignore();
return;
@ -1613,8 +1613,8 @@ int MainWindow::file_save_as(void)
if (filename.isNull() || filename.isEmpty())
return report_error("No filename to save into");
if (information->isEditing())
information->acceptChanges();
if (mainTab->isEditing())
mainTab->acceptChanges();
if (save_dives(qPrintable(filename)))
return -1;
@ -1637,8 +1637,8 @@ int MainWindow::file_save(void)
if (is_cloud && !saveToCloudOK())
return -1;
if (information->isEditing())
information->acceptChanges();
if (mainTab->isEditing())
mainTab->acceptChanges();
current_default = prefs.default_filename;
if (strcmp(existing_filename, current_default) == 0) {
@ -1801,7 +1801,7 @@ void MainWindow::editCurrentDive()
if (!current_dive)
return;
if (information->isEditing() || DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING) {
if (mainTab->isEditing() || DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING) {
QMessageBox::warning(this, tr("Warning"), tr("Please, first finish the current edition before trying to do another."));
return;
}
@ -1815,15 +1815,15 @@ void MainWindow::editCurrentDive()
graphics->setAddState();
setApplicationState("EditDive");
DivePlannerPointsModel::instance()->loadFromDive(d);
information->enableEdition(MainTab::MANUALLY_ADDED_DIVE);
mainTab->enableEdition(MainTab::MANUALLY_ADDED_DIVE);
} else if (defaultDC == "planned dive") {
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
setApplicationState("EditPlannedDive");
DivePlannerPointsModel::instance()->loadFromDive(d);
information->enableEdition(MainTab::MANUALLY_ADDED_DIVE);
mainTab->enableEdition(MainTab::MANUALLY_ADDED_DIVE);
} else {
setApplicationState("EditDive");
information->enableEdition();
mainTab->enableEdition();
}
}
@ -1865,7 +1865,7 @@ void MainWindow::on_paste_triggered()
{
// take the data in our copyPasteDive and apply it to selected dives
selective_copy_dive(&copyPasteDive, &displayed_dive, what, false);
information->showAndTriggerEditSelective(what);
mainTab->showAndTriggerEditSelective(what);
}
void MainWindow::on_actionFilterTags_triggered()

View file

@ -81,12 +81,12 @@ public:
void enterEditState();
void exitEditState();
MainTab *information;
MainTab *mainTab;
PlannerDetails *plannerDetails;
PlannerSettingsWidget *divePlannerSettingsWidget;
ProfileWidget2 *graphics;
DivePlannerWidget *divePlannerWidget;
DiveListView *dive_list;
DiveListView *diveList;
private
slots:
/* file menu action */

View file

@ -103,9 +103,9 @@ void MapWidget::selectedDivesChanged(QList<int> list)
{
CHECK_IS_READY_RETURN_VOID();
skipReload = true;
MainWindow::instance()->dive_list->unselectDives();
MainWindow::instance()->diveList->unselectDives();
if (!list.empty())
MainWindow::instance()->dive_list->selectDives(list);
MainWindow::instance()->diveList->selectDives(list);
skipReload = false;
}

View file

@ -159,7 +159,7 @@ void RenumberDialog::renumberOnlySelected(bool selected)
void RenumberDialog::buttonClicked(QAbstractButton *button)
{
if (ui.buttonBox->buttonRole(button) == QDialogButtonBox::AcceptRole) {
MainWindow::instance()->dive_list->rememberSelection();
MainWindow::instance()->diveList->rememberSelection();
// we remember a list from dive uuid to a new number
QVector<QPair<dive *, int>> renumberedDives;
int i;

View file

@ -109,12 +109,12 @@ void TabDivePhotos::recalculateSelectedThumbnails()
//TODO: This looks overly wrong. We shouldn't call MainWindow to retrieve the DiveList to add Images.
void TabDivePhotos::addPhotosFromFile()
{
MainWindow::instance()->dive_list->loadImages();
MainWindow::instance()->diveList->loadImages();
}
void TabDivePhotos::addPhotosFromURL()
{
MainWindow::instance()->dive_list->loadWebImages();
MainWindow::instance()->diveList->loadWebImages();
}
void TabDivePhotos::removeAllPhotos()

View file

@ -293,7 +293,7 @@ void MainTab::updateTextLabels(bool showUnits)
void MainTab::enableEdition(EditMode newEditMode)
{
const bool isTripEdit = MainWindow::instance() &&
MainWindow::instance()->dive_list->selectedTrips().count() == 1;
MainWindow::instance()->diveList->selectedTrips().count() == 1;
if (((newEditMode == DIVE || newEditMode == NONE) && current_dive == NULL) || editMode != NONE)
return;
@ -317,7 +317,7 @@ void MainTab::enableEdition(EditMode newEditMode)
}
ui.editDiveSiteButton->setEnabled(false);
MainWindow::instance()->dive_list->setEnabled(false);
MainWindow::instance()->diveList->setEnabled(false);
MainWindow::instance()->setEnabledToolbar(false);
MainWindow::instance()->enterEditState();
ui.tabWidget->setTabEnabled(2, false);
@ -430,7 +430,7 @@ void MainTab::updateDiveInfo(bool clear)
localTime.setTimeSpec(Qt::UTC);
ui.dateEdit->setDate(localTime.date());
ui.timeEdit->setTime(localTime.time());
if (MainWindow::instance() && MainWindow::instance()->dive_list->selectedTrips().count() == 1) {
if (MainWindow::instance() && MainWindow::instance()->diveList->selectedTrips().count() == 1) {
// Remember the tab selected for last dive
if (lastSelectedDive)
lastTabSelectedDive = ui.tabWidget->currentIndex();
@ -442,7 +442,7 @@ void MainTab::updateDiveInfo(bool clear)
if (lastSelectedDive)
ui.tabWidget->setCurrentIndex(lastTabSelectedDiveTrip);
lastSelectedDive = false;
currentTrip = *MainWindow::instance()->dive_list->selectedTrips().begin();
currentTrip = *MainWindow::instance()->diveList->selectedTrips().begin();
// only use trip relevant fields
ui.divemaster->setVisible(false);
ui.DivemasterLabel->setVisible(false);
@ -763,11 +763,11 @@ void MainTab::acceptChanges()
ui.editDiveSiteButton->setEnabled(!ui.location->text().isEmpty());
emit addDiveFinished();
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::NOTHING);
MainWindow::instance()->dive_list->setFocus();
MainWindow::instance()->diveList->setFocus();
resetPallete();
displayed_dive.divetrip = nullptr; // Should not be necessary, just in case!
return;
} else if (MainWindow::instance() && MainWindow::instance()->dive_list->selectedTrips().count() == 1) {
} else if (MainWindow::instance() && MainWindow::instance()->diveList->selectedTrips().count() == 1) {
/* now figure out if things have changed */
if (displayedTrip.notes && !same_string(displayedTrip.notes, currentTrip->notes)) {
currentTrip->notes = copy_string(displayedTrip.notes);
@ -932,13 +932,13 @@ void MainTab::acceptChanges()
mark_divelist_changed(true);
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::NOTHING);
}
int scrolledBy = MainWindow::instance()->dive_list->verticalScrollBar()->sliderPosition();
int scrolledBy = MainWindow::instance()->diveList->verticalScrollBar()->sliderPosition();
resetPallete();
if (editMode == MANUALLY_ADDED_DIVE) {
MainWindow::instance()->dive_list->reload(DiveTripModel::CURRENT, true);
MainWindow::instance()->diveList->reload(DiveTripModel::CURRENT, true);
int newDiveNr = get_divenr(get_dive_by_uniq_id(addedId));
MainWindow::instance()->dive_list->unselectDives();
MainWindow::instance()->dive_list->selectDive(newDiveNr, true);
MainWindow::instance()->diveList->unselectDives();
MainWindow::instance()->diveList->selectDive(newDiveNr, true);
editMode = NONE;
MainWindow::instance()->refreshDisplay();
MainWindow::instance()->graphics->replot();
@ -946,13 +946,13 @@ void MainTab::acceptChanges()
editMode = NONE;
if (do_replot)
MainWindow::instance()->graphics->replot();
MainWindow::instance()->dive_list->rememberSelection();
MainWindow::instance()->diveList->rememberSelection();
MainWindow::instance()->refreshDisplay();
MainWindow::instance()->dive_list->restoreSelection();
MainWindow::instance()->diveList->restoreSelection();
}
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::NOTHING);
MainWindow::instance()->dive_list->verticalScrollBar()->setSliderPosition(scrolledBy);
MainWindow::instance()->dive_list->setFocus();
MainWindow::instance()->diveList->verticalScrollBar()->setSliderPosition(scrolledBy);
MainWindow::instance()->diveList->setFocus();
MainWindow::instance()->exitEditState();
cylindersModel->changed = false;
weightModel->changed = false;
@ -1003,7 +1003,7 @@ void MainTab::rejectChanges()
// no harm done to call cancelPlan even if we were not in ADD or PLAN mode...
DivePlannerPointsModel::instance()->cancelPlan();
if(lastMode == ADD)
MainWindow::instance()->dive_list->restoreSelection();
MainWindow::instance()->diveList->restoreSelection();
// now make sure that the correct dive is displayed
if (current_dive)

View file

@ -92,7 +92,7 @@ void TagWidget::reparse()
* Do not show the completer when not in edit mode - basically
* this returns when we are accepting or discarding the changes.
*/
if (MainWindow::instance()->information->isEditing() == false) {
if (MainWindow::instance()->mainTab->isEditing() == false) {
return;
}
@ -186,7 +186,7 @@ void TagWidget::keyPressEvent(QKeyEvent *e)
}
}
if (e->key() == Qt::Key_Tab && lastFinishedTag) { // if we already end in comma, go to next/prev field
MainWindow::instance()->information->nextInputField(e); // by sending the key event to the MainTab widget
MainWindow::instance()->mainTab->nextInputField(e); // by sending the key event to the MainTab widget
} else if (e->key() == Qt::Key_Tab || e->key() == Qt::Key_Return) { // otherwise let's pretend this is a comma instead
QKeyEvent fakeEvent(e->type(), Qt::Key_Comma, e->modifiers(), QString(","));
keyPressEvent(&fakeEvent);

View file

@ -644,7 +644,7 @@ void MultiFilterSortModel::myInvalidate()
#if !defined(SUBSURFACE_MOBILE)
int i;
struct dive *d;
DiveListView *dlv = MainWindow::instance()->dive_list;
DiveListView *dlv = MainWindow::instance()->diveList;
divesDisplayed = 0;