Update parts in use category after changes. Fixes #890.
This commit is contained in:
@@ -2297,6 +2297,11 @@ void lcMainWindow::UpdateModels()
|
||||
SetCurrentPieceInfo(nullptr);
|
||||
}
|
||||
|
||||
void lcMainWindow::UpdateInUseCategory()
|
||||
{
|
||||
mPartSelectionWidget->UpdateInUseCategory();
|
||||
}
|
||||
|
||||
void lcMainWindow::UpdateCategories()
|
||||
{
|
||||
mPartSelectionWidget->UpdateCategories();
|
||||
|
||||
@@ -272,6 +272,7 @@ public:
|
||||
void UpdateShadingMode();
|
||||
void UpdateSelectionMode();
|
||||
void UpdateModels();
|
||||
void UpdateInUseCategory();
|
||||
void UpdateCategories();
|
||||
void UpdateTitle();
|
||||
void UpdateModified(bool Modified);
|
||||
|
||||
+10
-1
@@ -2355,9 +2355,12 @@ void lcModel::DeleteSelectedObjects()
|
||||
{
|
||||
if (RemoveSelectedObjects())
|
||||
{
|
||||
if (!mIsPreview) {
|
||||
if (!mIsPreview)
|
||||
{
|
||||
gMainWindow->UpdateTimeline(false, false);
|
||||
gMainWindow->UpdateSelectedObjects(true);
|
||||
gMainWindow->UpdateInUseCategory();
|
||||
|
||||
UpdateAllViews();
|
||||
SaveCheckpoint(tr("Deleting"));
|
||||
}
|
||||
@@ -3182,6 +3185,12 @@ void lcModel::SetObjectsProperty(const std::vector<lcObject*>& Objects, lcObject
|
||||
{
|
||||
gMainWindow->UpdateTimeline(false, true);
|
||||
}
|
||||
|
||||
// todo: fix hacky category update
|
||||
if (PropertyId == lcObjectPropertyId::PieceId)
|
||||
{
|
||||
gMainWindow->UpdateInUseCategory();
|
||||
}
|
||||
}
|
||||
|
||||
bool lcModel::AnyPiecesSelected() const
|
||||
|
||||
@@ -581,6 +581,12 @@ void lcPartSelectionListView::ToggleFixedColor()
|
||||
mListModel->ToggleColorLocked();
|
||||
}
|
||||
|
||||
void lcPartSelectionListView::UpdateInUseCategory()
|
||||
{
|
||||
if (mCategoryType == lcPartCategoryType::PartsInUse)
|
||||
mListModel->SetCurrentModelCategory();
|
||||
}
|
||||
|
||||
void lcPartSelectionListView::UpdateViewMode()
|
||||
{
|
||||
setViewMode(mListModel->GetIconSize() && !mListModel->IsListMode() ? QListView::IconMode : QListView::ListMode);
|
||||
@@ -1112,6 +1118,11 @@ void lcPartSelectionWidget::RemoveFromPalette()
|
||||
}
|
||||
}
|
||||
|
||||
void lcPartSelectionWidget::UpdateInUseCategory()
|
||||
{
|
||||
mPartsWidget->UpdateInUseCategory();
|
||||
}
|
||||
|
||||
void lcPartSelectionWidget::UpdateCategories()
|
||||
{
|
||||
QTreeWidgetItem* CurrentItem = mCategoriesWidget->currentItem();
|
||||
|
||||
@@ -177,6 +177,7 @@ public:
|
||||
return mContextInfo;
|
||||
}
|
||||
|
||||
void UpdateInUseCategory();
|
||||
void UpdateViewMode();
|
||||
|
||||
public slots:
|
||||
@@ -212,6 +213,7 @@ public:
|
||||
void UpdateThumbnails();
|
||||
void SetDefaultPart();
|
||||
void UpdateModels();
|
||||
void UpdateInUseCategory();
|
||||
void UpdateCategories();
|
||||
void LoadState(QSettings& Settings);
|
||||
void SaveState(QSettings& Settings);
|
||||
|
||||
Reference in New Issue
Block a user