Merge branch 'master' of github.com:GoldenCheetah/GoldenCheetah

This commit is contained in:
Mark Liversedge
2013-02-11 13:19:59 +00:00
34 changed files with 26 additions and 110 deletions

View File

@@ -249,7 +249,7 @@ AllPlot::AllPlot(AllPlotWindow *parent, MainWindow *mainWindow):
if (appsettings->value(this, GC_SHADEZONES, true).toBool()==false)
shade_zones = false;
if (smooth < 1) smooth = 1;
smooth = 1;
// create a background object for shading
bg = new AllPlotBackground(this);

View File

@@ -48,17 +48,6 @@ DiaryWindow::DiaryWindow(MainWindow *mainWindow) :
prev->setFlat(true);
#endif
#if 0
// viewMode - monthly or weekly
viewMode = new QComboBox;
viewMode->addItem("View Month");
viewMode->addItem("View Week"); // we can add more later...
viewMode->addItem("View Ride"); // we can add more later...
viewMode->setFixedWidth(120);
viewMode->setCurrentIndex(appsettings->cvalue(mainWindow->cyclist, GC_DIARY_VIEW, "1").toInt());
#endif
controls->addWidget(prev);
controls->addWidget(next);
controls->addStretch();
@@ -84,19 +73,8 @@ DiaryWindow::DiaryWindow(MainWindow *mainWindow) :
monthlyView->setGridStyle(Qt::DotLine);
monthlyView->setFrameStyle(QFrame::NoFrame);
// weekly view via QxtScheduleView
weeklyView = new QxtScheduleView;
weeklyViewProxy = new QxtScheduleViewProxy(this, &fieldDefinitions, mainWindow);
weeklyViewProxy->setSourceModel(mainWindow->listView->sqlModel);
weeklyView->setCurrentZoomDepth (30, Qxt::Minute);
weeklyView->setDateRange(QDate(2010,9,2), QDate(2010,9,8));
weeklyView->setModel(weeklyViewProxy);
RideSummaryWindow *rideSummary = new RideSummaryWindow(mainWindow);
allViews = new QStackedWidget(this);
allViews->addWidget(monthlyView);
allViews->addWidget(weeklyView);
allViews->addWidget(rideSummary);
//allViews->setCurrentIndex(viewMode->currentIndex());
allViews->setCurrentIndex(0);
@@ -108,7 +86,6 @@ DiaryWindow::DiaryWindow(MainWindow *mainWindow) :
connect(this, SIGNAL(rideItemChanged(RideItem*)), this, SLOT(rideSelected()));
//connect(mainWindow, SIGNAL(rideSelected()), this, SLOT(rideSelected()));
connect(mainWindow, SIGNAL(configChanged()), this, SLOT(configChanged()));
connect(weeklyView, SIGNAL(indexSelected(QModelIndex)), this, SLOT(weeklySelected(QModelIndex)));
connect(next, SIGNAL(clicked()), this, SLOT(nextClicked()));
connect(prev, SIGNAL(clicked()), this, SLOT(prevClicked()));
}
@@ -151,8 +128,6 @@ DiaryWindow::rideSelected()
calendarModel->setMonth(when.month(), when.year());
when = when.addDays(Qt::Monday - when.dayOfWeek());
weeklyView->setDateRange(when, when.addDays(6));
weeklyView->setViewMode(QxtScheduleView::DayView);
#if 0
// ok update title
@@ -238,20 +213,6 @@ DiaryWindow::nextClicked()
#endif
}
void
DiaryWindow::weeklySelected(QModelIndex index)
{
if (active) return;
// lets select it in the ride list then!
QString filename = weeklyViewProxy->data(index, QxtScheduleViewProxy::FilenameRole).toString();
active = true;
mainWindow->selectRideFile(QFileInfo(filename).fileName());
//weeklyView->setViewMode(QxtScheduleView::DayView);
active = false;
rideSelected();
}
bool
DiaryWindow::eventFilter(QObject *object, QEvent *e)
{

View File

@@ -31,11 +31,6 @@
// list view
#include "RideNavigator.h"
// weekly view
#include "qxtscheduleview.h"
#include "QxtScheduleViewProxy.h"
#include "WeeklyViewItemDelegate.h"
// monthly view
#include <QTableView>
#include "GcCalendarModel.h"
@@ -63,7 +58,6 @@ class DiaryWindow : public GcWindow
void configChanged();
void nextClicked();
void prevClicked();
void weeklySelected(QModelIndex);
void setDefaultView(int);
bool eventFilter(QObject *object, QEvent *e); // traps monthly view
@@ -79,9 +73,6 @@ class DiaryWindow : public GcWindow
QTableView *monthlyView;
GcCalendarModel *calendarModel;
QxtScheduleView *weeklyView;
QxtScheduleViewProxy *weeklyViewProxy;
bool active;
QList<FieldDefinition> fieldDefinitions;
};

