mirror of
https://github.com/leozide/leocad
synced 2025-01-30 20:34:56 +01:00
Support multiple part sets.
This commit is contained in:
parent
7b21d4af0b
commit
aa28254a37
6 changed files with 344 additions and 182 deletions
|
@ -1836,15 +1836,14 @@ void lcPiecesLibrary::GetParts(lcArray<PieceInfo*>& Parts) const
|
||||||
Parts.Add(PartIt.second);
|
Parts.Add(PartIt.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<PieceInfo*> lcPiecesLibrary::GetFavorites() const
|
std::vector<PieceInfo*> lcPiecesLibrary::GetPartsFromSet(const std::vector<std::string>& PartIds) const
|
||||||
{
|
{
|
||||||
QStringList Favorites = lcGetProfileStringList(LC_PROFILE_LIBRARY_FAVORITES);
|
|
||||||
std::vector<PieceInfo*> Parts;
|
std::vector<PieceInfo*> Parts;
|
||||||
Parts.reserve(Favorites.size());
|
Parts.reserve(PartIds.size());
|
||||||
|
|
||||||
for (const QString& Favorite : Favorites)
|
for (const std::string& PartId : PartIds)
|
||||||
{
|
{
|
||||||
std::map<std::string, PieceInfo*>::const_iterator PartIt = mPieces.find(Favorite.toStdString());
|
std::map<std::string, PieceInfo*>::const_iterator PartIt = mPieces.find(PartId);
|
||||||
|
|
||||||
if (PartIt != mPieces.end())
|
if (PartIt != mPieces.end())
|
||||||
Parts.push_back(PartIt->second);
|
Parts.push_back(PartIt->second);
|
||||||
|
@ -1853,53 +1852,17 @@ std::vector<PieceInfo*> lcPiecesLibrary::GetFavorites() const
|
||||||
return Parts;
|
return Parts;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lcPiecesLibrary::IsFavorite(const PieceInfo* Info) const
|
std::string lcPiecesLibrary::GetPartId(const PieceInfo* Info) const
|
||||||
{
|
{
|
||||||
std::map<std::string, PieceInfo*>::const_iterator PartIt = std::find_if(mPieces.begin(), mPieces.end(), [Info](const std::pair<std::string, PieceInfo*>& PartIt)
|
std::map<std::string, PieceInfo*>::const_iterator PartIt = std::find_if(mPieces.begin(), mPieces.end(), [Info](const std::pair<std::string, PieceInfo*>& PartIt)
|
||||||
{
|
{
|
||||||
return PartIt.second == Info;
|
return PartIt.second == Info;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (PartIt == mPieces.end())
|
if (PartIt != mPieces.end())
|
||||||
return false;
|
return PartIt->first;
|
||||||
|
else
|
||||||
QStringList Favorites = lcGetProfileStringList(LC_PROFILE_LIBRARY_FAVORITES);
|
return std::string();
|
||||||
|
|
||||||
return Favorites.contains(QString::fromStdString(PartIt->first));
|
|
||||||
}
|
|
||||||
|
|
||||||
void lcPiecesLibrary::AddToFavorites(const PieceInfo* Info) const
|
|
||||||
{
|
|
||||||
std::map<std::string, PieceInfo*>::const_iterator PartIt = std::find_if(mPieces.begin(), mPieces.end(), [Info](const std::pair<std::string, PieceInfo*>& PartIt)
|
|
||||||
{
|
|
||||||
return PartIt.second == Info;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (PartIt == mPieces.end())
|
|
||||||
return;
|
|
||||||
|
|
||||||
QStringList Favorites = lcGetProfileStringList(LC_PROFILE_LIBRARY_FAVORITES);
|
|
||||||
|
|
||||||
Favorites.append(QString::fromStdString(PartIt->first));
|
|
||||||
|
|
||||||
lcSetProfileStringList(LC_PROFILE_LIBRARY_FAVORITES, Favorites);
|
|
||||||
}
|
|
||||||
|
|
||||||
void lcPiecesLibrary::RemoveFromFavorites(const PieceInfo* Info) const
|
|
||||||
{
|
|
||||||
std::map<std::string, PieceInfo*>::const_iterator PartIt = std::find_if(mPieces.begin(), mPieces.end(), [Info](const std::pair<std::string, PieceInfo*>& PartIt)
|
|
||||||
{
|
|
||||||
return PartIt.second == Info;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (PartIt == mPieces.end())
|
|
||||||
return;
|
|
||||||
|
|
||||||
QStringList Favorites = lcGetProfileStringList(LC_PROFILE_LIBRARY_FAVORITES);
|
|
||||||
|
|
||||||
Favorites.removeOne(QString::fromStdString(PartIt->first));
|
|
||||||
|
|
||||||
lcSetProfileStringList(LC_PROFILE_LIBRARY_FAVORITES, Favorites);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lcPiecesLibrary::LoadBuiltinPieces()
|
bool lcPiecesLibrary::LoadBuiltinPieces()
|
||||||
|
|
|
@ -103,10 +103,8 @@ public:
|
||||||
void GetPatternedPieces(PieceInfo* Parent, lcArray<PieceInfo*>& Pieces) const;
|
void GetPatternedPieces(PieceInfo* Parent, lcArray<PieceInfo*>& Pieces) const;
|
||||||
void GetParts(lcArray<PieceInfo*>& Parts) const;
|
void GetParts(lcArray<PieceInfo*>& Parts) const;
|
||||||
|
|
||||||
std::vector<PieceInfo*> GetFavorites() const;
|
std::vector<PieceInfo*> GetPartsFromSet(const std::vector<std::string>& PartIds) const;
|
||||||
bool IsFavorite(const PieceInfo* Info) const;
|
std::string GetPartId(const PieceInfo* Info) const;
|
||||||
void AddToFavorites(const PieceInfo* Info) const;
|
|
||||||
void RemoveFromFavorites(const PieceInfo* Info) const;
|
|
||||||
|
|
||||||
void GetPrimitiveFile(lcLibraryPrimitive* Primitive, std::function<void(lcFile& File)> Callback);
|
void GetPrimitiveFile(lcLibraryPrimitive* Primitive, std::function<void(lcFile& File)> Callback);
|
||||||
void GetPieceFile(const char* FileName, std::function<void(lcFile& File)> Callback);
|
void GetPieceFile(const char* FileName, std::function<void(lcFile& File)> Callback);
|
||||||
|
|
|
@ -185,7 +185,7 @@ void lcPartSelectionListModel::SetModelsCategory()
|
||||||
SetFilter(mFilter);
|
SetFilter(mFilter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcPartSelectionListModel::SetFavoritesCategory()
|
void lcPartSelectionListModel::SetCustomSetCategory(int SetIndex)
|
||||||
{
|
{
|
||||||
ClearRequests();
|
ClearRequests();
|
||||||
|
|
||||||
|
@ -193,18 +193,20 @@ void lcPartSelectionListModel::SetFavoritesCategory()
|
||||||
|
|
||||||
mParts.clear();
|
mParts.clear();
|
||||||
|
|
||||||
std::vector<PieceInfo*> Favorites = lcGetPiecesLibrary()->GetFavorites();
|
lcPartSelectionWidget* PartSelectionWidget = mListView->GetPartSelectionWidget();
|
||||||
|
const std::vector<lcPartCategoryCustomSet>& CustomSets = PartSelectionWidget->GetCustomSets();
|
||||||
|
std::vector<PieceInfo*> PartsList = lcGetPiecesLibrary()->GetPartsFromSet(CustomSets[SetIndex].Parts);
|
||||||
|
|
||||||
auto lcPartSortFunc = [](const PieceInfo* a, const PieceInfo* b)
|
auto lcPartSortFunc = [](const PieceInfo* a, const PieceInfo* b)
|
||||||
{
|
{
|
||||||
return strcmp(a->m_strDescription, b->m_strDescription) < 0;
|
return strcmp(a->m_strDescription, b->m_strDescription) < 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::sort(Favorites.begin(), Favorites.end(), lcPartSortFunc);
|
std::sort(PartsList.begin(), PartsList.end(), lcPartSortFunc);
|
||||||
|
|
||||||
mParts.reserve(Favorites.size());
|
mParts.reserve(PartsList.size());
|
||||||
|
|
||||||
for (PieceInfo* Favorite : Favorites)
|
for (PieceInfo* Favorite : PartsList)
|
||||||
mParts.emplace_back(QPair<PieceInfo*, QPixmap>(Favorite, QPixmap()));
|
mParts.emplace_back(QPair<PieceInfo*, QPixmap>(Favorite, QPixmap()));
|
||||||
|
|
||||||
endResetModel();
|
endResetModel();
|
||||||
|
@ -479,9 +481,13 @@ void lcPartSelectionListModel::SetShowPartNames(bool Show)
|
||||||
SetFilter(mFilter);
|
SetFilter(mFilter);
|
||||||
}
|
}
|
||||||
|
|
||||||
lcPartSelectionListView::lcPartSelectionListView(QWidget* Parent)
|
lcPartSelectionListView::lcPartSelectionListView(QWidget* Parent, lcPartSelectionWidget* PartSelectionWidget)
|
||||||
: QListView(Parent)
|
: QListView(Parent)
|
||||||
{
|
{
|
||||||
|
mPartSelectionWidget = PartSelectionWidget;
|
||||||
|
mCategoryType = lcPartCategoryType::AllParts;
|
||||||
|
mCategoryIndex = 0;
|
||||||
|
|
||||||
setUniformItemSizes(true);
|
setUniformItemSizes(true);
|
||||||
setResizeMode(QListView::Adjust);
|
setResizeMode(QListView::Adjust);
|
||||||
setWordWrap(false);
|
setWordWrap(false);
|
||||||
|
@ -493,7 +499,9 @@ lcPartSelectionListView::lcPartSelectionListView(QWidget* Parent)
|
||||||
lcPartSelectionItemDelegate* ItemDelegate = new lcPartSelectionItemDelegate(this, mListModel);
|
lcPartSelectionItemDelegate* ItemDelegate = new lcPartSelectionItemDelegate(this, mListModel);
|
||||||
setItemDelegate(ItemDelegate);
|
setItemDelegate(ItemDelegate);
|
||||||
|
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||||
connect(this, SIGNAL(customContextMenuRequested(QPoint)), SLOT(CustomContextMenuRequested(QPoint)));
|
connect(this, SIGNAL(customContextMenuRequested(QPoint)), SLOT(CustomContextMenuRequested(QPoint)));
|
||||||
|
#endif
|
||||||
|
|
||||||
SetIconSize(lcGetProfileInt(LC_PROFILE_PARTS_LIST_ICONS));
|
SetIconSize(lcGetProfileInt(LC_PROFILE_PARTS_LIST_ICONS));
|
||||||
}
|
}
|
||||||
|
@ -502,86 +510,58 @@ void lcPartSelectionListView::CustomContextMenuRequested(QPoint Pos)
|
||||||
{
|
{
|
||||||
QMenu* Menu = new QMenu(this);
|
QMenu* Menu = new QMenu(this);
|
||||||
|
|
||||||
mContextInfo = nullptr;
|
|
||||||
QModelIndex Index = indexAt(Pos);
|
QModelIndex Index = indexAt(Pos);
|
||||||
|
mContextInfo = Index.isValid() ? mListModel->GetPieceInfo(Index.row()) : nullptr;
|
||||||
|
|
||||||
if (Index.isValid())
|
QMenu* SetMenu = Menu->addMenu(tr("Add to Set"));
|
||||||
{
|
|
||||||
mContextInfo = mListModel->GetPieceInfo(Index.row());
|
|
||||||
|
|
||||||
if (mContextInfo)
|
const std::vector<lcPartCategoryCustomSet>& CustomSets = mPartSelectionWidget->GetCustomSets();
|
||||||
|
|
||||||
|
if (!CustomSets.empty())
|
||||||
{
|
{
|
||||||
if (!lcGetPiecesLibrary()->IsFavorite(mContextInfo))
|
for (const lcPartCategoryCustomSet& Set : CustomSets)
|
||||||
Menu->addAction(tr("Add to Favorites"), this, SLOT(AddToFavorites()));
|
SetMenu->addAction(Set.Name, mPartSelectionWidget, SLOT(AddToSet()));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
Menu->addAction(tr("Remove from Favorites"), this, SLOT(RemoveFromFavorites()));
|
|
||||||
|
|
||||||
Menu->addSeparator();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gSupportsFramebufferObjectARB || gSupportsFramebufferObjectEXT)
|
|
||||||
{
|
{
|
||||||
QActionGroup* IconGroup = new QActionGroup(Menu);
|
QAction* Action = SetMenu->addAction(tr("None"));
|
||||||
|
Action->setEnabled(false);
|
||||||
QAction* NoIcons = Menu->addAction(tr("No Icons"), this, SLOT(SetNoIcons()));
|
|
||||||
NoIcons->setCheckable(true);
|
|
||||||
NoIcons->setChecked(mListModel->GetIconSize() == 0);
|
|
||||||
IconGroup->addAction(NoIcons);
|
|
||||||
|
|
||||||
QAction* SmallIcons = Menu->addAction(tr("Small Icons"), this, SLOT(SetSmallIcons()));
|
|
||||||
SmallIcons->setCheckable(true);
|
|
||||||
SmallIcons->setChecked(mListModel->GetIconSize() == 32);
|
|
||||||
IconGroup->addAction(SmallIcons);
|
|
||||||
|
|
||||||
QAction* MediumIcons = Menu->addAction(tr("Medium Icons"), this, SLOT(SetMediumIcons()));
|
|
||||||
MediumIcons->setCheckable(true);
|
|
||||||
MediumIcons->setChecked(mListModel->GetIconSize() == 64);
|
|
||||||
IconGroup->addAction(MediumIcons);
|
|
||||||
|
|
||||||
QAction* LargeIcons = Menu->addAction(tr("Large Icons"), this, SLOT(SetLargeIcons()));
|
|
||||||
LargeIcons->setCheckable(true);
|
|
||||||
LargeIcons->setChecked(mListModel->GetIconSize() == 96);
|
|
||||||
IconGroup->addAction(LargeIcons);
|
|
||||||
|
|
||||||
QAction* ExtraLargeIcons = Menu->addAction(tr("Extra Large Icons"), this, SLOT(SetExtraLargeIcons()));
|
|
||||||
ExtraLargeIcons->setCheckable(true);
|
|
||||||
ExtraLargeIcons->setChecked(mListModel->GetIconSize() == 192);
|
|
||||||
IconGroup->addAction(ExtraLargeIcons);
|
|
||||||
|
|
||||||
Menu->addSeparator();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mListModel->GetIconSize() != 0 && !mListModel->IsListMode())
|
QAction* RemoveAction = Menu->addAction(tr("Remove from Set"), mPartSelectionWidget, SLOT(RemoveFromSet()));
|
||||||
{
|
RemoveAction->setEnabled(mCategoryType == lcPartCategoryType::CustomSet);
|
||||||
QAction* PartNames = Menu->addAction(tr("Show Part Names"), this, SLOT(TogglePartNames()));
|
|
||||||
PartNames->setCheckable(true);
|
|
||||||
PartNames->setChecked(mListModel->GetShowPartNames());
|
|
||||||
}
|
|
||||||
|
|
||||||
QAction* DecoratedParts = Menu->addAction(tr("Show Decorated Parts"), this, SLOT(ToggleDecoratedParts()));
|
|
||||||
DecoratedParts->setCheckable(true);
|
|
||||||
DecoratedParts->setChecked(mListModel->GetShowDecoratedParts());
|
|
||||||
|
|
||||||
QAction* PartAliases = Menu->addAction(tr("Show Part Aliases"), this, SLOT(TogglePartAliases()));
|
|
||||||
PartAliases->setCheckable(true);
|
|
||||||
PartAliases->setChecked(mListModel->GetShowPartAliases());
|
|
||||||
|
|
||||||
if (mListModel->GetIconSize() != 0)
|
|
||||||
{
|
|
||||||
QAction* ListMode = Menu->addAction(tr("List Mode"), this, SLOT(ToggleListMode()));
|
|
||||||
ListMode->setCheckable(true);
|
|
||||||
ListMode->setChecked(mListModel->IsListMode());
|
|
||||||
|
|
||||||
QAction* FixedColor = Menu->addAction(tr("Lock Preview Color"), this, SLOT(ToggleFixedColor()));
|
|
||||||
FixedColor->setCheckable(true);
|
|
||||||
FixedColor->setChecked(mListModel->IsColorLocked());
|
|
||||||
}
|
|
||||||
|
|
||||||
Menu->exec(viewport()->mapToGlobal(Pos));
|
Menu->exec(viewport()->mapToGlobal(Pos));
|
||||||
delete Menu;
|
delete Menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void lcPartSelectionListView::SetCategory(lcPartCategoryType Type, int Index)
|
||||||
|
{
|
||||||
|
mCategoryType = Type;
|
||||||
|
mCategoryIndex = Index;
|
||||||
|
|
||||||
|
switch (Type)
|
||||||
|
{
|
||||||
|
case lcPartCategoryType::AllParts:
|
||||||
|
mListModel->SetCategory(-1);
|
||||||
|
break;
|
||||||
|
case lcPartCategoryType::PartsInUse:
|
||||||
|
mListModel->SetCurrentModelCategory();
|
||||||
|
break;
|
||||||
|
case lcPartCategoryType::Submodels:
|
||||||
|
mListModel->SetModelsCategory();
|
||||||
|
break;
|
||||||
|
case lcPartCategoryType::CustomSet:
|
||||||
|
mListModel->SetCustomSetCategory(Index);
|
||||||
|
break;
|
||||||
|
case lcPartCategoryType::Category:
|
||||||
|
mListModel->SetCategory(Index);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
setCurrentIndex(mListModel->index(0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
void lcPartSelectionListView::SetNoIcons()
|
void lcPartSelectionListView::SetNoIcons()
|
||||||
{
|
{
|
||||||
SetIconSize(0);
|
SetIconSize(0);
|
||||||
|
@ -638,21 +618,6 @@ void lcPartSelectionListView::ToggleFixedColor()
|
||||||
mListModel->ToggleColorLocked();
|
mListModel->ToggleColorLocked();
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcPartSelectionListView::AddToFavorites()
|
|
||||||
{
|
|
||||||
if (mContextInfo)
|
|
||||||
lcGetPiecesLibrary()->AddToFavorites(mContextInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
void lcPartSelectionListView::RemoveFromFavorites()
|
|
||||||
{
|
|
||||||
if (mContextInfo)
|
|
||||||
{
|
|
||||||
lcGetPiecesLibrary()->RemoveFromFavorites(mContextInfo);
|
|
||||||
emit FavoriteRemoved();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void lcPartSelectionListView::UpdateViewMode()
|
void lcPartSelectionListView::UpdateViewMode()
|
||||||
{
|
{
|
||||||
setViewMode(mListModel->GetIconSize() && !mListModel->IsListMode() ? QListView::IconMode : QListView::ListMode);
|
setViewMode(mListModel->GetIconSize() && !mListModel->IsListMode() ? QListView::IconMode : QListView::ListMode);
|
||||||
|
@ -716,15 +681,28 @@ lcPartSelectionWidget::lcPartSelectionWidget(QWidget* Parent)
|
||||||
PartsLayout->setContentsMargins(0, 0, 0, 0);
|
PartsLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
PartsGroupWidget->setLayout(PartsLayout);
|
PartsGroupWidget->setLayout(PartsLayout);
|
||||||
|
|
||||||
|
QHBoxLayout* SearchLayout = new QHBoxLayout();
|
||||||
|
SearchLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
PartsLayout->addLayout(SearchLayout);
|
||||||
|
|
||||||
mFilterWidget = new QLineEdit(PartsGroupWidget);
|
mFilterWidget = new QLineEdit(PartsGroupWidget);
|
||||||
mFilterWidget->setPlaceholderText(tr("Search Parts"));
|
mFilterWidget->setPlaceholderText(tr("Search Parts"));
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0))
|
||||||
mFilterAction = mFilterWidget->addAction(QIcon(":/resources/parts_search.png"), QLineEdit::TrailingPosition);
|
mFilterAction = mFilterWidget->addAction(QIcon(":/resources/parts_search.png"), QLineEdit::TrailingPosition);
|
||||||
connect(mFilterAction, SIGNAL(triggered()), this, SLOT(FilterTriggered()));
|
connect(mFilterAction, SIGNAL(triggered()), this, SLOT(FilterTriggered()));
|
||||||
#endif
|
#endif
|
||||||
PartsLayout->addWidget(mFilterWidget);
|
SearchLayout->addWidget(mFilterWidget);
|
||||||
|
|
||||||
mPartsWidget = new lcPartSelectionListView(PartsGroupWidget);
|
QToolButton* OptionsButton = new QToolButton();
|
||||||
|
OptionsButton->setText("TEMP");
|
||||||
|
OptionsButton->setPopupMode(QToolButton::InstantPopup);
|
||||||
|
SearchLayout->addWidget(OptionsButton);
|
||||||
|
|
||||||
|
QMenu* OptionsMenu = new QMenu(this);
|
||||||
|
OptionsButton->setMenu(OptionsMenu);
|
||||||
|
connect(OptionsMenu, SIGNAL(aboutToShow()), this, SLOT(OptionsMenuAboutToShow()));
|
||||||
|
|
||||||
|
mPartsWidget = new lcPartSelectionListView(PartsGroupWidget, this);
|
||||||
PartsLayout->addWidget(mPartsWidget);
|
PartsLayout->addWidget(mPartsWidget);
|
||||||
|
|
||||||
QHBoxLayout* Layout = new QHBoxLayout(this);
|
QHBoxLayout* Layout = new QHBoxLayout(this);
|
||||||
|
@ -732,11 +710,11 @@ lcPartSelectionWidget::lcPartSelectionWidget(QWidget* Parent)
|
||||||
Layout->addWidget(mSplitter);
|
Layout->addWidget(mSplitter);
|
||||||
setLayout(Layout);
|
setLayout(Layout);
|
||||||
|
|
||||||
connect(mPartsWidget, SIGNAL(FavoriteRemoved()), this, SLOT(FavoriteRemoved()));
|
|
||||||
connect(mPartsWidget->selectionModel(), SIGNAL(currentChanged(const QModelIndex&, const QModelIndex&)), this, SLOT(PartChanged(const QModelIndex&, const QModelIndex&)));
|
connect(mPartsWidget->selectionModel(), SIGNAL(currentChanged(const QModelIndex&, const QModelIndex&)), this, SLOT(PartChanged(const QModelIndex&, const QModelIndex&)));
|
||||||
connect(mFilterWidget, SIGNAL(textChanged(const QString&)), this, SLOT(FilterChanged(const QString&)));
|
connect(mFilterWidget, SIGNAL(textChanged(const QString&)), this, SLOT(FilterChanged(const QString&)));
|
||||||
connect(mCategoriesWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(CategoryChanged(QTreeWidgetItem*, QTreeWidgetItem*)));
|
connect(mCategoriesWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(CategoryChanged(QTreeWidgetItem*, QTreeWidgetItem*)));
|
||||||
|
|
||||||
|
LoadCustomSets();
|
||||||
UpdateCategories();
|
UpdateCategories();
|
||||||
|
|
||||||
mSplitter->setStretchFactor(0, 0);
|
mSplitter->setStretchFactor(0, 0);
|
||||||
|
@ -842,20 +820,14 @@ void lcPartSelectionWidget::FilterTriggered()
|
||||||
void lcPartSelectionWidget::CategoryChanged(QTreeWidgetItem* Current, QTreeWidgetItem* Previous)
|
void lcPartSelectionWidget::CategoryChanged(QTreeWidgetItem* Current, QTreeWidgetItem* Previous)
|
||||||
{
|
{
|
||||||
Q_UNUSED(Previous);
|
Q_UNUSED(Previous);
|
||||||
lcPartSelectionListModel* ListModel = mPartsWidget->GetListModel();
|
|
||||||
|
|
||||||
if (Current == mModelsCategoryItem)
|
if (!Current)
|
||||||
ListModel->SetModelsCategory();
|
return;
|
||||||
else if (Current == mCurrentModelCategoryItem)
|
|
||||||
ListModel->SetCurrentModelCategory();
|
|
||||||
else if (Current == mFavoritesCategoryItem)
|
|
||||||
ListModel->SetFavoritesCategory();
|
|
||||||
else if (Current == mAllPartsCategoryItem)
|
|
||||||
ListModel->SetCategory(-1);
|
|
||||||
else
|
|
||||||
ListModel->SetCategory(mCategoriesWidget->indexOfTopLevelItem(Current) - 3);
|
|
||||||
|
|
||||||
mPartsWidget->setCurrentIndex(ListModel->index(0, 0));
|
int Type = Current->data(0, static_cast<int>(lcPartCategoryRole::Type)).toInt();
|
||||||
|
int Index = Current->data(0, static_cast<int>(lcPartCategoryRole::Index)).toInt();
|
||||||
|
|
||||||
|
mPartsWidget->SetCategory(static_cast<lcPartCategoryType>(Type), Index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcPartSelectionWidget::PartChanged(const QModelIndex& Current, const QModelIndex& Previous)
|
void lcPartSelectionWidget::PartChanged(const QModelIndex& Current, const QModelIndex& Previous)
|
||||||
|
@ -866,10 +838,70 @@ void lcPartSelectionWidget::PartChanged(const QModelIndex& Current, const QModel
|
||||||
gMainWindow->SetCurrentPieceInfo(mPartsWidget->GetCurrentPart());
|
gMainWindow->SetCurrentPieceInfo(mPartsWidget->GetCurrentPart());
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcPartSelectionWidget::FavoriteRemoved()
|
void lcPartSelectionWidget::OptionsMenuAboutToShow()
|
||||||
{
|
{
|
||||||
if (mCategoriesWidget->currentItem() == mFavoritesCategoryItem)
|
QMenu* Menu = (QMenu*)sender();
|
||||||
mPartsWidget->GetListModel()->SetFavoritesCategory();
|
Menu->clear();
|
||||||
|
|
||||||
|
lcPartSelectionListModel* ListModel = mPartsWidget->GetListModel();
|
||||||
|
|
||||||
|
if (gSupportsFramebufferObjectARB || gSupportsFramebufferObjectEXT)
|
||||||
|
{
|
||||||
|
QActionGroup* IconGroup = new QActionGroup(Menu);
|
||||||
|
|
||||||
|
QAction* NoIcons = Menu->addAction(tr("No Icons"), mPartsWidget, SLOT(SetNoIcons()));
|
||||||
|
NoIcons->setCheckable(true);
|
||||||
|
NoIcons->setChecked(ListModel->GetIconSize() == 0);
|
||||||
|
IconGroup->addAction(NoIcons);
|
||||||
|
|
||||||
|
QAction* SmallIcons = Menu->addAction(tr("Small Icons"), mPartsWidget, SLOT(SetSmallIcons()));
|
||||||
|
SmallIcons->setCheckable(true);
|
||||||
|
SmallIcons->setChecked(ListModel->GetIconSize() == 32);
|
||||||
|
IconGroup->addAction(SmallIcons);
|
||||||
|
|
||||||
|
QAction* MediumIcons = Menu->addAction(tr("Medium Icons"), mPartsWidget, SLOT(SetMediumIcons()));
|
||||||
|
MediumIcons->setCheckable(true);
|
||||||
|
MediumIcons->setChecked(ListModel->GetIconSize() == 64);
|
||||||
|
IconGroup->addAction(MediumIcons);
|
||||||
|
|
||||||
|
QAction* LargeIcons = Menu->addAction(tr("Large Icons"), mPartsWidget, SLOT(SetLargeIcons()));
|
||||||
|
LargeIcons->setCheckable(true);
|
||||||
|
LargeIcons->setChecked(ListModel->GetIconSize() == 96);
|
||||||
|
IconGroup->addAction(LargeIcons);
|
||||||
|
|
||||||
|
QAction* ExtraLargeIcons = Menu->addAction(tr("Extra Large Icons"), mPartsWidget, SLOT(SetExtraLargeIcons()));
|
||||||
|
ExtraLargeIcons->setCheckable(true);
|
||||||
|
ExtraLargeIcons->setChecked(ListModel->GetIconSize() == 192);
|
||||||
|
IconGroup->addAction(ExtraLargeIcons);
|
||||||
|
|
||||||
|
Menu->addSeparator();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ListModel->GetIconSize() != 0 && !ListModel->IsListMode())
|
||||||
|
{
|
||||||
|
QAction* PartNames = Menu->addAction(tr("Show Part Names"), mPartsWidget, SLOT(TogglePartNames()));
|
||||||
|
PartNames->setCheckable(true);
|
||||||
|
PartNames->setChecked(ListModel->GetShowPartNames());
|
||||||
|
}
|
||||||
|
|
||||||
|
QAction* DecoratedParts = Menu->addAction(tr("Show Decorated Parts"), mPartsWidget, SLOT(ToggleDecoratedParts()));
|
||||||
|
DecoratedParts->setCheckable(true);
|
||||||
|
DecoratedParts->setChecked(ListModel->GetShowDecoratedParts());
|
||||||
|
|
||||||
|
QAction* PartAliases = Menu->addAction(tr("Show Part Aliases"), mPartsWidget, SLOT(TogglePartAliases()));
|
||||||
|
PartAliases->setCheckable(true);
|
||||||
|
PartAliases->setChecked(ListModel->GetShowPartAliases());
|
||||||
|
|
||||||
|
if (ListModel->GetIconSize() != 0)
|
||||||
|
{
|
||||||
|
QAction* ListMode = Menu->addAction(tr("List Mode"), mPartsWidget, SLOT(ToggleListMode()));
|
||||||
|
ListMode->setCheckable(true);
|
||||||
|
ListMode->setChecked(ListModel->IsListMode());
|
||||||
|
|
||||||
|
QAction* FixedColor = Menu->addAction(tr("Lock Preview Color"), mPartsWidget, SLOT(ToggleFixedColor()));
|
||||||
|
FixedColor->setCheckable(true);
|
||||||
|
FixedColor->setChecked(ListModel->IsColorLocked());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcPartSelectionWidget::Redraw()
|
void lcPartSelectionWidget::Redraw()
|
||||||
|
@ -891,20 +923,146 @@ void lcPartSelectionWidget::SetDefaultPart()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void lcPartSelectionWidget::LoadCustomSets()
|
||||||
|
{
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||||
|
QByteArray Buffer = lcGetProfileBuffer(LC_PROFILE_PART_SETS);
|
||||||
|
QJsonDocument Document = QJsonDocument::fromJson(Buffer);
|
||||||
|
|
||||||
|
if (Document.isNull())
|
||||||
|
Document = QJsonDocument::fromJson((QString("{ \"Version\":1, \"Sets\": { \"%1\": [] } }").arg(tr("Favorites"))).toUtf8());
|
||||||
|
|
||||||
|
QJsonObject RootObject = Document.object();
|
||||||
|
mCustomSets.clear();
|
||||||
|
|
||||||
|
int Version = RootObject["Version"].toInt(0);
|
||||||
|
if (Version != 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
QJsonObject SetsObject = RootObject["Sets"].toObject();
|
||||||
|
|
||||||
|
for (QJsonObject::const_iterator ElementIt = SetsObject.constBegin(); ElementIt != SetsObject.constEnd(); ElementIt++)
|
||||||
|
{
|
||||||
|
if (!ElementIt.value().isArray())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
lcPartCategoryCustomSet Set;
|
||||||
|
Set.Name = ElementIt.key();
|
||||||
|
|
||||||
|
QJsonArray Parts = ElementIt.value().toArray();
|
||||||
|
|
||||||
|
for (const QJsonValue& Part : Parts)
|
||||||
|
Set.Parts.emplace_back(Part.toString().toStdString());
|
||||||
|
|
||||||
|
mCustomSets.emplace_back(std::move(Set));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void lcPartSelectionWidget::SaveCustomSets()
|
||||||
|
{
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||||
|
QJsonObject RootObject;
|
||||||
|
|
||||||
|
RootObject["Version"] = 1;
|
||||||
|
QJsonObject SetsObject;
|
||||||
|
|
||||||
|
for (const lcPartCategoryCustomSet& Set: mCustomSets)
|
||||||
|
{
|
||||||
|
QJsonArray Parts;
|
||||||
|
|
||||||
|
for (const std::string& PartId : Set.Parts)
|
||||||
|
Parts.append(QString::fromStdString(PartId));
|
||||||
|
|
||||||
|
SetsObject[Set.Name] = Parts;
|
||||||
|
}
|
||||||
|
|
||||||
|
RootObject["Sets"] = SetsObject;
|
||||||
|
|
||||||
|
QByteArray Buffer = QJsonDocument(RootObject).toJson();
|
||||||
|
lcSetProfileBuffer(LC_PROFILE_PART_SETS, Buffer);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void lcPartSelectionWidget::AddToSet()
|
||||||
|
{
|
||||||
|
PieceInfo* Info = mPartsWidget->GetContextInfo();
|
||||||
|
if (!Info)
|
||||||
|
return;
|
||||||
|
|
||||||
|
QString SetName = ((QAction*)sender())->text();
|
||||||
|
|
||||||
|
std::vector<lcPartCategoryCustomSet>::iterator SetIt = std::find_if(mCustomSets.begin(), mCustomSets.end(), [&SetName](const lcPartCategoryCustomSet& Set)
|
||||||
|
{
|
||||||
|
return Set.Name == SetName;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (SetIt == mCustomSets.end())
|
||||||
|
return;
|
||||||
|
|
||||||
|
std::string PartId = lcGetPiecesLibrary()->GetPartId(Info);
|
||||||
|
std::vector<std::string>& SetParts = SetIt->Parts;
|
||||||
|
|
||||||
|
if (std::find(SetParts.begin(), SetParts.end(), PartId) == SetParts.end())
|
||||||
|
{
|
||||||
|
SetParts.emplace_back(PartId);
|
||||||
|
SaveCustomSets();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void lcPartSelectionWidget::RemoveFromSet()
|
||||||
|
{
|
||||||
|
PieceInfo* Info = mPartsWidget->GetContextInfo();
|
||||||
|
if (!Info)
|
||||||
|
return;
|
||||||
|
|
||||||
|
QTreeWidgetItem* CurrentItem = mCategoriesWidget->currentItem();
|
||||||
|
if (!CurrentItem || CurrentItem->data(0, static_cast<int>(lcPartCategoryRole::Type)) != static_cast<int>(lcPartCategoryType::CustomSet))
|
||||||
|
return;
|
||||||
|
|
||||||
|
int SetIndex = CurrentItem->data(0, static_cast<int>(lcPartCategoryRole::Index)).toInt();
|
||||||
|
lcPartCategoryCustomSet& Set = mCustomSets[SetIndex];
|
||||||
|
|
||||||
|
std::string PartId = lcGetPiecesLibrary()->GetPartId(Info);
|
||||||
|
std::vector<std::string>::iterator PartIt = std::find(Set.Parts.begin(), Set.Parts.end(), PartId);
|
||||||
|
|
||||||
|
if (PartIt != Set.Parts.end())
|
||||||
|
{
|
||||||
|
Set.Parts.erase(PartIt);
|
||||||
|
mPartsWidget->SetCategory(lcPartCategoryType::CustomSet, SetIndex);
|
||||||
|
SaveCustomSets();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void lcPartSelectionWidget::UpdateCategories()
|
void lcPartSelectionWidget::UpdateCategories()
|
||||||
{
|
{
|
||||||
int CurrentIndex = mCategoriesWidget->indexOfTopLevelItem(mCategoriesWidget->currentItem());
|
int CurrentIndex = mCategoriesWidget->indexOfTopLevelItem(mCategoriesWidget->currentItem());
|
||||||
|
|
||||||
mCategoriesWidget->clear();
|
mCategoriesWidget->clear();
|
||||||
|
|
||||||
mAllPartsCategoryItem = new QTreeWidgetItem(mCategoriesWidget, QStringList(tr("All Parts")));
|
QTreeWidgetItem* AllPartsCategoryItem = new QTreeWidgetItem(mCategoriesWidget, QStringList(tr("All Parts")));
|
||||||
mFavoritesCategoryItem = new QTreeWidgetItem(mCategoriesWidget, QStringList(tr("Favorites")));
|
AllPartsCategoryItem->setData(0, static_cast<int>(lcPartCategoryRole::Type), static_cast<int>(lcPartCategoryType::AllParts));
|
||||||
mCurrentModelCategoryItem = new QTreeWidgetItem(mCategoriesWidget, QStringList(tr("Parts In Use")));
|
|
||||||
|
QTreeWidgetItem* CurrentModelCategoryItem = new QTreeWidgetItem(mCategoriesWidget, QStringList(tr("Parts In Use")));
|
||||||
|
CurrentModelCategoryItem->setData(0, static_cast<int>(lcPartCategoryRole::Type), static_cast<int>(lcPartCategoryType::PartsInUse));
|
||||||
|
|
||||||
|
QTreeWidgetItem* SubmodelsCategoryItem = new QTreeWidgetItem(mCategoriesWidget, QStringList(tr("Submodels")));
|
||||||
|
SubmodelsCategoryItem->setData(0, static_cast<int>(lcPartCategoryRole::Type), static_cast<int>(lcPartCategoryType::Submodels));
|
||||||
|
|
||||||
|
for (size_t SetIdx = 0; SetIdx < mCustomSets.size(); SetIdx++)
|
||||||
|
{
|
||||||
|
const lcPartCategoryCustomSet& Set = mCustomSets[SetIdx];
|
||||||
|
QTreeWidgetItem* SetCategoryItem = new QTreeWidgetItem(mCategoriesWidget, QStringList(Set.Name));
|
||||||
|
SetCategoryItem->setData(0, static_cast<int>(lcPartCategoryRole::Type), static_cast<int>(lcPartCategoryType::CustomSet));
|
||||||
|
SetCategoryItem->setData(0, static_cast<int>(lcPartCategoryRole::Index), SetIdx);
|
||||||
|
}
|
||||||
|
|
||||||
for (int CategoryIdx = 0; CategoryIdx < gCategories.GetSize(); CategoryIdx++)
|
for (int CategoryIdx = 0; CategoryIdx < gCategories.GetSize(); CategoryIdx++)
|
||||||
new QTreeWidgetItem(mCategoriesWidget, QStringList(gCategories[CategoryIdx].Name));
|
{
|
||||||
|
QTreeWidgetItem* CategoryItem = new QTreeWidgetItem(mCategoriesWidget, QStringList(gCategories[CategoryIdx].Name));
|
||||||
mModelsCategoryItem = new QTreeWidgetItem(mCategoriesWidget, QStringList(tr("Submodels")));
|
CategoryItem->setData(0, static_cast<int>(lcPartCategoryRole::Type), static_cast<int>(lcPartCategoryType::Category));
|
||||||
|
CategoryItem->setData(0, static_cast<int>(lcPartCategoryRole::Index), CategoryIdx);
|
||||||
|
}
|
||||||
|
|
||||||
if (CurrentIndex != -1)
|
if (CurrentIndex != -1)
|
||||||
mCategoriesWidget->setCurrentItem(mCategoriesWidget->topLevelItem(CurrentIndex));
|
mCategoriesWidget->setCurrentItem(mCategoriesWidget->topLevelItem(CurrentIndex));
|
||||||
|
@ -912,6 +1070,8 @@ void lcPartSelectionWidget::UpdateCategories()
|
||||||
|
|
||||||
void lcPartSelectionWidget::UpdateModels()
|
void lcPartSelectionWidget::UpdateModels()
|
||||||
{
|
{
|
||||||
if (mCategoriesWidget->currentItem() == mModelsCategoryItem)
|
QTreeWidgetItem* CurrentItem = mCategoriesWidget->currentItem();
|
||||||
mPartsWidget->GetListModel()->SetModelsCategory();
|
|
||||||
|
if (CurrentItem && CurrentItem->data(0, static_cast<int>(lcPartCategoryRole::Type)) == static_cast<int>(lcPartCategoryType::Submodels))
|
||||||
|
mPartsWidget->SetCategory(lcPartCategoryType::Submodels, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,28 @@
|
||||||
|
|
||||||
class lcPartSelectionListModel;
|
class lcPartSelectionListModel;
|
||||||
class lcPartSelectionListView;
|
class lcPartSelectionListView;
|
||||||
|
class lcPartSelectionWidget;
|
||||||
|
|
||||||
|
enum class lcPartCategoryType
|
||||||
|
{
|
||||||
|
AllParts,
|
||||||
|
PartsInUse,
|
||||||
|
Submodels,
|
||||||
|
CustomSet,
|
||||||
|
Category
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class lcPartCategoryRole
|
||||||
|
{
|
||||||
|
Type = Qt::UserRole,
|
||||||
|
Index
|
||||||
|
};
|
||||||
|
|
||||||
|
struct lcPartCategoryCustomSet
|
||||||
|
{
|
||||||
|
QString Name;
|
||||||
|
std::vector<std::string> Parts;
|
||||||
|
};
|
||||||
|
|
||||||
class lcPartSelectionItemDelegate : public QStyledItemDelegate
|
class lcPartSelectionItemDelegate : public QStyledItemDelegate
|
||||||
{
|
{
|
||||||
|
@ -81,7 +103,7 @@ public:
|
||||||
void ToggleListMode();
|
void ToggleListMode();
|
||||||
void SetCategory(int CategoryIndex);
|
void SetCategory(int CategoryIndex);
|
||||||
void SetModelsCategory();
|
void SetModelsCategory();
|
||||||
void SetFavoritesCategory();
|
void SetCustomSetCategory(int SetIndex);
|
||||||
void SetCurrentModelCategory();
|
void SetCurrentModelCategory();
|
||||||
void SetFilter(const QString& Filter);
|
void SetFilter(const QString& Filter);
|
||||||
void RequestPreview(int InfoIndex);
|
void RequestPreview(int InfoIndex);
|
||||||
|
@ -116,10 +138,12 @@ class lcPartSelectionListView : public QListView
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
lcPartSelectionListView(QWidget* Parent);
|
lcPartSelectionListView(QWidget* Parent, lcPartSelectionWidget* PartSelectionWidget);
|
||||||
|
|
||||||
virtual void startDrag(Qt::DropActions SupportedActions);
|
virtual void startDrag(Qt::DropActions SupportedActions);
|
||||||
|
|
||||||
|
void SetCategory(lcPartCategoryType Type, int Index);
|
||||||
|
|
||||||
PieceInfo* GetCurrentPart() const
|
PieceInfo* GetCurrentPart() const
|
||||||
{
|
{
|
||||||
return mListModel->GetPieceInfo(currentIndex());
|
return mListModel->GetPieceInfo(currentIndex());
|
||||||
|
@ -130,10 +154,17 @@ public:
|
||||||
return mListModel;
|
return mListModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateViewMode();
|
lcPartSelectionWidget* GetPartSelectionWidget() const
|
||||||
|
{
|
||||||
|
return mPartSelectionWidget;
|
||||||
|
}
|
||||||
|
|
||||||
signals:
|
PieceInfo* GetContextInfo() const
|
||||||
void FavoriteRemoved();
|
{
|
||||||
|
return mContextInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateViewMode();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void CustomContextMenuRequested(QPoint Pos);
|
void CustomContextMenuRequested(QPoint Pos);
|
||||||
|
@ -147,14 +178,15 @@ public slots:
|
||||||
void TogglePartAliases();
|
void TogglePartAliases();
|
||||||
void ToggleListMode();
|
void ToggleListMode();
|
||||||
void ToggleFixedColor();
|
void ToggleFixedColor();
|
||||||
void AddToFavorites();
|
|
||||||
void RemoveFromFavorites();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void SetIconSize(int Size);
|
void SetIconSize(int Size);
|
||||||
|
|
||||||
lcPartSelectionListModel* mListModel;
|
lcPartSelectionListModel* mListModel;
|
||||||
|
lcPartSelectionWidget* mPartSelectionWidget;
|
||||||
PieceInfo* mContextInfo;
|
PieceInfo* mContextInfo;
|
||||||
|
lcPartCategoryType mCategoryType;
|
||||||
|
int mCategoryIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
class lcPartSelectionWidget : public QWidget
|
class lcPartSelectionWidget : public QWidget
|
||||||
|
@ -177,25 +209,34 @@ public:
|
||||||
mPartsWidget->GetListModel()->SetColorIndex(ColorIndex);
|
mPartsWidget->GetListModel()->SetColorIndex(ColorIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::vector<lcPartCategoryCustomSet>& GetCustomSets() const
|
||||||
|
{
|
||||||
|
return mCustomSets;
|
||||||
|
}
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void AddToSet();
|
||||||
|
void RemoveFromSet();
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void DockLocationChanged(Qt::DockWidgetArea Area);
|
void DockLocationChanged(Qt::DockWidgetArea Area);
|
||||||
void FilterChanged(const QString& Text);
|
void FilterChanged(const QString& Text);
|
||||||
void FilterTriggered();
|
void FilterTriggered();
|
||||||
void CategoryChanged(QTreeWidgetItem* Current, QTreeWidgetItem* Previous);
|
void CategoryChanged(QTreeWidgetItem* Current, QTreeWidgetItem* Previous);
|
||||||
void PartChanged(const QModelIndex& Current, const QModelIndex& Previous);
|
void PartChanged(const QModelIndex& Current, const QModelIndex& Previous);
|
||||||
void FavoriteRemoved();
|
void OptionsMenuAboutToShow();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void LoadCustomSets();
|
||||||
|
void SaveCustomSets();
|
||||||
|
|
||||||
virtual void resizeEvent(QResizeEvent* Event);
|
virtual void resizeEvent(QResizeEvent* Event);
|
||||||
virtual bool event(QEvent* Event);
|
virtual bool event(QEvent* Event);
|
||||||
|
|
||||||
QTreeWidget* mCategoriesWidget;
|
QTreeWidget* mCategoriesWidget;
|
||||||
QTreeWidgetItem* mAllPartsCategoryItem;
|
|
||||||
QTreeWidgetItem* mFavoritesCategoryItem;
|
|
||||||
QTreeWidgetItem* mCurrentModelCategoryItem;
|
|
||||||
QTreeWidgetItem* mModelsCategoryItem;
|
|
||||||
QLineEdit* mFilterWidget;
|
QLineEdit* mFilterWidget;
|
||||||
QAction* mFilterAction;
|
QAction* mFilterAction;
|
||||||
lcPartSelectionListView* mPartsWidget;
|
lcPartSelectionListView* mPartsWidget;
|
||||||
QSplitter* mSplitter;
|
QSplitter* mSplitter;
|
||||||
|
std::vector<lcPartCategoryCustomSet> mCustomSets;
|
||||||
};
|
};
|
||||||
|
|
|
@ -77,7 +77,7 @@ static lcProfileEntry gProfileEntries[LC_NUM_PROFILE_KEYS] =
|
||||||
lcProfileEntry("Settings", "CheckUpdates", 1), // LC_PROFILE_CHECK_UPDATES
|
lcProfileEntry("Settings", "CheckUpdates", 1), // LC_PROFILE_CHECK_UPDATES
|
||||||
lcProfileEntry("Settings", "ProjectsPath", ""), // LC_PROFILE_PROJECTS_PATH
|
lcProfileEntry("Settings", "ProjectsPath", ""), // LC_PROFILE_PROJECTS_PATH
|
||||||
lcProfileEntry("Settings", "PartsLibrary", ""), // LC_PROFILE_PARTS_LIBRARY
|
lcProfileEntry("Settings", "PartsLibrary", ""), // LC_PROFILE_PARTS_LIBRARY
|
||||||
lcProfileEntry("Settings", "LibraryFavorites", QStringList()), // LC_PROFILE_LIBRARY_FAVORITES
|
lcProfileEntry("Settings", "PartSets"), // LC_PROFILE_PART_SETS
|
||||||
lcProfileEntry("Settings", "MinifigSettings", ""), // LC_PROFILE_MINIFIG_SETTINGS
|
lcProfileEntry("Settings", "MinifigSettings", ""), // LC_PROFILE_MINIFIG_SETTINGS
|
||||||
lcProfileEntry("Settings", "ColorConfig", ""), // LC_PROFILE_COLOR_CONFIG
|
lcProfileEntry("Settings", "ColorConfig", ""), // LC_PROFILE_COLOR_CONFIG
|
||||||
lcProfileEntry("Settings", "Shortcuts"), // LC_PROFILE_KEYBOARD_SHORTCUTS
|
lcProfileEntry("Settings", "Shortcuts"), // LC_PROFILE_KEYBOARD_SHORTCUTS
|
||||||
|
|
|
@ -25,7 +25,7 @@ enum LC_PROFILE_KEY
|
||||||
LC_PROFILE_CHECK_UPDATES,
|
LC_PROFILE_CHECK_UPDATES,
|
||||||
LC_PROFILE_PROJECTS_PATH,
|
LC_PROFILE_PROJECTS_PATH,
|
||||||
LC_PROFILE_PARTS_LIBRARY,
|
LC_PROFILE_PARTS_LIBRARY,
|
||||||
LC_PROFILE_LIBRARY_FAVORITES,
|
LC_PROFILE_PART_SETS,
|
||||||
LC_PROFILE_MINIFIG_SETTINGS,
|
LC_PROFILE_MINIFIG_SETTINGS,
|
||||||
LC_PROFILE_COLOR_CONFIG,
|
LC_PROFILE_COLOR_CONFIG,
|
||||||
LC_PROFILE_KEYBOARD_SHORTCUTS,
|
LC_PROFILE_KEYBOARD_SHORTCUTS,
|
||||||
|
|
Loading…
Add table
Reference in a new issue