Honor GC_WANT_R in options/preferences

.. don't need to configure R_HOME if R support isn't baked in.
This commit is contained in:
Mark Liversedge
2016-05-06 12:31:53 +01:00
parent a611b93f7b
commit e686ebde3e
3 changed files with 14 additions and 3 deletions

View File

@@ -208,6 +208,7 @@ GeneralPage::GeneralPage(Context *context) : context(context)
connect(workoutBrowseButton, SIGNAL(clicked()), this, SLOT(browseWorkoutDir()));
offset++;
#ifdef GC_WANT_R
//
// R Home directory
//
@@ -226,6 +227,7 @@ GeneralPage::GeneralPage(Context *context) : context(context)
offset++;
connect(rBrowseButton, SIGNAL(clicked()), this, SLOT(browseRDir()));
#endif
// save away initial values
b4.unit = unitCombo->currentIndex();
@@ -257,7 +259,9 @@ GeneralPage::saveClicked()
// Directories
appsettings->setValue(GC_WORKOUTDIR, workoutDirectory->text());
appsettings->setValue(GC_HOMEDIR, athleteDirectory->text());
#ifdef GC_WANT_R
appsettings->setValue(GC_R_HOME, rDirectory->text());
#endif
// Elevation
appsettings->setValue(GC_ELEVATION_HYSTERESIS, hystedit->text());
@@ -297,6 +301,7 @@ GeneralPage::saveClicked()
return state;
}
#ifdef GC_WANT_R
void
GeneralPage::browseRDir()
{
@@ -306,6 +311,7 @@ GeneralPage::browseRDir()
currentDir, QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
if (dir != "") rDirectory->setText(dir); //only overwrite current dir, if a new was selected
}
#endif
void
GeneralPage::browseWorkoutDir()

View File

@@ -85,7 +85,9 @@ class GeneralPage : public QWidget
public slots:
void browseWorkoutDir();
void browseAthleteDir();
#ifdef GC_WANT_R
void browseRDir();
#endif
private:
Context *context;
@@ -101,15 +103,18 @@ class GeneralPage : public QWidget
QLineEdit *hystedit;
QLineEdit *athleteDirectory;
QLineEdit *workoutDirectory;
QLineEdit *rDirectory;
QPushButton *workoutBrowseButton;
QPushButton *athleteBrowseButton;
#ifdef GC_WANT_R
QPushButton *rBrowseButton;
QLineEdit *rDirectory;
QLabel *rLabel;
#endif
QLabel *langLabel;
QLabel *warningLabel;
QLabel *workoutLabel;
QLabel *rLabel;
QLabel *athleteLabel;
struct {

View File

@@ -85,7 +85,7 @@ BT40Controller::find()
}
bool
BT40Controller::discover(QString name)
BT40Controller::discover(QString)
{
return true;
}