MainWindow Refactor Part 5 of 5 - TABBED ATHLETES

The final part (and one of the reasons) for the mainwindow
refactoring -- we now support tabbed athletes rather than
having a new mainwindow for each athlete opened.

Context is saved/restored and there are new functions for
opening and closing tabs and windows of tabs.

The tabbar itself is fugly -- the next few days will spend
some time looking at making it prettier on Linux/Win and
more native on Mac (see MMTabBar).
This commit is contained in:
Mark Liversedge
2013-12-26 01:03:32 +00:00
parent c11c90f621
commit daf63f2dac
13 changed files with 621 additions and 224 deletions

View File

@@ -95,12 +95,11 @@ void
DBAccess::initDatabase(QDir home)
{
if(db && db->database(sessionid).isOpen()) return;
QString cyclist = QFileInfo(home.path()).baseName();
sessionid = QString("%1").arg(context->athlete->cyclist);
if(db && db->database(sessionid).isOpen()) return;
// use different name for v3 metricDB to avoid constant rebuilding
// when switching between v2 stable and v3 development builds
db = new QSqlDatabase(QSqlDatabase::addDatabase("QSQLITE", sessionid));