mirror of
https://github.com/leozide/leocad.git
synced 2026-07-27 19:56:49 +00:00
Removed Select By Color.
This commit is contained in:
@@ -283,13 +283,6 @@ const lcCommand gCommands[] =
|
||||
QT_TRANSLATE_NOOP("Status", "Select objects by name"),
|
||||
""
|
||||
},
|
||||
// LC_EDIT_SELECT_BY_COLOR
|
||||
{
|
||||
QT_TRANSLATE_NOOP("Action", "Edit.SelectByColor"),
|
||||
QT_TRANSLATE_NOOP("Menu", "Select by Col&or..."),
|
||||
QT_TRANSLATE_NOOP("Status", "Select pieces by color"),
|
||||
""
|
||||
},
|
||||
// LC_EDIT_SELECT_SINGLE
|
||||
{
|
||||
QT_TRANSLATE_NOOP("Action", "Edit.SelectSingle"),
|
||||
|
||||
@@ -44,7 +44,6 @@ enum lcCommandId
|
||||
LC_EDIT_SELECT_NONE,
|
||||
LC_EDIT_SELECT_INVERT,
|
||||
LC_EDIT_SELECT_BY_NAME,
|
||||
LC_EDIT_SELECT_BY_COLOR,
|
||||
LC_EDIT_SELECTION_MODE_FIRST,
|
||||
LC_EDIT_SELECTION_SINGLE = LC_EDIT_SELECTION_MODE_FIRST,
|
||||
LC_EDIT_SELECTION_PIECE,
|
||||
|
||||
@@ -62,13 +62,15 @@ lcFindReplaceWidget::lcFindReplaceWidget(QWidget* Parent, lcModel* Model, bool R
|
||||
|
||||
if (Replace)
|
||||
{
|
||||
ReplaceColorCheckBox = new QCheckBox(tr("Replace Color"), this);
|
||||
Layout->addWidget(new QLabel(tr("Replace:")), 1, 0);
|
||||
|
||||
ReplaceColorCheckBox = new QCheckBox(this);
|
||||
Layout->addWidget(ReplaceColorCheckBox, 1, 1);
|
||||
|
||||
ReplaceColorPicker = new lcQColorPicker(this);
|
||||
Layout->addWidget(ReplaceColorPicker, 1, 2);
|
||||
|
||||
ReplacePartCheckBox = new QCheckBox(tr("Replace Part"), this);
|
||||
ReplacePartCheckBox = new QCheckBox(this);
|
||||
Layout->addWidget(ReplacePartCheckBox, 1, 3);
|
||||
|
||||
ReplacePartComboBox = new QComboBox(this);
|
||||
|
||||
@@ -501,7 +501,6 @@ void lcMainWindow::CreateMenus()
|
||||
EditMenu->addAction(mActions[LC_EDIT_SELECT_NONE]);
|
||||
EditMenu->addAction(mActions[LC_EDIT_SELECT_INVERT]);
|
||||
EditMenu->addAction(mActions[LC_EDIT_SELECT_BY_NAME]);
|
||||
EditMenu->addAction(mActions[LC_EDIT_SELECT_BY_COLOR]);
|
||||
EditMenu->addMenu(mSelectionModeMenu);
|
||||
EditMenu->addSeparator();
|
||||
EditMenu->addMenu(mTransformMenu);
|
||||
@@ -2009,11 +2008,12 @@ void lcMainWindow::UpdateSelectedObjects(bool SelectionChanged)
|
||||
mActions[LC_EDIT_FIND]->setEnabled((Flags & LC_SEL_NO_PIECES) == 0);
|
||||
mActions[LC_EDIT_FIND_NEXT]->setEnabled((Flags & LC_SEL_NO_PIECES) == 0);
|
||||
mActions[LC_EDIT_FIND_PREVIOUS]->setEnabled((Flags & LC_SEL_NO_PIECES) == 0);
|
||||
mActions[LC_EDIT_FIND_ALL]->setEnabled((Flags & LC_SEL_NO_PIECES) == 0);
|
||||
mActions[LC_EDIT_REPLACE]->setEnabled((Flags & LC_SEL_NO_PIECES) == 0);
|
||||
mActions[LC_EDIT_REPLACE_NEXT]->setEnabled((Flags & LC_SEL_NO_PIECES) == 0);
|
||||
mActions[LC_EDIT_REPLACE_ALL]->setEnabled((Flags & LC_SEL_NO_PIECES) == 0);
|
||||
mActions[LC_EDIT_SELECT_INVERT]->setEnabled((Flags & LC_SEL_NO_PIECES) == 0);
|
||||
mActions[LC_EDIT_SELECT_BY_NAME]->setEnabled((Flags & LC_SEL_NO_PIECES) == 0);
|
||||
mActions[LC_EDIT_SELECT_BY_COLOR]->setEnabled((Flags & LC_SEL_NO_PIECES) == 0);
|
||||
mActions[LC_EDIT_SELECT_NONE]->setEnabled(Flags & LC_SEL_SELECTED);
|
||||
mActions[LC_EDIT_SELECT_ALL]->setEnabled(Flags & LC_SEL_UNSELECTED);
|
||||
|
||||
@@ -2770,11 +2770,6 @@ void lcMainWindow::HandleCommand(lcCommandId CommandId)
|
||||
ActiveModel->ShowSelectByNameDialog();
|
||||
break;
|
||||
|
||||
case LC_EDIT_SELECT_BY_COLOR:
|
||||
if (ActiveModel)
|
||||
ActiveModel->ShowSelectByColorDialog();
|
||||
break;
|
||||
|
||||
case LC_EDIT_SELECTION_SINGLE:
|
||||
SetSelectionMode(lcSelectionMode::Single);
|
||||
break;
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include "lc_minifigdialog.h"
|
||||
#include "lc_qgroupdialog.h"
|
||||
#include "lc_qeditgroupsdialog.h"
|
||||
#include "lc_selectbycolordialog.h"
|
||||
#include "lc_qpropertiesdialog.h"
|
||||
#include "lc_qutils.h"
|
||||
#include "lc_lxf.h"
|
||||
@@ -4301,36 +4300,6 @@ void lcModel::ShowSelectByNameDialog()
|
||||
SetSelectionAndFocus(Dialog.mObjects, nullptr, 0, false);
|
||||
}
|
||||
|
||||
void lcModel::ShowSelectByColorDialog()
|
||||
{
|
||||
if (mPieces.IsEmpty())
|
||||
{
|
||||
QMessageBox::information(gMainWindow, tr("LeoCAD"), tr("Nothing to select."));
|
||||
return;
|
||||
}
|
||||
|
||||
int ColorIndex = gMainWindow->mColorIndex;
|
||||
|
||||
lcObject* Focus = GetFocusObject();
|
||||
|
||||
if (Focus && Focus->IsPiece())
|
||||
ColorIndex = ((lcPiece*)Focus)->GetColorIndex();
|
||||
|
||||
lcSelectByColorDialog Dialog(gMainWindow, ColorIndex);
|
||||
|
||||
if (Dialog.exec() != QDialog::Accepted)
|
||||
return;
|
||||
|
||||
ColorIndex = Dialog.mColorIndex;
|
||||
lcArray<lcObject*> Selection;
|
||||
|
||||
for (lcPiece* Piece : mPieces)
|
||||
if (Piece->IsVisible(mCurrentStep) && Piece->GetColorIndex() == ColorIndex)
|
||||
Selection.Add(Piece);
|
||||
|
||||
SetSelectionAndFocus(Selection, nullptr, 0, false);
|
||||
}
|
||||
|
||||
void lcModel::ShowArrayDialog()
|
||||
{
|
||||
lcVector3 Center;
|
||||
|
||||
@@ -341,7 +341,6 @@ public:
|
||||
|
||||
void ShowPropertiesDialog();
|
||||
void ShowSelectByNameDialog();
|
||||
void ShowSelectByColorDialog();
|
||||
void ShowArrayDialog();
|
||||
void ShowMinifigDialog();
|
||||
void UpdateInterface();
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#include "lc_global.h"
|
||||
#include "lc_selectbycolordialog.h"
|
||||
#include "lc_qcolorpicker.h"
|
||||
|
||||
lcSelectByColorDialog::lcSelectByColorDialog(QWidget* Parent, int ColorIndex)
|
||||
: QDialog(Parent), mColorIndex(ColorIndex)
|
||||
{
|
||||
setWindowTitle(tr("Select By Color"));
|
||||
|
||||
QVBoxLayout* MainLayout = new QVBoxLayout(this);
|
||||
|
||||
QHBoxLayout* ColorLayout = new QHBoxLayout();
|
||||
ColorLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
QLabel* ColorLabel = new QLabel(tr("Color:"), this);
|
||||
ColorLayout->addWidget(ColorLabel);
|
||||
|
||||
mColorPicker = new lcQColorPicker(this);
|
||||
mColorPicker->setCurrentColor(mColorIndex);
|
||||
ColorLayout->addWidget(mColorPicker);
|
||||
|
||||
MainLayout->addLayout(ColorLayout);
|
||||
|
||||
QDialogButtonBox* ButtonBox = new QDialogButtonBox(this);
|
||||
ButtonBox->setOrientation(Qt::Horizontal);
|
||||
ButtonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
|
||||
|
||||
MainLayout->addWidget(ButtonBox);
|
||||
|
||||
QObject::connect(ButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
QObject::connect(ButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
}
|
||||
|
||||
lcSelectByColorDialog::~lcSelectByColorDialog()
|
||||
{
|
||||
}
|
||||
|
||||
void lcSelectByColorDialog::accept()
|
||||
{
|
||||
mColorIndex = mColorPicker->currentColor();
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "lc_array.h"
|
||||
class lcQColorPicker;
|
||||
|
||||
class lcSelectByColorDialog : public QDialog
|
||||
{
|
||||
public:
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
lcSelectByColorDialog(QWidget* Parent, int ColorIndex);
|
||||
~lcSelectByColorDialog();
|
||||
|
||||
int mColorIndex;
|
||||
|
||||
public slots:
|
||||
void accept() override;
|
||||
|
||||
protected:
|
||||
lcQColorPicker* mColorPicker;
|
||||
};
|
||||
|
||||
@@ -190,7 +190,6 @@ SOURCES += \
|
||||
common/lc_previewwidget.cpp \
|
||||
common/lc_profile.cpp \
|
||||
common/lc_scene.cpp \
|
||||
common/lc_selectbycolordialog.cpp \
|
||||
common/lc_shortcuts.cpp \
|
||||
common/lc_stringcache.cpp \
|
||||
common/lc_synth.cpp \
|
||||
@@ -259,7 +258,6 @@ HEADERS += \
|
||||
common/lc_previewwidget.h \
|
||||
common/lc_profile.h \
|
||||
common/lc_scene.h \
|
||||
common/lc_selectbycolordialog.h \
|
||||
common/lc_shortcuts.h \
|
||||
common/lc_stringcache.h \
|
||||
common/lc_synth.h \
|
||||
|
||||
Reference in New Issue
Block a user