mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
mapwidget: add an empty reload() method
Call same method in MainWindow if the NO_MARBLE macro is defined. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
86f4a26a83
commit
39af5bb05b
3 changed files with 22 additions and 0 deletions
|
@ -216,7 +216,11 @@ MainWindow::MainWindow() : QMainWindow(),
|
||||||
diveListView->reload(DiveTripModel::TREE);
|
diveListView->reload(DiveTripModel::TREE);
|
||||||
diveListView->reloadHeaderActions();
|
diveListView->reloadHeaderActions();
|
||||||
diveListView->setFocus();
|
diveListView->setFocus();
|
||||||
|
#ifndef NO_MARBLE
|
||||||
GlobeGPS::instance()->reload();
|
GlobeGPS::instance()->reload();
|
||||||
|
#else
|
||||||
|
MapWidget::instance()->reload();
|
||||||
|
#endif
|
||||||
diveListView->expand(dive_list()->model()->index(0, 0));
|
diveListView->expand(dive_list()->model()->index(0, 0));
|
||||||
diveListView->scrollTo(dive_list()->model()->index(0, 0), QAbstractItemView::PositionAtCenter);
|
diveListView->scrollTo(dive_list()->model()->index(0, 0), QAbstractItemView::PositionAtCenter);
|
||||||
divePlannerWidget()->settingsChanged();
|
divePlannerWidget()->settingsChanged();
|
||||||
|
@ -425,7 +429,11 @@ void MainWindow::refreshDisplay(bool doRecreateDiveList)
|
||||||
getNotificationWidget()->showNotification(get_error_string(), KMessageWidget::Error);
|
getNotificationWidget()->showNotification(get_error_string(), KMessageWidget::Error);
|
||||||
information()->reload();
|
information()->reload();
|
||||||
TankInfoModel::instance()->update();
|
TankInfoModel::instance()->update();
|
||||||
|
#ifndef NO_MARBLE
|
||||||
GlobeGPS::instance()->reload();
|
GlobeGPS::instance()->reload();
|
||||||
|
#else
|
||||||
|
MapWidget::instance()->reload();
|
||||||
|
#endif
|
||||||
if (doRecreateDiveList)
|
if (doRecreateDiveList)
|
||||||
recreateDiveList();
|
recreateDiveList();
|
||||||
|
|
||||||
|
@ -496,7 +504,11 @@ void MainWindow::current_dive_changed(int divenr)
|
||||||
graphics()->plotDive();
|
graphics()->plotDive();
|
||||||
information()->updateDiveInfo();
|
information()->updateDiveInfo();
|
||||||
configureToolbar();
|
configureToolbar();
|
||||||
|
#ifndef NO_MARBLE
|
||||||
GlobeGPS::instance()->reload();
|
GlobeGPS::instance()->reload();
|
||||||
|
#else
|
||||||
|
MapWidget::instance()->reload();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionNew_triggered()
|
void MainWindow::on_actionNew_triggered()
|
||||||
|
@ -652,7 +664,11 @@ void MainWindow::cleanUpEmpty()
|
||||||
information()->updateDiveInfo(true);
|
information()->updateDiveInfo(true);
|
||||||
graphics()->setEmptyState();
|
graphics()->setEmptyState();
|
||||||
dive_list()->reload(DiveTripModel::TREE);
|
dive_list()->reload(DiveTripModel::TREE);
|
||||||
|
#ifndef NO_MARBLE
|
||||||
GlobeGPS::instance()->reload();
|
GlobeGPS::instance()->reload();
|
||||||
|
#else
|
||||||
|
MapWidget::instance()->reload();
|
||||||
|
#endif
|
||||||
if (!existing_filename)
|
if (!existing_filename)
|
||||||
setTitle(MWTF_DEFAULT);
|
setTitle(MWTF_DEFAULT);
|
||||||
disableShortcuts();
|
disableShortcuts();
|
||||||
|
|
|
@ -27,6 +27,11 @@ void MapWidget::centerOnDiveSite(struct dive_site *ds)
|
||||||
qDebug() << longitude << latitude;
|
qDebug() << longitude << latitude;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MapWidget::reload()
|
||||||
|
{
|
||||||
|
// TODO;
|
||||||
|
}
|
||||||
|
|
||||||
MapWidget::~MapWidget()
|
MapWidget::~MapWidget()
|
||||||
{
|
{
|
||||||
m_instance = NULL;
|
m_instance = NULL;
|
||||||
|
|
|
@ -18,6 +18,7 @@ public:
|
||||||
~MapWidget();
|
~MapWidget();
|
||||||
|
|
||||||
static MapWidget *instance();
|
static MapWidget *instance();
|
||||||
|
void reload();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void centerOnDiveSite(struct dive_site *);
|
void centerOnDiveSite(struct dive_site *);
|
||||||
|
|
Loading…
Reference in a new issue