Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JASP configuration file feature + remote option #5062

Draft
wants to merge 38 commits into
base: stable
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
6c46eaf
Implements a data mode
JorisGoosen May 21, 2021
003123c
SKF JASP postmerge and fix
JorisGoosen Sep 21, 2021
aa63d26
latest version of jaspProcessControl and other submodules
JorisGoosen Dec 1, 2021
82f7f86
post qt6 merge fixes
JorisGoosen Mar 10, 2022
825d474
post rebase fixes 10-11-22
JorisGoosen Nov 10, 2022
8a49630
post rebase fix 7-12-22
JorisGoosen Dec 7, 2022
3d71dac
(event)=>{}
JorisGoosen Dec 7, 2022
7edb7cd
Rebasing mistake
boutinb Jan 27, 2023
6349af9
Make sure editing is quick and analyses are hidden in dataMode (#5040)
JorisGoosen Mar 1, 2023
191709f
dirty fix for the resize dialog (#5042)
RensDofferhoff Mar 1, 2023
55fea62
odule shenanigans
JorisGoosen Mar 16, 2023
aba724b
start
RensDofferhoff Apr 3, 2023
5f2fb73
progress
RensDofferhoff Apr 4, 2023
bef03ee
progress
RensDofferhoff Apr 5, 2023
a6a1bf2
progress
RensDofferhoff Apr 5, 2023
a44a893
progress
RensDofferhoff Apr 6, 2023
84807bc
progress
RensDofferhoff Apr 7, 2023
f286ea0
before overhaul
RensDofferhoff Apr 10, 2023
b0c3a38
functional
RensDofferhoff Apr 12, 2023
72b965f
giant oops
RensDofferhoff Apr 12, 2023
6945cab
v1
RensDofferhoff Apr 12, 2023
c94ee85
enabled sounds better
RensDofferhoff Apr 13, 2023
53c39e4
oops
RensDofferhoff Apr 15, 2023
b20d6ae
oops
RensDofferhoff Apr 15, 2023
d71aaa2
oops
RensDofferhoff Apr 16, 2023
c826d3d
constant access improvements
RensDofferhoff Apr 18, 2023
2d54356
add option locking
RensDofferhoff Apr 18, 2023
d56c6d3
oops
RensDofferhoff May 11, 2023
0dd5bbf
progress
RensDofferhoff May 12, 2023
3ed5704
factory
RensDofferhoff May 12, 2023
bb506d6
more extendable this way
RensDofferhoff May 15, 2023
8d58dd8
a small comment never hurts
RensDofferhoff May 15, 2023
f431a57
add toml
RensDofferhoff May 16, 2023
8a8df43
forgot the parser lib
RensDofferhoff May 16, 2023
a58c026
Documentation for analysis writers
RensDofferhoff May 17, 2023
8a232b9
Update jasp-qml-guide.md
RensDofferhoff May 22, 2023
c976461
dont change the submodule commits
RensDofferhoff May 22, 2023
311866d
added local conf browser
RensDofferhoff May 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
post rebase fix 7-12-22
resize the resize data dialog a bit
made sure emptyvalue labels are not put in the editItem
  • Loading branch information
JorisGoosen committed May 16, 2023
commit 8a496305af726bc92ec360074d165afe29112af2
3 changes: 2 additions & 1 deletion CommonData/columnutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

#include <string>
#include <vector>

#include <set>
#include <map>

class ColumnUtils
{
Expand Down
49 changes: 24 additions & 25 deletions Desktop/components/JASP/Widgets/ResizeDataDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Popup

Item
{
height: resizeButton.y + resizeButton.height + jaspTheme.generalAnchorMargin
width: inputs.width
height: inputs.height + jaspTheme.generalAnchorMargin + (40 * jaspTheme.uiScale)
width: 250 * jaspTheme.uiScale

Component.onCompleted: cols.forceActiveFocus();

Expand All @@ -62,8 +62,7 @@ Popup
Item
{
id: inputs
width: 200 * jaspTheme.uiScale
height: cols.y + cols.height + jaspTheme.generalAnchorMargin
height: 100 * jaspTheme.uiScale + 2 * jaspTheme.generalAnchorMargin

anchors
{
Expand All @@ -79,9 +78,8 @@ Popup
text: qsTr("Columns")
anchors
{
top: inputs.top
left: cols.left
right: cols.right
top: inputs.top
horizontalCenter: cols.horizontalCenter
}
}

Expand All @@ -91,9 +89,8 @@ Popup
text: qsTr("Rows")
anchors
{
top: inputs.top
left: rows.left
right: rows.right
top: inputs.top
horizontalCenter: rows.horizontalCenter
}
}

Expand All @@ -103,7 +100,12 @@ Popup
text: "X"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
anchors.centerIn: parent
anchors
{
top: colsLabel.bottom
horizontalCenter: parent.horizontalCenter
topMargin: jaspTheme.generalAnchorMargin
}
}

IntegerField
Expand All @@ -113,13 +115,13 @@ Popup
fieldWidth: width
anchors
{
top: x.verticalCenter
top: x.bottom
left: parent.left
right: x.left
margins: jaspTheme.generalAnchorMargin
}

//KeyNavigation.tab: rows
KeyNavigation.tab: rows
KeyNavigation.right: rows
KeyNavigation.down: resizeButton
}
Expand All @@ -131,14 +133,13 @@ Popup
fieldWidth: width
anchors
{
top: x.verticalCenter
top: x.bottom
left: x.right
right: parent.right
margins: jaspTheme.generalAnchorMargin
}
KeyNavigation.down: resizeButton
KeyNavigation.right: resizeButton
//KeyNavigation.tab: resizeButton
KeyNavigation.down: closeButtonCross
KeyNavigation.tab: resizeButton
}
}

