283 changes: 0 additions & 283 deletions src/Gui/BatchExportDialog.cpp

This file was deleted.

82 changes: 0 additions & 82 deletions src/Gui/BatchExportDialog.h

This file was deleted.

674 changes: 674 additions & 0 deletions src/Gui/BatchProcessingDialog.cpp

Large diffs are not rendered by default.

109 changes: 109 additions & 0 deletions src/Gui/BatchProcessingDialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@

/*
* Batch Export Copyright (c) 2011 Mark Liversedge (liversedge@gmail.com)
* Batch Processing Copyright (c) 2022 Paul Johnson (paulj49457@gmail.com)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef _BatchProcessingDialog_h
#define _BatchProcessingDialog_h

#include "GoldenCheetah.h"
#include "Context.h"
#include "Settings.h"
#include "Units.h"

#include "RideItem.h"
#include "RideFile.h"

#include <QtGui>
#include <QTreeWidget>
#include <QProgressBar>
#include <QList>
#include <QFileDialog>
#include <QCheckBox>
#include <QLabel>
#include <QListIterator>
#include <QDebug>

// Dialog class to allow batch processing of activities
class BatchProcessingDialog : public QDialog
{
Q_OBJECT
G_OBJECT

public:
BatchProcessingDialog(Context *context);

protected:

signals:

private slots:
void dpButtonClicked();
void cancelClicked();
void okClicked();
void selectClicked();
void allClicked();
void radioClicked(int);
void comboSelected();

private:

typedef enum {
unknownF,
finishedF,
userF,
dateFormatF,
timeFormatF,
noRideMFoundF,
noDataProcessorF
} bpFailureType;

typedef enum {
exportB,
dataProcessorB,
deleteB } batchRadioBType;

Context *context;
bool aborted;

int processed, fails, numFilesToProcess;
batchRadioBType outputMode;

QTreeWidget *files; // choose files to export

QWidget *disableContainer, *dpContainer, *exportContainer;

QComboBox *fileFormat, *dataProcessorToRun;

QLabel *dirName, *status;
QCheckBox *overwrite, *all;
QPushButton *dpButton, *cancel, *ok;

void updateActionColumn();
QString getActionColumnText();
void fileSelected(QTreeWidgetItem* current);
void updateNumberSelected();

bpFailureType exportFiles();
bpFailureType deleteFiles();
bpFailureType runDataProcessorOnActivities(const QString& processorName);

void failedToProcessEntry(QTreeWidgetItem* current);

};
#endif // _BatchProcessingDialog_h
4 changes: 2 additions & 2 deletions src/Gui/HelpWhatsThis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ HelpWhatsThis::getText(GCHelp chapter) {
case MenuBar_Activity_Manual_LapsEditor:
return text.arg("Menu%20Bar_Activity").arg(tr("Laps Editor allows to enter a sequence of work-rest intervals series -defined by number of repetitions (reps), distance (dist, units according to preferences in Pace Zones) and duration (min and sec)- to generate the data points for the activity"));

case MenuBar_Activity_BatchExport:
return text.arg("Menu%20Bar_Activity").arg(tr("Exports a (selectable) set of activties in one of the supported export formats"));
case MenuBar_Activity_BatchProcessing:
return text.arg("Menu%20Bar_Activity").arg(tr("Batch processes a (selectable) set of activties"));
case MenuBar_Activity_SplitRide:
return text.arg("Menu%20Bar_Activity").arg(tr("Wizard to split an activity into multiple activities based on configurable criteria"));
case MenuBar_Activity_CombineRides:
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/HelpWhatsThis.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Q_OBJECT
MenuBar_Activity_Import,
MenuBar_Activity_Manual,
MenuBar_Activity_Manual_LapsEditor,
MenuBar_Activity_BatchExport,
MenuBar_Activity_BatchProcessing,
MenuBar_Activity_SplitRide,
MenuBar_Activity_CombineRides,

Expand Down
8 changes: 4 additions & 4 deletions src/Gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
#include "SplitActivityWizard.h"
#include "MergeActivityWizard.h"
#include "GenerateHeatMapDialog.h"
#include "BatchExportDialog.h"
#include "BatchProcessingDialog.h"
#include "TodaysPlan.h"
#include "MeasuresDownload.h"
#include "WorkoutWizard.h"
Expand Down Expand Up @@ -505,7 +505,7 @@ MainWindow::MainWindow(const QDir &home)
rideMenu->addAction(tr("&Manual entry..."), this, SLOT(manualRide()), tr("Ctrl+M"));
rideMenu->addSeparator ();
rideMenu->addAction(tr("&Export..."), this, SLOT(exportRide()), tr("Ctrl+E"));
rideMenu->addAction(tr("&Batch export..."), this, SLOT(exportBatch()), tr("Ctrl+B"));
rideMenu->addAction(tr("&Batch Processing..."), this, SLOT(batchProcessing()), tr("Ctrl+B"));

rideMenu->addSeparator ();
rideMenu->addAction(tr("&Save activity"), this, SLOT(saveRide()), tr("Ctrl+S"));
Expand Down Expand Up @@ -1718,9 +1718,9 @@ MainWindow::manualRide()
}

void
MainWindow::exportBatch()
MainWindow::batchProcessing()
{
BatchExportDialog *d = new BatchExportDialog(currentAthleteTab->context);
BatchProcessingDialog *d = new BatchProcessingDialog(currentAthleteTab->context);
d->exec();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Gui/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class MainWindow : public QMainWindow
void downloadRide();
void manualRide();
void exportRide();
void exportBatch();
void batchProcessing();
void generateHeatMap();
void exportMetrics();
void addAccount();
Expand Down
4 changes: 2 additions & 2 deletions src/src.pro
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ HEADERS += Gui/AboutDialog.h Gui/AddIntervalDialog.h Gui/AnalysisSidebar.h Gui/C
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/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/Views.h Gui/BatchProcessingDialog.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/AddTileWizard.h Gui/NavigationModel.h Gui/AthleteView.h Gui/AthleteConfigDialog.h Gui/AthletePages.h Gui/Perspective.h \
Gui/PerspectiveDialog.h
Expand Down Expand Up @@ -842,7 +842,7 @@ SOURCES += Gui/AboutDialog.cpp Gui/AddIntervalDialog.cpp Gui/AnalysisSidebar.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/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/BatchProcessingDialog.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/AddTileWizard.cpp Gui/NavigationModel.cpp Gui/AthleteView.cpp Gui/AthleteConfigDialog.cpp Gui/AthletePages.cpp Gui/Perspective.cpp \
Gui/PerspectiveDialog.cpp
Expand Down