View File

@@ -101,7 +101,15 @@ public slots:
// we need to build a list of all the rides
// in the source model for the dates we have
dateToRows.clear(); //XXX mem leak, need to delete vectors...
// first we clear previous
QMapIterator<QDate, QVector<int>* > fm(dateToRows);
while (fm.hasNext()) {
fm.next();
delete fm.value();
}
dateToRows.clear();
// then we create new
for (int j=0; j<sourceModel()->rowCount(); j++) {
QVector<int> *arr;

View File

@@ -48,7 +48,6 @@
#include "SummaryWindow.h"
#include "MetadataWindow.h"
#include "TreeMapWindow.h"
#include "WeeklySummaryWindow.h"
#include "DialWindow.h"
#include "RealtimePlotWindow.h"
#include "SpinScanPlotWindow.h"
@@ -137,7 +136,7 @@ GcWindowRegistry::newGcWindow(GcWinID id, MainWindow *main)
case GcWindowTypes::Scatter: returning = new ScatterWindow(main, main->home); break;
case GcWindowTypes::Summary: returning = new SummaryWindow(main); break;
case GcWindowTypes::TreeMap: returning = new TreeMapWindow(main, main->useMetricUnits, main->home); break;
case GcWindowTypes::WeeklySummary: returning = new WeeklySummaryWindow(main->useMetricUnits, main); break;
case GcWindowTypes::WeeklySummary: returning = new SummaryWindow(main); break; // deprecated
#if defined Q_OS_MAC || defined GC_HAVE_VLC // mac uses Quicktime / Win/Linux uses VLC
case GcWindowTypes::VideoPlayer: returning = new VideoWindow(main, main->home); break;
#else

View File

@@ -19,7 +19,6 @@
#include "MainWindow.h"
#include "AboutDialog.h"
#include "AddIntervalDialog.h"
#include "AthleteTool.h"
#include "BestIntervalDialog.h"
#include "BlankState.h"
#include "ChooseCyclistDialog.h"
@@ -52,7 +51,6 @@
#include "Units.h"
#include "Zones.h"
#include "RideCalendar.h"
#include "DatePickerDialog.h"
#include "ToolsDialog.h"
#include "ToolsRhoEstimator.h"
@@ -664,11 +662,10 @@ MainWindow::MainWindow(const QDir &home) :
QTreeWidgetItem *last = NULL;
QStringListIterator i(RideFileFactory::instance().listRideFiles(home));
while (i.hasNext()) {
QString name = i.next(), notesFileName;
QString name = i.next();
QDateTime dt;
if (parseRideFileName(name, &notesFileName, &dt)) {
last = new RideItem(RIDE_TYPE, home.path(),
name, dt, zones(), hrZones(), notesFileName, this);
if (parseRideFileName(name, &dt)) {
last = new RideItem(RIDE_TYPE, home.path(), name, dt, zones(), hrZones(), this);
allRides->addChild(last);
}
}
@@ -972,9 +969,6 @@ MainWindow::MainWindow(const QDir &home) :
if (allRides->childCount() != 0)
treeWidget->setCurrentItem(allRides->child(allRides->childCount()-1));
// default to Analysis
selectAnalysis();
// now we're up and runnning lets connect the signals
connect(treeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(rideTreeWidgetSelectionChanged()));
connect(intervalWidget,SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(showContextMenuPopup(const QPoint &)));
@@ -1813,13 +1807,12 @@ MainWindow::dropEvent(QDropEvent *event)
void
MainWindow::addRide(QString name, bool /* bSelect =true*/)
{
QString notesFileName;
QDateTime dt;
if (!parseRideFileName(name, &notesFileName, &dt)) {
if (!parseRideFileName(name, &dt)) {
fprintf(stderr, "bad name: %s\n", name.toAscii().constData());
assert(false);
}
RideItem *last = new RideItem(RIDE_TYPE, home.path(), name, dt, zones(), hrZones(), notesFileName, this);
RideItem *last = new RideItem(RIDE_TYPE, home.path(), name, dt, zones(), hrZones(), this);
int index = 0;
while (index < allRides->childCount()) {
@@ -2485,7 +2478,7 @@ MainWindow::setCriticalPower(int cp)
}
bool
MainWindow::parseRideFileName(const QString &name, QString *notesFileName, QDateTime *dt)
MainWindow::parseRideFileName(const QString &name, QDateTime *dt)
{
static char rideFileRegExp[] = "^((\\d\\d\\d\\d)_(\\d\\d)_(\\d\\d)"
"_(\\d\\d)_(\\d\\d)_(\\d\\d))\\.(.+)$";
@@ -2503,7 +2496,6 @@ MainWindow::parseRideFileName(const QString &name, QString *notesFileName, QDate
return false;
}
*dt = QDateTime(date, time);
*notesFileName = rx.cap(1) + ".notes";
return true;
}

View File

@@ -375,8 +375,6 @@ class MainWindow : public QMainWindow
protected:
static QString notesFileName(QString rideFileName);
private:
QSharedPointer<QSettings> settings;
IntervalItem *activeInterval; // currently active for context menu popup
@@ -439,7 +437,7 @@ class MainWindow : public QMainWindow
QSignalMapper *toolMapper;
WithingsDownload *withingsDownload;
ZeoDownload *zeoDownload;
bool parseRideFileName(const QString &name, QString *notesFileName, QDateTime *dt);
bool parseRideFileName(const QString &name, QDateTime *dt);
#ifdef Q_OS_MAC
// Mac Native Support

View File

@@ -20,7 +20,6 @@
#include <stdio.h>
#include "NullController.h"
#include "RaceDispatcher.h"
#include "RealtimeData.h"
#include <math.h>

View File

@@ -28,16 +28,10 @@
RideItem::RideItem(int type,
QString path, QString fileName, const QDateTime &dateTime,
const Zones *zones, const HrZones *hrZones, QString notesFileName, MainWindow *main) :
const Zones *zones, const HrZones *hrZones, MainWindow *main) :
QTreeWidgetItem(type), ride_(NULL), main(main), isdirty(false), isedit(false), path(path), fileName(fileName),
dateTime(dateTime), zones(zones), hrZones(hrZones), notesFileName(notesFileName)
{
setText(0, dateTime.toString("ddd"));
setText(1, dateTime.toString("MMM d, yyyy"));
setText(2, dateTime.toString("h:mm AP"));
setTextAlignment(1, Qt::AlignRight);
setTextAlignment(2, Qt::AlignRight);
}
dateTime(dateTime), zones(zones), hrZones(hrZones)
{ }
RideFile *RideItem::ride()
{

View File

@@ -74,11 +74,10 @@ class RideItem : public QObject, public QTreeWidgetItem //<< for signals/slots
const QStringList errors() { return errors_; }
const Zones *zones;
const HrZones *hrZones;
QString notesFileName;
RideItem(int type, QString path,
QString fileName, const QDateTime &dateTime,
const Zones *zones, const HrZones *hrZones, QString notesFileName, MainWindow *main);
const Zones *zones, const HrZones *hrZones, MainWindow *main);
void setDirty(bool);
bool isDirty() { return isdirty; }

View File

@@ -211,13 +211,10 @@ win32 {
# local qxt widgets - rather than add another dependency on libqxt
DEFINES += QXT_STATIC
SOURCES += ../qxt/src/qxtspanslider.cpp \
../qxt/src/qxtscheduleview.cpp \
../qxt/src/qxtscheduleview_p.cpp \
../qxt/src/qxtscheduleheaderwidget.cpp \
../qxt/src/qxtscheduleviewheadermodel_p.cpp \
../qxt/src/qxtscheduleitemdelegate.cpp \
../qxt/src/qxtstyleoptionscheduleviewitem.cpp \
../qxt/src/qxtstringspinbox.cpp \
../qxt/src/qxtstringspinbox.cpp
HEADERS += ../qxt/src/qxtspanslider.h \
../qxt/src/qxtspanslider_p.h \
../qxt/src/qxtstringspinbox.h
isEmpty( QTSOAP_INSTALL ) {
include( ../qtsolutions/soap/qtsoap.pri )
@@ -228,23 +225,12 @@ HEADERS += TPUpload.h TPUploadDialog.h TPDownload.h TPDownloadDialog.h
SOURCES += TPUpload.cpp TPUploadDialog.cpp TPDownload.cpp TPDownloadDialog.cpp
DEFINES += GC_HAVE_SOAP
HEADERS += ../qxt/src/qxtspanslider.h \
../qxt/src/qxtspanslider_p.h \
../qxt/src/qxtscheduleview.h \
../qxt/src/qxtscheduleview_p.h \
../qxt/src/qxtscheduleheaderwidget.h \
../qxt/src/qxtscheduleviewheadermodel_p.h \
../qxt/src/qxtscheduleitemdelegate.h \
../qxt/src/qxtstyleoptionscheduleviewitem.h \
../qxt/src/qxtstringspinbox.h \
HEADERS += \
AboutDialog.h \
AddDeviceWizard.h \
AddIntervalDialog.h \
Aerolab.h \
AerolabWindow.h \
AthleteTool.h \
AllPlot.h \
AllPlotWindow.h \
ANT.h \
@@ -350,9 +336,7 @@ HEADERS += \
QuarqdClient.h \
QuarqParser.h \
QuarqRideFile.h \
QxtScheduleViewProxy.h \
RawRideFile.h \
RaceDispatcher.h \
RealtimeData.h \
RealtimePlotWindow.h \
RealtimeController.h \
@@ -380,8 +364,6 @@ HEADERS += \
SeasonParser.h \
Serial.h \
Settings.h \
SimpleNetworkController.h \
SimpleNetworkClient.h \
SpecialFields.h \
SpinScanPlot.h \
SpinScanPolarPlot.h \
@@ -411,8 +393,6 @@ HEADERS += \
TreeMapPlot.h \
TtbDialog.h \
Units.h \
WeeklySummaryWindow.h \
WeeklyViewItemDelegate.h \
WithingsDownload.h \
WkoRideFile.h \
WorkoutPlotWindow.h \
@@ -436,7 +416,6 @@ SOURCES += \
AerolabWindow.cpp \
AllPlot.cpp \
AllPlotWindow.cpp \
AthleteTool.cpp \
ANT.cpp \
ANTChannel.cpp \
ANTLogger.cpp \
@@ -548,7 +527,6 @@ SOURCES += \
QuarqdClient.cpp \
QuarqParser.cpp \
QuarqRideFile.cpp \
RaceDispatcher.cpp \
RawRideFile.cpp \
RealtimeData.cpp \
RealtimeController.cpp \
@@ -575,8 +553,6 @@ SOURCES += \
SeasonParser.cpp \
Serial.cpp \
Settings.cpp \
SimpleNetworkController.cpp \
SimpleNetworkClient.cpp \
SmallPlot.cpp \
SpecialFields.cpp \
SpinScanPlot.cpp \
@@ -611,7 +587,6 @@ SOURCES += \
TRIMPPoints.cpp \
WattsPerKilogram.cpp \
WithingsDownload.cpp \
WeeklySummaryWindow.cpp \
WkoRideFile.cpp \
WorkoutPlotWindow.cpp \
WorkoutWizard.cpp \