diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 206abd2..8dc41a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,18 +17,19 @@ jobs: os: [windows-latest, macOS-latest, ubuntu-latest] steps: - name: Download Submodules - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - - name: Install Python 3.X version - uses: actions/setup-python@v4 - with: - python-version: '3.10' - architecture: 'x64' + # - name: Install Python 3.X version + # uses: actions/setup-python@v5 + # with: + # python-version: '3.10' + # architecture: 'x64' + # they put setup python logic inside install-qt-action - name: Install Qt - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 with: version: 6.4.2 @@ -39,7 +40,7 @@ jobs: - name: Build WL4Editor on Windows if: startsWith(matrix.os, 'windows') run: | - dir %Qt6_Dir%/lib/cmake + dir %QT_ROOT_DIR%/lib/cmake qmake WL4Editor.pro nmake debug shell: cmd @@ -47,7 +48,7 @@ jobs: - name: Build WL4Editor on *nix if: (!startsWith(matrix.os, 'windows')) run: | - ls "$Qt6_DIR/lib/cmake" + ls "${QT_ROOT_DIR}/lib/cmake" qmake WL4Editor.pro make shell: bash diff --git a/.gitignore b/.gitignore index 70f33b7..ad9c75f 100644 --- a/.gitignore +++ b/.gitignore @@ -69,3 +69,6 @@ vgcore.* .vscode *.aps *.rc + +# Qt 6 build folder +build/ diff --git a/DockWidget/CameraControlDockWidget.cpp b/DockWidget/CameraControlDockWidget.cpp index b653d06..afe8a49 100644 --- a/DockWidget/CameraControlDockWidget.cpp +++ b/DockWidget/CameraControlDockWidget.cpp @@ -237,21 +237,15 @@ void CameraControlDockWidget::ClearListView() } } + /// -/// Be called the listview is clicked and a limitator is selected. +/// Update all those spinboxes values and max/min properties by using the Room size and the limitator properties. /// -/// -/// Reference of the selected QModelIndex from the listview. -/// -void CameraControlDockWidget::on_CameraLimitators_listView_clicked(const QModelIndex &index) +void CameraControlDockWidget::UpdateSpinboxesByListviewItemID(int item_id) { - IsSavingData = false; - ui->ExistingLimitators_groupBox->setEnabled(false); std::vector currentCameraLimitators = currentRoom->GetCameraControlRecords(); - int linenum = index.row(); - SelectedLimitator = linenum; - LevelComponents::__CameraControlRecord *currentLimitator = currentCameraLimitators[linenum]; + LevelComponents::__CameraControlRecord *currentLimitator = currentCameraLimitators[item_id]; int currentLimitatorTypeid = (currentLimitator->ChangeValueOffset == 0xFF ? -1 : currentLimitator->ChangeValueOffset); ui->CameraLimitatorTypePicker_comboBox->setCurrentIndex(currentLimitatorTypeid + 1); @@ -290,6 +284,21 @@ void CameraControlDockWidget::on_CameraLimitators_listView_clicked(const QModelI ui->TriggerBlockPositionY_spinBox->setEnabled(false); } SetCurrentLimitator(); // only used to set maximums for all the spinboxes +} + +/// +/// Be called the listview is clicked and a limitator is selected. +/// +/// +/// Reference of the selected QModelIndex from the listview. +/// +void CameraControlDockWidget::on_CameraLimitators_listView_clicked(const QModelIndex &index) +{ + IsSavingData = false; + ui->ExistingLimitators_groupBox->setEnabled(false); + int linenum = index.row(); + SelectedLimitator = linenum; + UpdateSpinboxesByListviewItemID(linenum); ui->ExistingLimitators_groupBox->setEnabled(true); IsSavingData = true; } @@ -513,6 +522,14 @@ void CameraControlDockWidget::on_UseCameraLimitators_radioButton_clicked(bool ch // Rerender graphicview in MainWindow singleton->RenderScreenElementsLayersUpdate((unsigned int) -1, -1); + + // Now we select the first item in the listview as default + IsSavingData = false; + ui->ExistingLimitators_groupBox->setEnabled(false); + SelectedLimitator = 0; + UpdateSpinboxesByListviewItemID(0); + ui->ExistingLimitators_groupBox->setEnabled(true); + IsSavingData = true; } singleton->SetUnsavedChanges(true); diff --git a/DockWidget/CameraControlDockWidget.h b/DockWidget/CameraControlDockWidget.h index ba6de29..8c493c6 100644 --- a/DockWidget/CameraControlDockWidget.h +++ b/DockWidget/CameraControlDockWidget.h @@ -30,6 +30,7 @@ class CameraControlDockWidget : public QDockWidget int CurrentRoomHeight = 0; bool IsSavingData = false; void SetCurrentLimitator(); + void UpdateSpinboxesByListviewItemID(int item_id); void SetListviewItemText(int row); void PaintListView(); void ClearListView();