Compare commits

...

3 Commits

Author SHA1 Message Date
Alejandro Martinez
2ef87c9ed5 Trigger v3.8-DEV2603
VERSION 3.8 DEVELOPMENT MAR 2026
[publish binaries]
2026-03-31 20:41:44 -03:00
Alejandro Martinez
ff4f46ed91 Trigger v3.8-DEV2603
VERSION 3.8 DEVELOPMENT MAR 2026
2026-03-31 19:25:30 -03:00
Joachim Kohlhammer
30a9155b20 Reworked the repeat schedule wizard (#4850)
* Simplified design and concept
* Sticking closer to the original schedule
* Added option to keep gap days (front and back)
* Added option to use originally planned dates
* Removed options to insert rest days or spread same day activities
* Improved source range preselection
2026-03-31 11:48:55 -03:00
3 changed files with 832 additions and 296 deletions

View File

@@ -114,6 +114,7 @@
// 5005 - V3.7 RELEASE (March 2025)
// 5006 - V3.7 SP1 RELEASE (November 2025)
// 5010 - V3.8 DEVELOPMENT 2601 (JAN 2026)
// 5011 - V3.8 DEVELOPMENT 2603 (MAR 2026)
#define VERSION3_BUILD 3010 // released
#define VERSION3_SP1 3030 // released
@@ -127,15 +128,15 @@
#define VERSION36_BUILD 5000 // released 5/8/23
#define VERSION37_BUILD 5005 // released 28/3/25
#define VERSION37_SP1 5006 // released 20/11/25
#define VERSION38_DEV2601 5010 // (Jan 2026) - latest snapshot 7/2/26
#define VERSION38_DEV2603 5011 // (MAR 2026) - latest snapshot 31/3/26
// will keep changing during testing and before final release
#define VERSION31_BUILD VERSION31_UPG
// the next two will with each build/release
#define VERSION_LATEST 5010
#define VERSION_STRING "V3.8-DEV2601"
//#define GC_VERSION VERSION_STRING // To force version string on non-tagged ci builds
#define VERSION_LATEST 5011
#define VERSION_STRING "V3.8-DEV2603"
#define GC_VERSION VERSION_STRING // To force version string on non-tagged ci builds
// default config for this release cycle
#define VERSION_CONFIG_PREFIX "http://www.goldencheetah.org/defaults/3.8"

File diff suppressed because it is too large Load Diff

View File

@@ -26,6 +26,76 @@
#include <QWizardPage>
#include <QLabel>
#include <QTreeWidget>
#include <QCheckBox>
#include <QRadioButton>
#include <QStyledItemDelegate>
struct SourceRide {
RideItem *rideItem = nullptr;
QDate sourceDate;
QDate targetDate;
bool selected = false;
int conflictGroup = -1;
bool targetBlocked = false;
};
class TargetRangeBar : public QFrame
{
Q_OBJECT
Q_PROPERTY(QColor highlightColor READ highlightColor WRITE setHighlightColor)
public:
explicit TargetRangeBar(QString errorMsg, QWidget *parent = nullptr);
void setResult(const QDate &start, const QDate &end, int activityCount, int deletedCount);
void setFlashEnabled(bool enabled);
private:
enum class State {
Neutral,
Warning,
Error
};
QLabel *iconLabel;
QLabel *textLabel;
QColor baseColor;
QColor borderColor;
QColor hlColor;
State currentState;
const QString errorMsg;
bool flashEnabled = true;
void applyStateStyle(State state);
QString formatDuration(const QDate &start, const QDate &end) const;
QColor highlightColor() const;
void setHighlightColor(const QColor& color);
void flash();
};
class IndicatorDelegate : public QStyledItemDelegate
{
public:
enum Roles {
IndicatorTypeRole = Qt::UserRole + 1, // [IndicatorType] Whether this item has an indicator
IndicatorStateRole // [bool] Whether this items indicator is checked
};
enum IndicatorType {
NoIndicator = 0,
RadioIndicator = 1,
CheckIndicator = 2
};
explicit IndicatorDelegate(QObject *parent = nullptr);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override;
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
};
class RepeatScheduleWizard : public QWizard
@@ -42,12 +112,34 @@ class RepeatScheduleWizard : public QWizard
RepeatScheduleWizard(Context *context, const QDate &when, QWidget *parent = nullptr);
QList<SourceRide> sourceRides;
QDate getTargetRangeStart() const;
QDate getTargetRangeEnd() const;
int getPlannedInTargetRange() const;
const QList<RideItem*> &getDeletionList() const;
void updateTargetRange();
void updateTargetRange(QDate sourceStart, QDate sourceEnd, bool keepGap, bool preferOriginal);
signals:
void targetRangeChanged();
protected:
virtual void done(int result) override;
private:
Context *context;
QDate when;
QDate sourceRangeStart;
QDate sourceRangeEnd;
QDate targetRangeStart;
QDate targetRangeEnd;
int frontGap = 0;
QList<RideItem*> deletionList;
bool keepGap = false;
bool preferOriginal = false;
QDate getDate(RideItem const * const rideItem, bool preferOriginal) const;
};
@@ -59,9 +151,20 @@ class RepeatSchedulePageSetup : public QWizardPage
RepeatSchedulePageSetup(Context *context, const QDate &when, QWidget *parent = nullptr);
int nextId() const override;
void initializePage() override;
bool isComplete() const override;
private:
Context *context;
QDateEdit *startDate;
QDateEdit *endDate;
QCheckBox *keepGapCheck;
QRadioButton *originalRadio;
QRadioButton *currentRadio;
TargetRangeBar *targetRangeBar;
private slots:
void refresh();
};
@@ -76,12 +179,12 @@ class RepeatSchedulePageActivities : public QWizardPage
void initializePage() override;
bool isComplete() const override;
QList<RideItem*> getSelectedRideItems() const;
private:
Context *context;
QTreeWidget *activityTree;
TargetRangeBar *targetRangeBar;
int numSelected = 0;
QMetaObject::Connection dataChangedConnection;
};
@@ -90,28 +193,19 @@ class RepeatSchedulePageSummary : public QWizardPage
Q_OBJECT
public:
RepeatSchedulePageSummary(Context *context, const QDate &when, QWidget *parent = nullptr);
RepeatSchedulePageSummary(Context *context, QWidget *parent = nullptr);
int nextId() const override;
void initializePage() override;
bool isComplete() const override;
QList<RideItem*> getDeletionList() const;
QList<std::pair<RideItem*, QDate>> getScheduleList() const;
private:
Context *context;
QDate when;
bool failed = false;
QList<RideItem*> deletionList; // was: preexistingPlanned
QList<std::pair<RideItem*, QDate>> scheduleList; // was: targetMap
QLabel *failedLabel;
QLabel *scheduleLabel;
QTreeWidget *scheduleTree;
QLabel *deletionLabel;
QTreeWidget *deletionTree;
TargetRangeBar *targetRangeBar;
};
#endif // _GC_ManualActivityWizard_h
#endif