Show/Hide tabbar as needed

.. only needed when we have >1 tabs so lets hide and
   show it automatically.

.. also added a setting for remembering setting but it
   doesn't do anything as we auto hide/show.
This commit is contained in:
Mark Liversedge
2013-12-26 10:54:42 +00:00
parent bbeb76ab12
commit 67ab2b2903
2 changed files with 14 additions and 1 deletions

View File

@@ -661,6 +661,7 @@ MainWindow::MainWindow(const QDir &home)
* Lets go, choose latest ride and get GUI up and running
*--------------------------------------------------------------------*/
showTabbar(appsettings->value(NULL, GC_TABBAR, "0").toBool());
//XXX!!! We really do need a mechanism for showing if a ride needs saving...
//connect(this, SIGNAL(rideDirty()), this, SLOT(enableSaveButton()));
@@ -887,6 +888,9 @@ MainWindow::closeEvent(QCloseEvent* event)
// now remove from the list
if(mainwindows.removeOne(this) == false)
qDebug()<<"closeEvent: mainwindows list error";
// save global mainwindow settings
appsettings->setValue(GC_TABBAR, showhideTabbar->isChecked());
}
}
@@ -1304,6 +1308,9 @@ MainWindow::openTab(QString name)
setUpdatesEnabled(false);
// show the tabbar if we're gonna open tabs!
showTabbar(true);
// bootstrap
Context *context = new Context(this);
context->athlete = new Athlete(context, home);
@@ -1342,8 +1349,9 @@ MainWindow::closeTab()
// if its the last tab we close the window
if (tabList.count() == 1)
closeWindow();
else
else {
removeTab(currentTab);
}
// we did it
return true;
@@ -1355,6 +1363,8 @@ MainWindow::removeTab(Tab *tab)
{
setUpdatesEnabled(false);
if (tabList.count() == 2) showTabbar(false); // don't need it for one!
#ifdef GC_HAVE_LUCENE
// save the named searches
tab->context->athlete->namedSearches->write();