1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-27 21:24:47 +01:00

Better window title

This commit is contained in:
Martin Tůma 2016-04-19 08:51:11 +02:00
parent 5feec6ac0c
commit 1b5bdc0f07
2 changed files with 13 additions and 0 deletions

View File

@ -547,6 +547,7 @@ bool GUI::openFile(const QString &fileName)
updateNavigationActions(); updateNavigationActions();
updateStatusBarInfo(); updateStatusBarInfo();
updateWindowTitle();
updateGraphTabs(); updateGraphTabs();
updateTrackView(); updateTrackView();
@ -718,6 +719,7 @@ void GUI::reloadFile()
} }
updateStatusBarInfo(); updateStatusBarInfo();
updateWindowTitle();
updateGraphTabs(); updateGraphTabs();
updateTrackView(); updateTrackView();
if (_files.isEmpty()) if (_files.isEmpty())
@ -748,6 +750,7 @@ void GUI::closeAll()
_fileActionGroup->setEnabled(false); _fileActionGroup->setEnabled(false);
updateStatusBarInfo(); updateStatusBarInfo();
updateWindowTitle();
updateGraphTabs(); updateGraphTabs();
updateTrackView(); updateTrackView();
} }
@ -853,6 +856,15 @@ void GUI::updateStatusBarInfo()
_timeLabel->setText(timeSpan(_time)); _timeLabel->setText(timeSpan(_time));
} }
void GUI::updateWindowTitle()
{
if (_files.count() == 1)
setWindowTitle(QFileInfo(_files.at(0)).fileName()
+ QString(" - " APP_NAME));
else
setWindowTitle(APP_NAME);
}
void GUI::mapChanged(int index) void GUI::mapChanged(int index)
{ {
_currentMap = _maps.at(index); _currentMap = _maps.at(index);

View File

@ -83,6 +83,7 @@ private:
bool loadFile(const QString &fileName); bool loadFile(const QString &fileName);
void saveFile(const QString &fileName); void saveFile(const QString &fileName);
void updateStatusBarInfo(); void updateStatusBarInfo();
void updateWindowTitle();
void updateNavigationActions(); void updateNavigationActions();
void updateGraphTabs(); void updateGraphTabs();
void updateTrackView(); void updateTrackView();