mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-15 08:59:55 +00:00
combine setActive and rideSelected
And pay attention to MainWindow::activeTab, such that only the active tab redraws itself when changing rides. This change really increases GC's responsiveness when scrolling through the ride list.
This commit is contained in:
@@ -46,7 +46,7 @@ ModelWindow::addStandardChannels(QComboBox *box)
|
||||
}
|
||||
|
||||
ModelWindow::ModelWindow(MainWindow *parent, const QDir &home) :
|
||||
QWidget(parent), home(home), main(parent), active(false), ride(NULL)
|
||||
QWidget(parent), home(home), main(parent), ride(NULL)
|
||||
{
|
||||
// Layouts
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
@@ -165,7 +165,7 @@ ModelWindow::ModelWindow(MainWindow *parent, const QDir &home) :
|
||||
|
||||
// now connect up the widgets
|
||||
connect(main, SIGNAL(rideSelected()), this, SLOT(rideSelected()));
|
||||
connect(main, SIGNAL(intervalSelected()), this, SLOT(rideSelected()));
|
||||
connect(main, SIGNAL(intervalSelected()), this, SLOT(intervalSelected()));
|
||||
connect(presetValues, SIGNAL(currentIndexChanged(int)), this, SLOT(applyPreset(int)));
|
||||
connect(xSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(setDirty()));
|
||||
connect(ySelector, SIGNAL(currentIndexChanged(int)), this, SLOT(setDirty()));
|
||||
@@ -182,17 +182,13 @@ ModelWindow::ModelWindow(MainWindow *parent, const QDir &home) :
|
||||
connect(zpane, SIGNAL(valueChanged(int)), this, SLOT(setZPane(int)));
|
||||
}
|
||||
|
||||
void
|
||||
ModelWindow::setActive(bool active)
|
||||
{
|
||||
this->active = active;
|
||||
if (active) setData(true);
|
||||
}
|
||||
void
|
||||
ModelWindow::rideSelected()
|
||||
{
|
||||
if (main->activeTab() != this)
|
||||
return;
|
||||
ride = main->rideItem();
|
||||
if (active) setData(true);
|
||||
setData(true);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -227,6 +223,8 @@ ModelWindow::setZPane(int z)
|
||||
void
|
||||
ModelWindow::intervalSelected()
|
||||
{
|
||||
if (main->activeTab() != this)
|
||||
return;
|
||||
setData(false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user