Skip to content

Commit

Permalink
add ugly name thing for now
Browse files Browse the repository at this point in the history
  • Loading branch information
RensDofferhoff committed Oct 9, 2024
1 parent e74da8a commit d00d4a1
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 6 deletions.
46 changes: 44 additions & 2 deletions Desktop/components/JASP/Widgets/FileMenu/PrefsAdvanced.qml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ ScrollView
enabled: preferencesModel.directLibpathEnabled
width: parent.width
height: cranRepoUrl.height
visible: preferencesModel.developerMode
visible: preferencesModel.developerMode && preferencesModel.directLibpathEnabled

Label
{
Expand All @@ -236,7 +236,7 @@ ScrollView
text: preferencesModel.directLibpathFolder
onEditingFinished: preferencesModel.directLibpathFolder = text

nextEl: cleanModulesFolder
nextEl: moduleName

height: browseDeveloperFolderButton.height
anchors
Expand All @@ -246,6 +246,48 @@ ScrollView
margins: jaspTheme.generalAnchorMargin
}

KeyNavigation.tab: moduleName
}
}

Item {

id: directDevMod
enabled: preferencesModel.directLibpathEnabled
width: parent.width
height: cranRepoUrl.height
visible: preferencesModel.developerMode && preferencesModel.directLibpathEnabled

Label
{
id: directDevModName
text: qsTr("Developer module name:")

anchors
{
left: parent.left
verticalCenter: parent.verticalCenter
leftMargin: jaspTheme.subOptionOffset
}
}

PrefsTextInput
{
id: moduleName

text: preferencesModel.directDevModName
onEditingFinished: preferencesModel.directDevModName = text

nextEl: cleanModulesFolder

height: browseDeveloperFolderButton.height
anchors
{
left: directDevModName.right
right: parent.right
margins: jaspTheme.generalAnchorMargin
}

KeyNavigation.tab: cleanModulesFolder
}
}
Expand Down
2 changes: 2 additions & 0 deletions Desktop/gui/preferencesmodel.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ GET_PREF_FUNC_BOOL( pdfLandscape, Settings::PDF_LANDSCAPE )
GET_PREF_FUNC_INT( pdfPageSize, Settings::PDF_PAGESIZE )
GET_PREF_FUNC_BOOL( directLibpathEnabled, Settings::DIRECT_LIBPATH_ENABLED )
GET_PREF_FUNC_STR( directLibpathFolder, Settings::DIRECT_LIBPATH_FOLDER )
GET_PREF_FUNC_STR( directDevModName, Settings::DIRECT_DEVMOD_NAME )


int PreferencesModel::maxEngines() const
Expand Down Expand Up @@ -318,6 +319,7 @@ SET_PREF_FUNCTION( int, setMaxScaleLevels, maxScaleLevels, maxScaleLeve
SET_PREF_FUNCTION( bool, setPdfLandscape, pdfLandscape, pdfLandscapeChanged, Settings::PDF_LANDSCAPE )
SET_PREF_FUNCTION( int, setPdfPageSize, pdfPageSize, pdfPageSizeChanged, Settings::PDF_PAGESIZE )
SET_PREF_FUNCTION( bool, setDirectLibpathEnabled, directLibpathEnabled, directLibpathEnabledChanged, Settings::DIRECT_LIBPATH_ENABLED )
SET_PREF_FUNCTION( QString, setDirectDevModName, directDevModName, directDevModNameChanged, Settings::DIRECT_DEVMOD_NAME )


void PreferencesModel::setGithubPatCustom(QString newPat)
Expand Down
6 changes: 5 additions & 1 deletion Desktop/gui/preferencesmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class PreferencesModel : public PreferencesModelBase
Q_PROPERTY(QString developerFolder READ developerFolder WRITE setDeveloperFolder NOTIFY developerFolderChanged )
Q_PROPERTY(bool directLibpathEnabled READ directLibpathEnabled WRITE setDirectLibpathEnabled NOTIFY directLibpathEnabledChanged )
Q_PROPERTY(QString directLibpathFolder READ directLibpathFolder WRITE setDirectLibpathFolder NOTIFY directLibpathFolderChanged )
Q_PROPERTY(QString directDevModName READ directDevModName WRITE setDirectDevModName NOTIFY directDevModNameChanged )
Q_PROPERTY(int thresholdScale READ thresholdScale WRITE setThresholdScale NOTIFY thresholdScaleChanged )
Q_PROPERTY(bool logToFile READ logToFile WRITE setLogToFile NOTIFY logToFileChanged )
Q_PROPERTY(int logFilesMax READ logFilesMax WRITE setLogFilesMax NOTIFY logFilesMaxChanged )
Expand Down Expand Up @@ -150,6 +151,7 @@ class PreferencesModel : public PreferencesModelBase
bool pdfLandscape() const;
bool directLibpathEnabled() const;
QString directLibpathFolder() const;
QString directDevModName() const;

bool checkUpdatesAskUser() const;
void setCheckUpdatesAskUser(bool newCheckUpdatesAskUser);
Expand Down Expand Up @@ -219,6 +221,7 @@ public slots:
void setPdfLandscape( bool pdfLandscape);
void setDirectLibpathEnabled( bool setDirectLibpathEnabled);
void setDirectLibpathFolder( QString libpath);
void setDirectDevModName( QString name);

signals:
void fixedDecimalsChanged( bool fixedDecimals);
Expand Down Expand Up @@ -276,7 +279,8 @@ public slots:
void pdfLandscapeChanged( bool pdfLandscape);
void directLibpathEnabledChanged( bool directLibpathEnabled);
void directLibpathFolderChanged();

void directDevModNameChanged( QString name);

private slots:
void dataLabelNAChangedSlot(QString label);

Expand Down
2 changes: 1 addition & 1 deletion Desktop/modules/dynamicmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ DynamicModule::DynamicModule(QObject * parent) : QObject(parent), _isDeveloperMo
///This constructor is meant specifically for the development module from a libpath *it*!
DynamicModule::DynamicModule(QObject * parent, QString libpath) : QObject(parent), _isDeveloperMod(true), _isLibpathDevMod(true)
{
_modulePackage = fq(libpath + "/jaspAnova/");
_modulePackage = fq(libpath + "/" + Settings::value(Settings::DIRECT_DEVMOD_NAME).toString() + "/");
_moduleFolder = QFileInfo(libpath + "/");
_name = extractPackageNameFromFolder(_modulePackage);

Expand Down
3 changes: 2 additions & 1 deletion Desktop/utilities/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ const Settings::Setting Settings::Values[] = {
{"pdfLandscape", false },
{"pdfPageSize", int(pdfPageSize::A4) },
{"directLibpathEnabled", false },
{"directLibpathFolder", "" }
{"directLibpathFolder", "" },
{"directDevModName", "" }

};

Expand Down
3 changes: 2 additions & 1 deletion Desktop/utilities/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ class Settings {
PDF_LANDSCAPE,
PDF_PAGESIZE,
DIRECT_LIBPATH_ENABLED,
DIRECT_LIBPATH_FOLDER
DIRECT_LIBPATH_FOLDER,
DIRECT_DEVMOD_NAME
};

static QVariant value(Settings::Type key);
Expand Down

0 comments on commit d00d4a1

Please sign in to comment.