Expand All @@ -149,15 +150,12 @@ Popup
text: qsTr("Resize")
onClicked: { dataSetModel.resizeData(rows.value, cols.value); popupResizeData.close(); }
toolTip: qsTr("Resize data to set values")
KeyNavigation.right: closeButtonCross
//KeyNavigation.tab: closeButtonCross
//KeyNavigation.backtab: rows
KeyNavigation.left: rows
KeyNavigation.up: cols

KeyNavigation.tab: closeButtonCross

anchors
{
top: inputs.bottom
bottom: inputs.bottom
margins: jaspTheme.generalAnchorMargin
left: parent.left
right: closeButtonCross.left
Expand All @@ -173,11 +171,12 @@ Popup
height: resizeButton.height
onClicked: popupResizeData.close()
toolTip: qsTr("Close without resizing data")
KeyNavigation.up: rows
KeyNavigation.tab: cols

anchors
{
right: parent.right
top: inputs.bottom
bottom: inputs.bottom
margins: jaspTheme.generalAnchorMargin
}
}
Expand Down
5 changes: 3 additions & 2 deletions Desktop/data/datasetpackage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "timers.h"
#include "utilities/appdirs.h"
#include "utils.h"
#include "columnutils.h"
#include "utilities/messageforwarder.h"
#include "datasetpackagesubnodemodel.h"
#include "databaseconnectioninfo.h"
Expand Down Expand Up @@ -1128,13 +1129,13 @@ void DataSetPackage::initColumnWithStrings(QVariant colId, std::string newName,
bool useCustomThreshold = Settings::value(Settings::USE_CUSTOM_THRESHOLD_SCALE).toBool();
size_t thresholdScale = (useCustomThreshold ? Settings::value(Settings::THRESHOLD_SCALE) : Settings::defaultValue(Settings::THRESHOLD_SCALE)).toUInt();

bool valuesAreIntegers = Utils::convertVecToInt(values, intValues, uniqueValues, emptyValuesMap);
bool valuesAreIntegers = ColumnUtils::convertVecToInt(values, intValues, uniqueValues, emptyValuesMap);

size_t minIntForThresh = thresholdScale > 2 ? 2 : 0;

auto isNominalInt = [&](){ return valuesAreIntegers && uniqueValues.size() == minIntForThresh; };
auto isOrdinal = [&](){ return valuesAreIntegers && uniqueValues.size() > minIntForThresh && uniqueValues.size() <= thresholdScale; };
auto isScalar = [&](){ return Utils::convertVecToDouble(values, doubleValues, emptyValuesMap); };
auto isScalar = [&](){ return ColumnUtils::convertVecToDouble(values, doubleValues, emptyValuesMap); };

if (isOrdinal()) initColumnAsNominalOrOrdinal( colId, newName, intValues, true );
else if (isNominalInt()) initColumnAsNominalOrOrdinal( colId, newName, intValues, false );
Expand Down
11 changes: 8 additions & 3 deletions Desktop/qquick/datasetview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <QGuiApplication>
#include <QClipboard>
#include "utils.h"
#include "columnutils.h"
#include "utilities/languagemodel.h"
#include "data/datasettablemodel.h"

Expand Down Expand Up @@ -938,7 +939,7 @@ void DataSetView::positionEditItem(int row, int col)

if(!_editItemContextual)
{
_editItemContextual = new ItemContextualized(setStyleDataItem(nullptr, active, col, row));
_editItemContextual = new ItemContextualized(setStyleDataItem(nullptr, active, col, row, false));

//forceActiveFocus();

Expand All @@ -960,7 +961,7 @@ void DataSetView::positionEditItem(int row, int col)
else
{
//Log::log() << "repositioning current edit item (row=" << row << ", col=" << col << ")" << std::endl;
setStyleDataItem(_editItemContextual->context, active, col, row);
setStyleDataItem(_editItemContextual->context, active, col, row, false);
}

setTextItemInfo(row, col, _editItemContextual->item); //Will set it visible
Expand Down Expand Up @@ -1322,7 +1323,7 @@ void DataSetView::contextMenuClickedAtIndex(QModelIndex index)
_selectionModel->select(index, QItemSelectionModel::SelectCurrent);
}

QQmlContext * DataSetView::setStyleDataItem(QQmlContext * previousContext, bool active, size_t col, size_t row)
QQmlContext * DataSetView::setStyleDataItem(QQmlContext * previousContext, bool active, size_t col, size_t row, bool emptyValLabel)
{
QModelIndex idx = _model->index(row, col);

Expand All @@ -1333,6 +1334,9 @@ QQmlContext * DataSetView::setStyleDataItem(QQmlContext * previousContext, bool

QString text = _storedDisplayText[row][col];

if(text == tq(ColumnUtils::emptyValue) && !emptyValLabel)
text = "";

if(previousContext == nullptr)
previousContext = new QQmlContext(qmlContext(this), this);

Expand Down Expand Up @@ -1572,6 +1576,7 @@ QSGNode * DataSetView::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
currentNode->setFlag(QSGNode::OwnsMaterial, false);
currentNode->setFlag(QSGNode::OwnsGeometry, true);
currentNode->setMaterial(&_material);
currentNode->setRenderOrder(100);

justAdded = true;

Expand Down
2 changes: 1 addition & 1 deletion Desktop/qquick/datasetview.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public slots:
void updateExtraColumnItem();
void positionEditItem( int row, int col);

QQmlContext * setStyleDataItem( QQmlContext * previousContext, bool active, size_t col, size_t row);
QQmlContext * setStyleDataItem( QQmlContext * previousContext, bool active, size_t col, size_t row, bool emptyValLabel = true);
QQmlContext * setStyleDataRowNumber( QQmlContext * previousContext, QString text, int row);
QQmlContext * setStyleDataColumnHeader( QQmlContext * previousContext, QString text, int column, bool isComputed, bool isInvalidated, bool isFiltered, QString computedError, int columnType);

Expand Down
2 changes: 2 additions & 0 deletions QMLComponents/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ target_include_directories(
QMLComponents
PUBLIC # JASP
${PROJECT_SOURCE_DIR}/Common
${PROJECT_SOURCE_DIR}/CommonData
)

target_link_libraries(
QMLComponents
PUBLIC
Common
CommonData
Qt::Core
Qt::Gui
Qt::Widgets
Expand Down
1 change: 1 addition & 0 deletions QMLComponents/controls/textinputbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "textinputbase.h"
#include "analysisform.h"
#include "utils.h"
#include "columnutils.h"

using namespace std;

Expand Down