Move Select Dialog.

This commit is contained in:
Leonardo Zide
2026-05-02 16:06:27 -07:00
parent 664429f635
commit 80ea68245c
16 changed files with 63 additions and 59 deletions
+23 -2
View File
@@ -10,6 +10,7 @@
#include "lc_qutils.h"
#include "lc_updatedialog.h"
#include "lc_aboutdialog.h"
#include "lc_selectdialog.h"
#include "lc_setsdatabasedialog.h"
#include "lc_htmldialog.h"
#include "lc_renderdialog.h"
@@ -1384,6 +1385,27 @@ void lcMainWindow::ShowImageDialog()
lcGetActiveProject()->SaveImage(Options);
}
void lcMainWindow::ShowSelectDialog()
{
lcModel* ActiveModel = GetActiveModel();
if (!ActiveModel)
return;
if (ActiveModel->GetPieces().empty() && ActiveModel->GetCameras().empty() && ActiveModel->GetLights().empty())
{
QMessageBox::information(this, tr("LeoCAD"), tr("Nothing to select."));
return;
}
lcSelectDialog Dialog(this, ActiveModel);
if (Dialog.exec() != QDialog::Accepted)
return;
ActiveModel->SetSelectionAndFocusAction(Dialog.mObjects, nullptr, 0, lcSelectionMode::Single);
}
void lcMainWindow::SetShadingMode(lcShadingMode ShadingMode)
{
lcGetPreferences().mShadingMode = ShadingMode;
@@ -2818,8 +2840,7 @@ void lcMainWindow::HandleCommand(lcCommandId CommandId)
break;
case LC_EDIT_SELECT_BY_NAME:
if (ActiveModel)
ActiveModel->ShowSelectByNameDialog();
ShowSelectDialog();
break;
case LC_EDIT_SELECTION_SINGLE:
+1
View File
@@ -329,6 +329,7 @@ protected:
void ShowInstructionsDialog();
void ShowPrintDialog();
void ShowImageDialog();
void ShowSelectDialog();
void CreatePreviewWidget();
bool OpenProjectFile(const QString& FileName);
-17
View File
@@ -15,7 +15,6 @@
#include "lc_view.h"
#include "minifig.h"
#include "lc_arraydialog.h"
#include "lc_qselectdialog.h"
#include "lc_minifigdialog.h"
#include "lc_groupdialog.h"
#include "lc_editgroupsdialog.h"
@@ -5431,22 +5430,6 @@ void lcModel::ShowPropertiesDialog()
EndHistorySequence(tr("Change Model Properties"));
}
void lcModel::ShowSelectByNameDialog()
{
if (mPieces.empty() && mCameras.empty() && mLights.empty())
{
QMessageBox::information(gMainWindow, tr("LeoCAD"), tr("Nothing to select."));
return;
}
lcSelectDialog Dialog(gMainWindow, this);
if (Dialog.exec() != QDialog::Accepted)
return;
SetSelectionAndFocusAction(Dialog.mObjects, nullptr, 0, lcSelectionMode::Single);
}
void lcModel::ShowArrayDialog()
{
lcVector3 Center;
-1
View File
@@ -384,7 +384,6 @@ public:
void SetCameraProjection(lcCamera* Camera, lcCameraProjection CameraProjection);
void ShowPropertiesDialog();
void ShowSelectByNameDialog();
void ShowArrayDialog();
void ShowMinifigDialog();
void UpdateInterface();
@@ -1,6 +1,6 @@
#include "lc_global.h"
#include "lc_qselectdialog.h"
#include "ui_lc_qselectdialog.h"
#include "lc_selectdialog.h"
#include "ui_lc_selectdialog.h"
#include "lc_model.h"
#include "piece.h"
#include "camera.h"
+5 -5
View File
@@ -221,6 +221,7 @@ SOURCES += \
common/lc_profile.cpp \
common/lc_propertieswidget.cpp \
common/lc_scene.cpp \
common/lc_selectdialog.cpp \
common/lc_shortcuts.cpp \
common/lc_string.cpp \
common/lc_stringcache.cpp \
@@ -236,7 +237,6 @@ SOURCES += \
common/lc_viewwidget.cpp \
common/lc_zipfile.cpp \
qt/qtmain.cpp \
qt/lc_qselectdialog.cpp \
qt/lc_qpropertiesdialog.cpp \
qt/lc_qpreferencesdialog.cpp \
qt/lc_qutils.cpp \
@@ -294,12 +294,14 @@ HEADERS += \
common/lc_modellistdialog.h \
common/lc_objectproperty.h \
common/lc_pagesetupdialog.h \
common/lc_partpalettedialog.h \
common/lc_partselectionpopup.h \
common/lc_partselectionwidget.h \
common/lc_previewwidget.h \
common/lc_profile.h \
common/lc_propertieswidget.h \
common/lc_scene.h \
common/lc_selectdialog.h \
common/lc_shortcuts.h \
common/lc_string.h \
common/lc_stringcache.h \
@@ -314,13 +316,11 @@ HEADERS += \
common/lc_viewsphere.h \
common/lc_viewwidget.h \
common/lc_zipfile.h \
qt/lc_qselectdialog.h \
qt/lc_qpropertiesdialog.h \
qt/lc_qpreferencesdialog.h \
qt/lc_qutils.h \
qt/lc_renderdialog.h \
qt/lc_setsdatabasedialog.h \
common/lc_partpalettedialog.h
qt/lc_setsdatabasedialog.h
FORMS += \
common/lc_aboutdialog.ui \
common/lc_arraydialog.ui \
@@ -333,8 +333,8 @@ FORMS += \
common/lc_modellistdialog.ui \
common/lc_pagesetupdialog.ui \
common/lc_partpalettedialog.ui \
common/lc_selectdialog.ui \
common/lc_updatedialog.ui \
qt/lc_qselectdialog.ui \
qt/lc_qpropertiesdialog.ui \
qt/lc_qpreferencesdialog.ui \
qt/lc_renderdialog.ui \
+4 -4
View File
@@ -8052,22 +8052,22 @@ GL_EXT_texture_filter_anisotropic rozšíření: %5
<context>
<name>lcSelectDialog</name>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="14"/>
<location filename="../common/lc_selectdialog.ui" line="14"/>
<source>Select Objects</source>
<translation>Vybrat objekty</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="34"/>
<location filename="../common/lc_selectdialog.ui" line="34"/>
<source>All</source>
<translation>Vše</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="41"/>
<location filename="../common/lc_selectdialog.ui" line="41"/>
<source>None</source>
<translation>Žádné</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="48"/>
<location filename="../common/lc_selectdialog.ui" line="48"/>
<source>Invert</source>
<translation>Invertovat</translation>
</message>
+4 -4
View File
@@ -7942,22 +7942,22 @@ Anisotropic: %5
<context>
<name>lcSelectDialog</name>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="14"/>
<location filename="../common/lc_selectdialog.ui" line="14"/>
<source>Select Objects</source>
<translation>Objekte auswählen</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="34"/>
<location filename="../common/lc_selectdialog.ui" line="34"/>
<source>All</source>
<translation>Alle</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="41"/>
<location filename="../common/lc_selectdialog.ui" line="41"/>
<source>None</source>
<translation>Keine</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="48"/>
<location filename="../common/lc_selectdialog.ui" line="48"/>
<source>Invert</source>
<translation>Umkehren</translation>
</message>
+4 -4
View File
@@ -8085,22 +8085,22 @@ Anisotropic: %5
<context>
<name>lcSelectDialog</name>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="14"/>
<location filename="../common/lc_selectdialog.ui" line="14"/>
<source>Select Objects</source>
<translation>Seleccionar objetos</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="34"/>
<location filename="../common/lc_selectdialog.ui" line="34"/>
<source>All</source>
<translation>Todos</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="41"/>
<location filename="../common/lc_selectdialog.ui" line="41"/>
<source>None</source>
<translation>Ninguno</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="48"/>
<location filename="../common/lc_selectdialog.ui" line="48"/>
<source>Invert</source>
<translation>Invertir</translation>
</message>
+4 -4
View File
@@ -7816,22 +7816,22 @@ Anisotropic: %5
<context>
<name>lcSelectDialog</name>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="14"/>
<location filename="../common/lc_selectdialog.ui" line="14"/>
<source>Select Objects</source>
<translation>Sélectionner des objets</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="34"/>
<location filename="../common/lc_selectdialog.ui" line="34"/>
<source>All</source>
<translation>Tous</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="41"/>
<location filename="../common/lc_selectdialog.ui" line="41"/>
<source>None</source>
<translation>Aucun</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="48"/>
<location filename="../common/lc_selectdialog.ui" line="48"/>
<source>Invert</source>
<translation>Inverser</translation>
</message>
+4 -4
View File
@@ -7812,22 +7812,22 @@ Anisotropic: %5
<context>
<name>lcSelectDialog</name>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="14"/>
<location filename="../common/lc_selectdialog.ui" line="14"/>
<source>Select Objects</source>
<translation>Selecionar Objetos</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="34"/>
<location filename="../common/lc_selectdialog.ui" line="34"/>
<source>All</source>
<translation>Todos</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="41"/>
<location filename="../common/lc_selectdialog.ui" line="41"/>
<source>None</source>
<translation>Nenhum</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="48"/>
<location filename="../common/lc_selectdialog.ui" line="48"/>
<source>Invert</source>
<translation>Inverter</translation>
</message>
+4 -4
View File
@@ -7954,22 +7954,22 @@ GL_EXT_texture_filter_anisotropic extension: %5
<context>
<name>lcSelectDialog</name>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="14"/>
<location filename="../common/lc_selectdialog.ui" line="14"/>
<source>Select Objects</source>
<translation>Выделение объектов</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="34"/>
<location filename="../common/lc_selectdialog.ui" line="34"/>
<source>All</source>
<translation>Все</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="41"/>
<location filename="../common/lc_selectdialog.ui" line="41"/>
<source>None</source>
<translation>Ни одного</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="48"/>
<location filename="../common/lc_selectdialog.ui" line="48"/>
<source>Invert</source>
<translation>Инвертировать</translation>
</message>
+4 -4
View File
@@ -7878,22 +7878,22 @@ GL_EXT_texture_filter_anisotropic extension: %5
<context>
<name>lcSelectDialog</name>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="14"/>
<location filename="../common/lc_selectdialog.ui" line="14"/>
<source>Select Objects</source>
<translation>Виділити об&apos;єкти</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="34"/>
<location filename="../common/lc_selectdialog.ui" line="34"/>
<source>All</source>
<translation>Усі</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="41"/>
<location filename="../common/lc_selectdialog.ui" line="41"/>
<source>None</source>
<translation>Нічого</translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="48"/>
<location filename="../common/lc_selectdialog.ui" line="48"/>
<source>Invert</source>
<translation>Інвертувати</translation>
</message>
+4 -4
View File
@@ -7740,22 +7740,22 @@ Anisotropic: %5
<context>
<name>lcSelectDialog</name>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="14"/>
<location filename="../common/lc_selectdialog.ui" line="14"/>
<source>Select Objects</source>
<translation></translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="34"/>
<location filename="../common/lc_selectdialog.ui" line="34"/>
<source>All</source>
<translation></translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="41"/>
<location filename="../common/lc_selectdialog.ui" line="41"/>
<source>None</source>
<translation></translation>
</message>
<message>
<location filename="../qt/lc_qselectdialog.ui" line="48"/>
<location filename="../common/lc_selectdialog.ui" line="48"/>
<source>Invert</source>
<translation></translation>
</message>