70 changes: 35 additions & 35 deletions src/Gui/TabView.cpp → src/Gui/AbstractView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "TabView.h"
#include "Tab.h"
#include "AbstractView.h"
#include "AthleteTab.h"
#include "Context.h"
#include "Athlete.h"
#include "RideItem.h"
Expand All @@ -33,7 +33,7 @@
#include "GcUpgrade.h"
#include "LTMWindow.h"

TabView::TabView(Context *context, int type) :
AbstractView::AbstractView(Context *context, int type) :
QWidget(context->tab), context(context), type(type),
_sidebar(true), _tiled(false), _selected(false), lastHeight(130*dpiYFactor), sidewidth(0),
active(false), bottomRequested(false), bottomHideOnIdle(false), perspectiveactive(false),
Expand Down Expand Up @@ -83,7 +83,7 @@ TabView::TabView(Context *context, int type) :
connect(&IdleTimer::getInstance(), SIGNAL(userActive()), this, SLOT(onActive()));
}

TabView::~TabView()
AbstractView::~AbstractView()
{
saveState(); // writes xxx-perspectives.xml

Expand All @@ -95,15 +95,15 @@ TabView::~TabView()
// has its own version of this method that switches perspective to match
// the type of activity based upon the perspective's associated "switch expression".
void
TabView::setRide(RideItem*ride)
AbstractView::setRide(RideItem*ride)
{
if (loaded) {
page()->setProperty("ride", QVariant::fromValue<RideItem*>(dynamic_cast<RideItem*>(ride)));
}
}

void
TabView::splitterMoved(int pos,int)
AbstractView::splitterMoved(int pos,int)
{
if (sidebar_ == NULL) return; // we haven't set sidebar yet.

Expand All @@ -126,7 +126,7 @@ TabView::splitterMoved(int pos,int)
}

void
TabView::resizeEvent(QResizeEvent *)
AbstractView::resizeEvent(QResizeEvent *)
{
active = true; // we're mucking about, so ignore in splitterMoved ...

Expand Down Expand Up @@ -156,7 +156,7 @@ TabView::resizeEvent(QResizeEvent *)
}

void
TabView::setSidebar(QWidget *sidebar)
AbstractView::setSidebar(QWidget *sidebar)
{
sidebar_ = sidebar;
splitter->insertWidget(0, sidebar);
Expand All @@ -165,7 +165,7 @@ TabView::setSidebar(QWidget *sidebar)
}

QString
TabView::ourStyleSheet()
AbstractView::ourStyleSheet()
{
return QString::fromUtf8("QScrollBar { background-color: %1; border: 0px; }"
#ifndef Q_OS_MAC
Expand Down Expand Up @@ -249,7 +249,7 @@ TabView::ourStyleSheet()
}

void
TabView::configChanged(qint32)
AbstractView::configChanged(qint32)
{
#if (defined Q_OS_LINUX) || (defined Q_OS_WIN)
// style that sucker
Expand All @@ -260,7 +260,7 @@ TabView::configChanged(qint32)
}

void
TabView::saveState()
AbstractView::saveState()
{
// if its not loaded, don't save a blank file !
if (!loaded) return;
Expand Down Expand Up @@ -307,7 +307,7 @@ TabView::saveState()
}

void
TabView::restoreState(bool useDefault)
AbstractView::restoreState(bool useDefault)
{
QString view = "none";
switch(type) {
Expand Down Expand Up @@ -438,7 +438,7 @@ TabView::restoreState(bool useDefault)
}

void
TabView::appendPerspective(Perspective *page)
AbstractView::appendPerspective(Perspective *page)
{
perspectives_ << page;
pstack->addWidget(page);
Expand All @@ -447,7 +447,7 @@ TabView::appendPerspective(Perspective *page)
}

bool
TabView::importPerspective(QString filename)
AbstractView::importPerspective(QString filename)
{
Perspective *newone = Perspective::fromFile(context, filename, type);
if (newone) {
Expand All @@ -461,14 +461,14 @@ TabView::importPerspective(QString filename)
}

void
TabView::exportPerspective(Perspective *p, QString filename)
AbstractView::exportPerspective(Perspective *p, QString filename)
{
// write to file
p->toFile(filename);
}

Perspective *
TabView::addPerspective(QString name)
AbstractView::addPerspective(QString name)
{
Perspective *page = new Perspective(context, name, type);

Expand All @@ -482,7 +482,7 @@ TabView::addPerspective(QString name)
}

void
TabView::removePerspective(Perspective *p)
AbstractView::removePerspective(Perspective *p)
{
if (perspectives_.count() == 1) return; // not allowed to have zero perspectives mate

Expand Down Expand Up @@ -513,7 +513,7 @@ TabView::removePerspective(Perspective *p)
}

void
TabView::swapPerspective(int from, int to) // is actually swapping as only move 1 position at a time
AbstractView::swapPerspective(int from, int to) // is actually swapping as only move 1 position at a time
{
if (from == to) return; // nowt to do in this case.

Expand Down Expand Up @@ -548,7 +548,7 @@ TabView::swapPerspective(int from, int to) // is actually swapping as only move
}

void
TabView::setPages(QStackedWidget *pages)
AbstractView::setPages(QStackedWidget *pages)
{
pstack = pages;

Expand Down Expand Up @@ -588,7 +588,7 @@ TabView::setPages(QStackedWidget *pages)
}

void
TabView::setBottom(QWidget *widget)
AbstractView::setBottom(QWidget *widget)
{
bottom_ = widget;
bottom_->hide();
Expand All @@ -598,15 +598,15 @@ TabView::setBottom(QWidget *widget)
}

void
TabView::dragEvent(bool x)
AbstractView::dragEvent(bool x)
{
setBottomRequested(x);
context->mainWindow->setToolButtons(); // toolbuttons reflect show/hide status
}

// hide and show bottom - but with a little animation ...
void
TabView::setShowBottom(bool x)
AbstractView::setShowBottom(bool x)
{
if (x == isShowBottom())
{
Expand Down Expand Up @@ -647,7 +647,7 @@ TabView::setShowBottom(bool x)
}

void
TabView::setBlank(BlankStatePage *blank)
AbstractView::setBlank(BlankStatePage *blank)
{
blank_ = blank;
blank->hide();
Expand All @@ -664,7 +664,7 @@ TabView::setBlank(BlankStatePage *blank)


void
TabView::sidebarChanged()
AbstractView::sidebarChanged()
{
// wait for main window to catch up
if (sidebar_ == NULL) return;
Expand Down Expand Up @@ -710,7 +710,7 @@ TabView::sidebarChanged()
}

void
TabView::setPerspectives(QComboBox *perspectiveSelector)
AbstractView::setPerspectives(QComboBox *perspectiveSelector)
{
perspectiveactive=true;

Expand Down Expand Up @@ -745,7 +745,7 @@ TabView::setPerspectives(QComboBox *perspectiveSelector)


void
TabView::perspectiveSelected(int index)
AbstractView::perspectiveSelected(int index)
{
if (perspectiveactive || index <0) return;

Expand Down Expand Up @@ -776,13 +776,13 @@ TabView::perspectiveSelected(int index)


void
TabView::tileModeChanged()
AbstractView::tileModeChanged()
{
if (perspective_) perspective_->setStyle(isTiled() ? 2 : 0);
}

void
TabView::selectionChanged()
AbstractView::selectionChanged()
{
// we got selected..
if (isSelected()) {
Expand Down Expand Up @@ -816,7 +816,7 @@ TabView::selectionChanged()
}

void
TabView::resetLayout()
AbstractView::resetLayout()
{
// delete all current perspectives
// XXX TODO
Expand All @@ -826,32 +826,32 @@ TabView::resetLayout()
}

void
TabView::addChart(GcWinID id)
AbstractView::addChart(GcWinID id)
{
if (perspective_) perspective_->appendChart(id);
}

void
TabView::checkBlank()
AbstractView::checkBlank()
{
selectionChanged(); // run through the code again
}

void
TabView::setBottomRequested(bool x)
AbstractView::setBottomRequested(bool x)
{
bottomRequested = x;
setShowBottom(x);
}

void
TabView::setHideBottomOnIdle(bool x)
AbstractView::setHideBottomOnIdle(bool x)
{
bottomHideOnIdle = x;
}

void
TabView::onIdle()
AbstractView::onIdle()
{
if (bottomHideOnIdle)
{
Expand All @@ -860,7 +860,7 @@ TabView::onIdle()
}

void
TabView::onActive()
AbstractView::onActive()
{
if (bottomRequested)
{
Expand Down
12 changes: 6 additions & 6 deletions src/Gui/TabView.h → src/Gui/AbstractView.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
#include "GcSideBarItem.h"
#include "GcWindowRegistry.h"

class Tab;
class AthleteTab;
class ViewSplitter;
class Context;
class BlankStatePage;
class PerspectiveDialog;

class TabView : public QWidget
class AbstractView : public QWidget
{
Q_OBJECT

Expand All @@ -50,8 +50,8 @@ class TabView : public QWidget

public:

TabView(Context *context, int type);
virtual ~TabView();
AbstractView(Context *context, int type);
virtual ~AbstractView();
virtual void close() {};

// add the widgets to the view
Expand Down Expand Up @@ -212,7 +212,7 @@ class ViewSplitter : public QSplitter
Q_OBJECT

public:
ViewSplitter(Qt::Orientation orientation, QString name, TabView *parent=0) :
ViewSplitter(Qt::Orientation orientation, QString name, AbstractView *parent=0) :
QSplitter(orientation, parent), orientation(orientation), name(name), tabView(parent), showForDrag(false) {
setAcceptDrops(true);
qRegisterMetaType<ViewSplitter*>("hpos");
Expand Down Expand Up @@ -341,7 +341,7 @@ public slots:
private:
Qt::Orientation orientation;
QString name;
TabView *tabView;
AbstractView *tabView;
bool showForDrag;
QPushButton *toggle, *clearbutton;
};
Expand Down
44 changes: 22 additions & 22 deletions src/Gui/Tab.cpp → src/Gui/AthleteTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/


#include "Tab.h"
#include "AthleteTab.h"
#include "Views.h"
#include "Athlete.h"
#include "RideCache.h"
Expand All @@ -30,7 +30,7 @@

#include <QPaintEvent>

Tab::Tab(Context *context) : QWidget(context->mainWindow), context(context), noswitch(true)
AthleteTab::AthleteTab(Context *context) : QWidget(context->mainWindow), context(context), noswitch(true)
{
context->tab = this;
init = false;
Expand Down Expand Up @@ -110,7 +110,7 @@ Tab::Tab(Context *context) : QWidget(context->mainWindow), context(context), nos
init = true;
}

Tab::~Tab()
AthleteTab::~AthleteTab()
{
delete analysisView;
delete homeView;
Expand All @@ -121,7 +121,7 @@ Tab::~Tab()
}

void
Tab::close()
AthleteTab::close()
{
analysisView->saveState();
homeView->saveState();
Expand All @@ -138,29 +138,29 @@ Tab::close()
* MainWindow integration with Tab / TabView (mostly pass through)
*****************************************************************************/

bool Tab::hasBottom() { return view(currentView())->hasBottom(); }
bool Tab::isBottomRequested() { return view(currentView())->isBottomRequested(); }
void Tab::setBottomRequested(bool x) { view(currentView())->setBottomRequested(x); }
void Tab::setSidebarEnabled(bool x) { view(currentView())->setSidebarEnabled(x); }
bool Tab::isSidebarEnabled() { return view(currentView())->sidebarEnabled(); }
void Tab::toggleSidebar() { view(currentView())->setSidebarEnabled(!view(currentView())->sidebarEnabled()); }
void Tab::setTiled(bool x) { view(currentView())->setTiled(x); }
bool Tab::isTiled() { return view(currentView())->isTiled(); }
void Tab::toggleTile() { view(currentView())->setTiled(!view(currentView())->isTiled()); }
void Tab::resetLayout() { view(currentView())->resetLayout(); }
void Tab::addChart(GcWinID i) { view(currentView())->addChart(i); }
void Tab::addIntervals() { analysisView->addIntervals(); }

void Tab::setRide(RideItem*ride)
bool AthleteTab::hasBottom() { return view(currentView())->hasBottom(); }
bool AthleteTab::isBottomRequested() { return view(currentView())->isBottomRequested(); }
void AthleteTab::setBottomRequested(bool x) { view(currentView())->setBottomRequested(x); }
void AthleteTab::setSidebarEnabled(bool x) { view(currentView())->setSidebarEnabled(x); }
bool AthleteTab::isSidebarEnabled() { return view(currentView())->sidebarEnabled(); }
void AthleteTab::toggleSidebar() { view(currentView())->setSidebarEnabled(!view(currentView())->sidebarEnabled()); }
void AthleteTab::setTiled(bool x) { view(currentView())->setTiled(x); }
bool AthleteTab::isTiled() { return view(currentView())->isTiled(); }
void AthleteTab::toggleTile() { view(currentView())->setTiled(!view(currentView())->isTiled()); }
void AthleteTab::resetLayout() { view(currentView())->resetLayout(); }
void AthleteTab::addChart(GcWinID i) { view(currentView())->addChart(i); }
void AthleteTab::addIntervals() { analysisView->addIntervals(); }

void AthleteTab::setRide(RideItem*ride)
{
analysisView->setRide(ride);
homeView->setRide(ride);
trainView->setRide(ride);
diaryView->setRide(ride);
}

TabView *
Tab::view(int index)
AbstractView *
AthleteTab::view(int index)
{
switch(index) {
case 0 : return homeView;
Expand All @@ -172,7 +172,7 @@ Tab::view(int index)
}

void
Tab::selectView(int index)
AthleteTab::selectView(int index)
{
emit viewChanged(index);

Expand All @@ -187,7 +187,7 @@ Tab::selectView(int index)
}

void
Tab::rideSelected(RideItem*)
AthleteTab::rideSelected(RideItem*)
{
emit rideItemSelected(context->ride);

Expand Down
10 changes: 5 additions & 5 deletions src/Gui/Tab.h → src/Gui/AthleteTab.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef _GC_Tab_h
#define _GC_Tab_h 1

#include "TabView.h"
#include "AbstractView.h"
#include "Views.h"

class RideNavigator;
Expand All @@ -29,21 +29,21 @@ class ProgressLine;
class QPaintEvent;
class NavigationModel;

class Tab: public QWidget
class AthleteTab: public QWidget
{
Q_OBJECT

public:

bool init; // am I ready yet?

Tab(Context *context);
~Tab();
AthleteTab(Context *context);
~AthleteTab();
void close();

ChartSettings *chartsettings() { return chartSettings; } // by HomeWindow
int currentView() { return views->currentIndex(); }
TabView *view(int index);
AbstractView *view(int index);

NavigationModel *nav; // back/forward for this tab

Expand Down
4 changes: 2 additions & 2 deletions src/Gui/AthleteView.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "AthleteView.h"
#include "AthleteConfigDialog.h"
#include "TabView.h"
#include "AbstractView.h"
#include "JsonRideFile.h" // for DATETIME_FORMAT
#include "HelpWhatsThis.h"

Expand Down Expand Up @@ -88,7 +88,7 @@ void
AthleteView::configChanged(qint32)
{
// appearances
setStyleSheet(TabView::ourStyleSheet());
setStyleSheet(AbstractView::ourStyleSheet());

}

Expand Down
4 changes: 2 additions & 2 deletions src/Gui/ChartSpace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "ChartSpace.h"

#include "TabView.h"
#include "AbstractView.h"
#include "Athlete.h"
#include "RideCache.h"

Expand Down Expand Up @@ -555,7 +555,7 @@ ChartSpace::configChanged(qint32)
setProperty("color", GColor(COVERVIEWBACKGROUND));
view->setBackgroundBrush(QBrush(GColor(COVERVIEWBACKGROUND)));
scene->setBackgroundBrush(QBrush(GColor(COVERVIEWBACKGROUND)));
scrollbar->setStyleSheet(TabView::ourStyleSheet());
scrollbar->setStyleSheet(AbstractView::ourStyleSheet());

// text edit colors
QPalette palette;
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/ChooseCyclistDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ ChooseCyclistDialog::getList()

// only allow selection of cyclists which are not already open
foreach (MainWindow *x, mainwindows) {
QMapIterator<QString, Tab*> t(x->tabs);
QMapIterator<QString, AthleteTab*> t(x->tabs);
while (t.hasNext()) {
t.next();
if (t.key() == name)
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/EditUserMetricDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "Context.h"
#include "Athlete.h"
#include "MainWindow.h"
#include "Tab.h"
#include "AthleteTab.h"
#include "RideNavigator.h"
#include "DataFilter.h"
#include "Zones.h"
Expand Down
26 changes: 13 additions & 13 deletions src/Gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
#endif

// GUI Widgets
#include "Tab.h"
#include "AthleteTab.h"
#include "GcToolBar.h"
#include "NewSideBar.h"
#include "HelpWindow.h"
Expand Down Expand Up @@ -154,7 +154,7 @@ MainWindow::MainWindow(const QDir &home)
// bootstrap
Context *context = new Context(this);
context->athlete = new Athlete(context, home);
currentTab = new Tab(context);
currentTab = new AthleteTab(context);

// get rid of splash when currentTab is shown
clearSplash();
Expand Down Expand Up @@ -952,7 +952,7 @@ void
MainWindow::exportPerspective()
{
int view = currentTab->currentView();
TabView *current = NULL;
AbstractView *current = NULL;

QString typedesc;

Expand Down Expand Up @@ -980,7 +980,7 @@ void
MainWindow::importPerspective()
{
int view = currentTab->currentView();
TabView *current = NULL;
AbstractView *current = NULL;

switch (view) {
case 0: current = currentTab->homeView; break;
Expand Down Expand Up @@ -1125,13 +1125,13 @@ MainWindow::moveEvent(QMoveEvent*)
void
MainWindow::closeEvent(QCloseEvent* event)
{
QList<Tab*> closing = tabList;
QList<AthleteTab*> closing = tabList;
bool needtosave = false;
bool importrunning = false;

// close all the tabs .. if any refuse we need to ignore
// the close event
foreach(Tab *tab, closing) {
foreach(AthleteTab *tab, closing) {

// check for if RideImport is is process and let it finalize / or be stopped by the user
if (tab->context->athlete->autoImport) {
Expand Down Expand Up @@ -1443,7 +1443,7 @@ MainWindow::perspectiveSelected(int index)

// set the perspective for the current view
int view = currentTab->currentView();
TabView *current = NULL;
AbstractView *current = NULL;
switch (view) {
case 0: current = currentTab->homeView; break;
case 1: current = currentTab->analysisView; break;
Expand Down Expand Up @@ -1510,7 +1510,7 @@ void
MainWindow::perspectivesChanged()
{
int view = currentTab->currentView();
TabView *current = NULL;
AbstractView *current = NULL;

switch (view) {
case 0: current = currentTab->homeView; break;
Expand Down Expand Up @@ -1959,7 +1959,7 @@ void
MainWindow::loadCompleted(QString name, Context *context)
{
// athlete loaded
currentTab = new Tab(context);
currentTab = new AthleteTab(context);

// clear splash - progress whilst loading tab
//clearSplash();
Expand Down Expand Up @@ -1990,7 +1990,7 @@ void
MainWindow::closeTabClicked(int index)
{

Tab *tab = tabList[index];
AthleteTab *tab = tabList[index];

// check for autoimport and let it finalize
if (tab->context->athlete->autoImport) {
Expand Down Expand Up @@ -2045,7 +2045,7 @@ MainWindow::closeTab()

// no questions asked just wipe away the current tab
void
MainWindow::removeTab(Tab *tab)
MainWindow::removeTab(AthleteTab *tab)
{
setUpdatesEnabled(false);

Expand Down Expand Up @@ -2119,7 +2119,7 @@ MainWindow::setOpenTabMenu()

// only allow selection of cyclists which are not already open
foreach (MainWindow *x, mainwindows) {
QMapIterator<QString, Tab*> t(x->tabs);
QMapIterator<QString, AthleteTab*> t(x->tabs);
while (t.hasNext()) {
t.next();
if (t.key() == name)
Expand Down Expand Up @@ -2198,7 +2198,7 @@ MainWindow::setDeleteAthleteMenu()

// only allow selection of cyclists which are not already open
foreach (MainWindow *x, mainwindows) {
QMapIterator<QString, Tab*> t(x->tabs);
QMapIterator<QString, AthleteTab*> t(x->tabs);
while (t.hasNext()) {
t.next();
if (t.key() == name)
Expand Down
12 changes: 6 additions & 6 deletions src/Gui/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class MainWindow;
class Athlete;
class AthleteLoader;
class Context;
class Tab;
class AthleteTab;


extern QList<MainWindow *> mainwindows; // keep track of all the MainWindows we have open
Expand All @@ -94,7 +94,7 @@ class MainWindow : public QMainWindow
int loading;

// currently selected tab
Tab *athleteTab() { return currentTab; }
AthleteTab *athleteTab() { return currentTab; }
NewSideBar *newSidebar() { return sidebar; }

// tab view keeps this up to date
Expand All @@ -109,9 +109,9 @@ class MainWindow : public QMainWindow
// have already been opened
friend class ::ChooseCyclistDialog;
friend class ::AthleteLoader;
QMap<QString,Tab*> tabs;
Tab *currentTab;
QList<Tab*> tabList;
QMap<QString,AthleteTab*> tabs;
AthleteTab *currentTab;
QList<AthleteTab*> tabList;

virtual void resizeEvent(QResizeEvent*);
virtual void moveEvent(QMoveEvent*);
Expand Down Expand Up @@ -166,7 +166,7 @@ class MainWindow : public QMainWindow
bool closeTab(QString name); // close named athlete
bool closeTab(); // close current, might not if the user
// changes mind if there are unsaved changes.
void removeTab(Tab*); // remove without question
void removeTab(AthleteTab*); // remove without question
void switchTab(int index); // for switching between one tab and another

// sidebar selecting views and actions
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/NavigationModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "MainWindow.h"


NavigationModel::NavigationModel(Tab *tab) : tab(tab), block(false), viewinit(false), drinit(false), iteminit(false)
NavigationModel::NavigationModel(AthleteTab *tab) : tab(tab), block(false), viewinit(false), drinit(false), iteminit(false)
{
connect(tab, SIGNAL(viewChanged(int)), this, SLOT(viewChanged(int)));
connect(tab, SIGNAL(rideItemSelected(RideItem*)), this, SLOT(rideChanged(RideItem*)));
Expand Down
6 changes: 3 additions & 3 deletions src/Gui/NavigationModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <QString>
#include <QVariant>

#include "Tab.h"
#include "AthleteTab.h"
#include "TimeUtils.h"
#include "Context.h"
#include "Athlete.h"
Expand Down Expand Up @@ -54,7 +54,7 @@ class NavigationModel : public QObject

public:

NavigationModel(Tab *tab);
NavigationModel(AthleteTab *tab);
~NavigationModel();

// keep a track of the rides we've looked
Expand All @@ -74,7 +74,7 @@ public slots:

private:

Tab *tab;
AthleteTab *tab;

// block observer when undo/redo is active
bool block;
Expand Down
6 changes: 3 additions & 3 deletions src/Gui/Perspective.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

#include "Athlete.h"
#include "Context.h"
#include "Tab.h"
#include "TabView.h"
#include "AthleteTab.h"
#include "AbstractView.h"
#include "Perspective.h"
#include "LTMTool.h"
#include "LTMSettings.h"
Expand Down Expand Up @@ -293,7 +293,7 @@ Perspective::configChanged(qint32)
{
// update scroll bar
//#ifndef Q_OS_MAC
tileArea->verticalScrollBar()->setStyleSheet(TabView::ourStyleSheet());
tileArea->verticalScrollBar()->setStyleSheet(AbstractView::ourStyleSheet());
//#endif
QPalette palette;
palette.setBrush(backgroundRole(), type() == VIEW_TRAIN ? GColor(CTRAINPLOTBACKGROUND) : GColor(CPLOTBACKGROUND));
Expand Down
4 changes: 2 additions & 2 deletions src/Gui/Perspective.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

class ChartBar;
class LTMSettings;
class TabView;
class AbstractView;
class ViewParser;
class PerspectiveDialog;
class QTextStream;
Expand All @@ -53,7 +53,7 @@ class Perspective : public GcWindow
Q_OBJECT
G_OBJECT

friend ::TabView;
friend ::AbstractView;
friend ::TrendsView;
friend ::ViewParser;
friend ::PerspectiveDialog;
Expand Down
4 changes: 2 additions & 2 deletions src/Gui/PerspectiveDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

#include "PerspectiveDialog.h"
#include "TabView.h"
#include "AbstractView.h"
#include "Perspective.h"

#include <QFormLayout>
Expand All @@ -28,7 +28,7 @@
///
/// PerspectiveDialog
///
PerspectiveDialog::PerspectiveDialog(QWidget *parent, TabView *tabView) : QDialog(parent), tabView(tabView), active(false)
PerspectiveDialog::PerspectiveDialog(QWidget *parent, AbstractView *tabView) : QDialog(parent), tabView(tabView), active(false)
{

setWindowTitle("Manage Perspectives");
Expand Down
6 changes: 3 additions & 3 deletions src/Gui/PerspectiveDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef _GC_PerspectiveDialog_h
#define _GC_PerspectiveDialog_h 1
#include "GoldenCheetah.h"
#include "TabView.h"
#include "AbstractView.h"
#include "Perspective.h"

#include <QtGui>
Expand Down Expand Up @@ -66,7 +66,7 @@ class PerspectiveDialog : public QDialog
G_OBJECT

public:
PerspectiveDialog(QWidget *parent, TabView *tabView);
PerspectiveDialog(QWidget *parent, AbstractView *tabView);

private slots:

Expand All @@ -91,7 +91,7 @@ class PerspectiveDialog : public QDialog
void perspectivesChanged();

private:
TabView *tabView;
AbstractView *tabView;

PerspectiveTableWidget *perspectiveTable;
ChartTableWidget *chartTable;
Expand Down
4 changes: 2 additions & 2 deletions src/Gui/RideNavigator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "RideNavigator.h"
#include "RideNavigatorProxy.h"
#include "SearchFilterBox.h"
#include "TabView.h"
#include "AbstractView.h"
#include "HelpWhatsThis.h"

#include <QtGui>
Expand Down Expand Up @@ -173,7 +173,7 @@ RideNavigator::configChanged(qint32 state)

// hide ride list scroll bar ?
#ifndef Q_OS_MAC
tableView->setStyleSheet(TabView::ourStyleSheet());
tableView->setStyleSheet(AbstractView::ourStyleSheet());
if (mainwindow) {
if (appsettings->value(this, GC_RIDESCROLL, true).toBool() == false)
tableView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/SaveDialogs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "MainWindow.h"
#include "Tab.h"
#include "AthleteTab.h"
#include "Athlete.h"
#include "RideCache.h"
#include "Estimator.h"
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/SearchBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "SearchBox.h"
#include "Context.h"
#include "Tab.h"
#include "AthleteTab.h"
#include "Athlete.h"
#include "NamedSearch.h"
#include "RideNavigator.h"
Expand Down
8 changes: 4 additions & 4 deletions src/Gui/Views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <QDesktopWidget>
extern QDesktopWidget *desktop;

AnalysisView::AnalysisView(Context *context, QStackedWidget *controls) : TabView(context, VIEW_ANALYSIS)
AnalysisView::AnalysisView(Context *context, QStackedWidget *controls) : AbstractView(context, VIEW_ANALYSIS)
{
analSidebar = new AnalysisSidebar(context);
BlankStateAnalysisPage *b = new BlankStateAnalysisPage(context);
Expand Down Expand Up @@ -127,7 +127,7 @@ AnalysisView::isBlank()
else return true;
}

DiaryView::DiaryView(Context *context, QStackedWidget *controls) : TabView(context, VIEW_DIARY)
DiaryView::DiaryView(Context *context, QStackedWidget *controls) : AbstractView(context, VIEW_DIARY)
{
diarySidebar = new DiarySidebar(context);
BlankStateDiaryPage *b = new BlankStateDiaryPage(context);
Expand Down Expand Up @@ -177,7 +177,7 @@ DiaryView::isBlank()
else return true;
}

TrendsView::TrendsView(Context *context, QStackedWidget *controls) : TabView(context, VIEW_TRENDS)
TrendsView::TrendsView(Context *context, QStackedWidget *controls) : AbstractView(context, VIEW_TRENDS)
{
sidebar = new LTMSidebar(context);
BlankStateHomePage *b = new BlankStateHomePage(context);
Expand Down Expand Up @@ -283,7 +283,7 @@ TrendsView::justSelected()
}
}

TrainView::TrainView(Context *context, QStackedWidget *controls) : TabView(context, VIEW_TRAIN)
TrainView::TrainView(Context *context, QStackedWidget *controls) : AbstractView(context, VIEW_TRAIN)
{
trainTool = new TrainSidebar(context);
trainTool->hide();
Expand Down
10 changes: 5 additions & 5 deletions src/Gui/Views.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
#ifndef _GC_Views_h
#define _GC_Views_h 1

#include "TabView.h"
#include "AbstractView.h"
class TrainSidebar;
class AnalysisSidebar;
class IntervalSidebar;
class QDialog;
class RideNavigator;
class TrainBottom;

class AnalysisView : public TabView
class AnalysisView : public AbstractView
{
Q_OBJECT

Expand All @@ -53,7 +53,7 @@ class AnalysisView : public TabView
};

class DiarySidebar;
class DiaryView : public TabView
class DiaryView : public AbstractView
{
Q_OBJECT

Expand All @@ -74,7 +74,7 @@ class DiaryView : public TabView

};

class TrainView : public TabView
class TrainView : public AbstractView
{
Q_OBJECT

Expand All @@ -100,7 +100,7 @@ private slots:
};

class LTMSidebar;
class TrendsView : public TabView
class TrendsView : public AbstractView
{
Q_OBJECT

Expand Down
2 changes: 1 addition & 1 deletion src/Metrics/RideMetadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "Settings.h"
#include "Colors.h"
#include "Units.h"
#include "TabView.h"
#include "AbstractView.h"
#include "HelpWhatsThis.h"
#include "Utils.h"
#include "RideEditor.h"
Expand Down
2 changes: 1 addition & 1 deletion src/Planning/PlanningWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

// trends view
#include "Season.h" // for data series types
#include "TabView.h" // stylesheet for scroller
#include "AbstractView.h" // stylesheet for scroller

// qt
#include <QtGui>
Expand Down
2 changes: 1 addition & 1 deletion src/Train/LiveMapWebPageWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
//#include <QWebEngineProfile>

// overlay helper
#include "TabView.h"
#include "AbstractView.h"
#include "GcOverlayWidget.h"
#include "IntervalSummaryWindow.h"
#include "HelpWhatsThis.h"
Expand Down
2 changes: 1 addition & 1 deletion src/Train/TrainSidebar.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "ErgFilePlot.h"
#include "GcSideBarItem.h"
#include "RemoteControl.h"
#include "Tab.h"
#include "AthleteTab.h"
#include "PhysicsUtility.h"

// standard stuff
Expand Down
2 changes: 1 addition & 1 deletion src/Train/WebPageWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <QWebEngineDownloadItem>

// overlay helper
#include "TabView.h"
#include "AbstractView.h"
#include "GcOverlayWidget.h"
#include "IntervalSummaryWindow.h"
#include <QDebug>
Expand Down
4 changes: 2 additions & 2 deletions src/Train/WorkoutWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ WorkoutWindow::configChanged(qint32)
xlabel->setFixedWidth(fm.boundingRect(" 00:00:00 ").width());
ylabel->setFixedWidth(fm.boundingRect(" 1000w ").width());

scroll->setStyleSheet(TabView::ourStyleSheet());
scroll->setStyleSheet(AbstractView::ourStyleSheet());
toolbar->setStyleSheet(QString("::enabled { background: %1; color: %2; border: 0px; } ")
.arg(GColor(CTRAINPLOTBACKGROUND).name())
.arg(GCColor::invertColor(GColor(CTRAINPLOTBACKGROUND)).name()));
Expand Down Expand Up @@ -394,7 +394,7 @@ WorkoutWindow::configChanged(qint32)
}

#ifndef Q_OS_MAC // the scrollers appear when needed on Mac, we'll keep that
code->setStyleSheet(TabView::ourStyleSheet());
code->setStyleSheet(AbstractView::ourStyleSheet());
#endif

palette.setColor(QPalette::WindowText, GCColor::invertColor(GColor(CTRAINPLOTBACKGROUND)));
Expand Down
2 changes: 1 addition & 1 deletion src/Train/WorkoutWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "Context.h"
#include "RideFile.h" // for data series types
#include "Library.h" // workout library
#include "TabView.h" // stylesheet for scroller
#include "AbstractView.h" // stylesheet for scroller

#include "Settings.h"
#include "Units.h"
Expand Down
4 changes: 2 additions & 2 deletions src/src.pro
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ HEADERS += Gui/AboutDialog.h Gui/AddIntervalDialog.h Gui/AnalysisSidebar.h Gui/C
Gui/DragBar.h Gui/EstimateCPDialog.h Gui/GcCrashDialog.h Gui/GcSideBarItem.h Gui/GcToolBar.h Gui/GcWindowLayout.h \
Gui/GcWindowRegistry.h Gui/GenerateHeatMapDialog.h Gui/GProgressDialog.h Gui/HelpWhatsThis.h Gui/HelpWindow.h \
Gui/IntervalTreeView.h Gui/LTMSidebar.h Gui/MainWindow.h Gui/NewCyclistDialog.h Gui/Pages.h Gui/RideNavigator.h Gui/RideNavigatorProxy.h \
Gui/SaveDialogs.h Gui/SearchBox.h Gui/SearchFilterBox.h Gui/SolveCPDialog.h Gui/Tab.h Gui/TabView.h Gui/ToolsRhoEstimator.h \
Gui/SaveDialogs.h Gui/SearchBox.h Gui/SearchFilterBox.h Gui/SolveCPDialog.h Gui/AthleteTab.h Gui/AbstractView.h Gui/ToolsRhoEstimator.h \
Gui/Views.h Gui/BatchExportDialog.h Gui/DownloadRideDialog.h Gui/ManualRideDialog.h Gui/NewMainWindow.h Gui/NewSideBar.h \
Gui/MergeActivityWizard.h Gui/RideImportWizard.h Gui/SplitActivityWizard.h Gui/SolverDisplay.h Gui/MetricSelect.h \
Gui/AddChartWizard.h Gui/NavigationModel.h Gui/AthleteView.h Gui/AthleteConfigDialog.h Gui/AthletePages.h Gui/Perspective.h \
Expand Down Expand Up @@ -835,7 +835,7 @@ SOURCES += Gui/AboutDialog.cpp Gui/AddIntervalDialog.cpp Gui/AnalysisSidebar.cpp
Gui/DragBar.cpp Gui/EstimateCPDialog.cpp Gui/GcCrashDialog.cpp Gui/GcSideBarItem.cpp Gui/GcToolBar.cpp Gui/GcWindowLayout.cpp \
Gui/GcWindowRegistry.cpp Gui/GenerateHeatMapDialog.cpp Gui/GProgressDialog.cpp Gui/HelpWhatsThis.cpp Gui/HelpWindow.cpp \
Gui/IntervalTreeView.cpp Gui/LTMSidebar.cpp Gui/MainWindow.cpp Gui/NewCyclistDialog.cpp Gui/Pages.cpp Gui/RideNavigator.cpp Gui/SaveDialogs.cpp \
Gui/SearchBox.cpp Gui/SearchFilterBox.cpp Gui/SolveCPDialog.cpp Gui/Tab.cpp Gui/TabView.cpp Gui/ToolsRhoEstimator.cpp Gui/Views.cpp \
Gui/SearchBox.cpp Gui/SearchFilterBox.cpp Gui/SolveCPDialog.cpp Gui/AthleteTab.cpp Gui/AbstractView.cpp Gui/ToolsRhoEstimator.cpp Gui/Views.cpp \
Gui/BatchExportDialog.cpp Gui/DownloadRideDialog.cpp Gui/ManualRideDialog.cpp Gui/EditUserMetricDialog.cpp Gui/NewMainWindow.cpp Gui/NewSideBar.cpp \
Gui/MergeActivityWizard.cpp Gui/RideImportWizard.cpp Gui/SplitActivityWizard.cpp Gui/SolverDisplay.cpp Gui/MetricSelect.cpp \
Gui/AddChartWizard.cpp Gui/NavigationModel.cpp Gui/AthleteView.cpp Gui/AthleteConfigDialog.cpp Gui/AthletePages.cpp Gui/Perspective.cpp \
Expand Down