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_qutils.h"
#include "lc_updatedialog.h" #include "lc_updatedialog.h"
#include "lc_aboutdialog.h" #include "lc_aboutdialog.h"
#include "lc_selectdialog.h"
#include "lc_setsdatabasedialog.h" #include "lc_setsdatabasedialog.h"
#include "lc_htmldialog.h" #include "lc_htmldialog.h"
#include "lc_renderdialog.h" #include "lc_renderdialog.h"
@@ -1384,6 +1385,27 @@ void lcMainWindow::ShowImageDialog()
lcGetActiveProject()->SaveImage(Options); 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) void lcMainWindow::SetShadingMode(lcShadingMode ShadingMode)
{ {
lcGetPreferences().mShadingMode = ShadingMode; lcGetPreferences().mShadingMode = ShadingMode;
@@ -2818,8 +2840,7 @@ void lcMainWindow::HandleCommand(lcCommandId CommandId)
break; break;
case LC_EDIT_SELECT_BY_NAME: case LC_EDIT_SELECT_BY_NAME:
if (ActiveModel) ShowSelectDialog();
ActiveModel->ShowSelectByNameDialog();
break; break;
case LC_EDIT_SELECTION_SINGLE: case LC_EDIT_SELECTION_SINGLE:
+1
View File
@@ -329,6 +329,7 @@ protected:
void ShowInstructionsDialog(); void ShowInstructionsDialog();
void ShowPrintDialog(); void ShowPrintDialog();
void ShowImageDialog(); void ShowImageDialog();
void ShowSelectDialog();
void CreatePreviewWidget(); void CreatePreviewWidget();
bool OpenProjectFile(const QString& FileName); bool OpenProjectFile(const QString& FileName);
-17
View File
@@ -15,7 +15,6 @@
#include "lc_view.h" #include "lc_view.h"
#include "minifig.h" #include "minifig.h"
#include "lc_arraydialog.h" #include "lc_arraydialog.h"
#include "lc_qselectdialog.h"
#include "lc_minifigdialog.h" #include "lc_minifigdialog.h"
#include "lc_groupdialog.h" #include "lc_groupdialog.h"
#include "lc_editgroupsdialog.h" #include "lc_editgroupsdialog.h"
@@ -5431,22 +5430,6 @@ void lcModel::ShowPropertiesDialog()
EndHistorySequence(tr("Change Model Properties")); 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() void lcModel::ShowArrayDialog()
{ {
lcVector3 Center; lcVector3 Center;
-1
View File
@@ -384,7 +384,6 @@ public:
void SetCameraProjection(lcCamera* Camera, lcCameraProjection CameraProjection); void SetCameraProjection(lcCamera* Camera, lcCameraProjection CameraProjection);
void ShowPropertiesDialog(); void ShowPropertiesDialog();
void ShowSelectByNameDialog();
void ShowArrayDialog(); void ShowArrayDialog();
void ShowMinifigDialog(); void ShowMinifigDialog();
void UpdateInterface(); void UpdateInterface();
@@ -1,6 +1,6 @@
#include "lc_global.h" #include "lc_global.h"
#include "lc_qselectdialog.h" #include "lc_selectdialog.h"
#include "ui_lc_qselectdialog.h" #include "ui_lc_selectdialog.h"
#include "lc_model.h" #include "lc_model.h"
#include "piece.h" #include "piece.h"
#include "camera.h" #include "camera.h"
+5 -5
View File
@@ -221,6 +221,7 @@ SOURCES += \
common/lc_profile.cpp \ common/lc_profile.cpp \
common/lc_propertieswidget.cpp \ common/lc_propertieswidget.cpp \
common/lc_scene.cpp \ common/lc_scene.cpp \
common/lc_selectdialog.cpp \
common/lc_shortcuts.cpp \ common/lc_shortcuts.cpp \
common/lc_string.cpp \ common/lc_string.cpp \
common/lc_stringcache.cpp \ common/lc_stringcache.cpp \
@@ -236,7 +237,6 @@ SOURCES += \
common/lc_viewwidget.cpp \ common/lc_viewwidget.cpp \
common/lc_zipfile.cpp \ common/lc_zipfile.cpp \
qt/qtmain.cpp \ qt/qtmain.cpp \
qt/lc_qselectdialog.cpp \
qt/lc_qpropertiesdialog.cpp \ qt/lc_qpropertiesdialog.cpp \
qt/lc_qpreferencesdialog.cpp \ qt/lc_qpreferencesdialog.cpp \
qt/lc_qutils.cpp \ qt/lc_qutils.cpp \
@@ -294,12 +294,14 @@ HEADERS += \
common/lc_modellistdialog.h \ common/lc_modellistdialog.h \
common/lc_objectproperty.h \ common/lc_objectproperty.h \
common/lc_pagesetupdialog.h \ common/lc_pagesetupdialog.h \
common/lc_partpalettedialog.h \
common/lc_partselectionpopup.h \ common/lc_partselectionpopup.h \
common/lc_partselectionwidget.h \ common/lc_partselectionwidget.h \
common/lc_previewwidget.h \ common/lc_previewwidget.h \
common/lc_profile.h \ common/lc_profile.h \
common/lc_propertieswidget.h \ common/lc_propertieswidget.h \
common/lc_scene.h \ common/lc_scene.h \
common/lc_selectdialog.h \
common/lc_shortcuts.h \ common/lc_shortcuts.h \
common/lc_string.h \ common/lc_string.h \
common/lc_stringcache.h \ common/lc_stringcache.h \
@@ -314,13 +316,11 @@ HEADERS += \
common/lc_viewsphere.h \ common/lc_viewsphere.h \
common/lc_viewwidget.h \ common/lc_viewwidget.h \
common/lc_zipfile.h \ common/lc_zipfile.h \
qt/lc_qselectdialog.h \
qt/lc_qpropertiesdialog.h \ qt/lc_qpropertiesdialog.h \
qt/lc_qpreferencesdialog.h \ qt/lc_qpreferencesdialog.h \
qt/lc_qutils.h \ qt/lc_qutils.h \
qt/lc_renderdialog.h \ qt/lc_renderdialog.h \
qt/lc_setsdatabasedialog.h \ qt/lc_setsdatabasedialog.h
common/lc_partpalettedialog.h
FORMS += \ FORMS += \
common/lc_aboutdialog.ui \ common/lc_aboutdialog.ui \
common/lc_arraydialog.ui \ common/lc_arraydialog.ui \
@@ -333,8 +333,8 @@ FORMS += \
common/lc_modellistdialog.ui \ common/lc_modellistdialog.ui \
common/lc_pagesetupdialog.ui \ common/lc_pagesetupdialog.ui \
common/lc_partpalettedialog.ui \ common/lc_partpalettedialog.ui \
common/lc_selectdialog.ui \
common/lc_updatedialog.ui \ common/lc_updatedialog.ui \
qt/lc_qselectdialog.ui \
qt/lc_qpropertiesdialog.ui \ qt/lc_qpropertiesdialog.ui \
qt/lc_qpreferencesdialog.ui \ qt/lc_qpreferencesdialog.ui \
qt/lc_renderdialog.ui \ qt/lc_renderdialog.ui \
+4 -4
View File
@@ -8052,22 +8052,22 @@ GL_EXT_texture_filter_anisotropic rozšíření: %5
<context> <context>
<name>lcSelectDialog</name> <name>lcSelectDialog</name>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="14"/> <location filename="../common/lc_selectdialog.ui" line="14"/>
<source>Select Objects</source> <source>Select Objects</source>
<translation>Vybrat objekty</translation> <translation>Vybrat objekty</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="34"/> <location filename="../common/lc_selectdialog.ui" line="34"/>
<source>All</source> <source>All</source>
<translation>Vše</translation> <translation>Vše</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="41"/> <location filename="../common/lc_selectdialog.ui" line="41"/>
<source>None</source> <source>None</source>
<translation>Žádné</translation> <translation>Žádné</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="48"/> <location filename="../common/lc_selectdialog.ui" line="48"/>
<source>Invert</source> <source>Invert</source>
<translation>Invertovat</translation> <translation>Invertovat</translation>
</message> </message>
+4 -4
View File
@@ -7942,22 +7942,22 @@ Anisotropic: %5
<context> <context>
<name>lcSelectDialog</name> <name>lcSelectDialog</name>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="14"/> <location filename="../common/lc_selectdialog.ui" line="14"/>
<source>Select Objects</source> <source>Select Objects</source>
<translation>Objekte auswählen</translation> <translation>Objekte auswählen</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="34"/> <location filename="../common/lc_selectdialog.ui" line="34"/>
<source>All</source> <source>All</source>
<translation>Alle</translation> <translation>Alle</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="41"/> <location filename="../common/lc_selectdialog.ui" line="41"/>
<source>None</source> <source>None</source>
<translation>Keine</translation> <translation>Keine</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="48"/> <location filename="../common/lc_selectdialog.ui" line="48"/>
<source>Invert</source> <source>Invert</source>
<translation>Umkehren</translation> <translation>Umkehren</translation>
</message> </message>
+4 -4
View File
@@ -8085,22 +8085,22 @@ Anisotropic: %5
<context> <context>
<name>lcSelectDialog</name> <name>lcSelectDialog</name>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="14"/> <location filename="../common/lc_selectdialog.ui" line="14"/>
<source>Select Objects</source> <source>Select Objects</source>
<translation>Seleccionar objetos</translation> <translation>Seleccionar objetos</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="34"/> <location filename="../common/lc_selectdialog.ui" line="34"/>
<source>All</source> <source>All</source>
<translation>Todos</translation> <translation>Todos</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="41"/> <location filename="../common/lc_selectdialog.ui" line="41"/>
<source>None</source> <source>None</source>
<translation>Ninguno</translation> <translation>Ninguno</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="48"/> <location filename="../common/lc_selectdialog.ui" line="48"/>
<source>Invert</source> <source>Invert</source>
<translation>Invertir</translation> <translation>Invertir</translation>
</message> </message>
+4 -4
View File
@@ -7816,22 +7816,22 @@ Anisotropic: %5
<context> <context>
<name>lcSelectDialog</name> <name>lcSelectDialog</name>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="14"/> <location filename="../common/lc_selectdialog.ui" line="14"/>
<source>Select Objects</source> <source>Select Objects</source>
<translation>Sélectionner des objets</translation> <translation>Sélectionner des objets</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="34"/> <location filename="../common/lc_selectdialog.ui" line="34"/>
<source>All</source> <source>All</source>
<translation>Tous</translation> <translation>Tous</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="41"/> <location filename="../common/lc_selectdialog.ui" line="41"/>
<source>None</source> <source>None</source>
<translation>Aucun</translation> <translation>Aucun</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="48"/> <location filename="../common/lc_selectdialog.ui" line="48"/>
<source>Invert</source> <source>Invert</source>
<translation>Inverser</translation> <translation>Inverser</translation>
</message> </message>
+4 -4
View File
@@ -7812,22 +7812,22 @@ Anisotropic: %5
<context> <context>
<name>lcSelectDialog</name> <name>lcSelectDialog</name>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="14"/> <location filename="../common/lc_selectdialog.ui" line="14"/>
<source>Select Objects</source> <source>Select Objects</source>
<translation>Selecionar Objetos</translation> <translation>Selecionar Objetos</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="34"/> <location filename="../common/lc_selectdialog.ui" line="34"/>
<source>All</source> <source>All</source>
<translation>Todos</translation> <translation>Todos</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="41"/> <location filename="../common/lc_selectdialog.ui" line="41"/>
<source>None</source> <source>None</source>
<translation>Nenhum</translation> <translation>Nenhum</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="48"/> <location filename="../common/lc_selectdialog.ui" line="48"/>
<source>Invert</source> <source>Invert</source>
<translation>Inverter</translation> <translation>Inverter</translation>
</message> </message>
+4 -4
View File
@@ -7954,22 +7954,22 @@ GL_EXT_texture_filter_anisotropic extension: %5
<context> <context>
<name>lcSelectDialog</name> <name>lcSelectDialog</name>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="14"/> <location filename="../common/lc_selectdialog.ui" line="14"/>
<source>Select Objects</source> <source>Select Objects</source>
<translation>Выделение объектов</translation> <translation>Выделение объектов</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="34"/> <location filename="../common/lc_selectdialog.ui" line="34"/>
<source>All</source> <source>All</source>
<translation>Все</translation> <translation>Все</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="41"/> <location filename="../common/lc_selectdialog.ui" line="41"/>
<source>None</source> <source>None</source>
<translation>Ни одного</translation> <translation>Ни одного</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="48"/> <location filename="../common/lc_selectdialog.ui" line="48"/>
<source>Invert</source> <source>Invert</source>
<translation>Инвертировать</translation> <translation>Инвертировать</translation>
</message> </message>
+4 -4
View File
@@ -7878,22 +7878,22 @@ GL_EXT_texture_filter_anisotropic extension: %5
<context> <context>
<name>lcSelectDialog</name> <name>lcSelectDialog</name>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="14"/> <location filename="../common/lc_selectdialog.ui" line="14"/>
<source>Select Objects</source> <source>Select Objects</source>
<translation>Виділити об&apos;єкти</translation> <translation>Виділити об&apos;єкти</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="34"/> <location filename="../common/lc_selectdialog.ui" line="34"/>
<source>All</source> <source>All</source>
<translation>Усі</translation> <translation>Усі</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="41"/> <location filename="../common/lc_selectdialog.ui" line="41"/>
<source>None</source> <source>None</source>
<translation>Нічого</translation> <translation>Нічого</translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="48"/> <location filename="../common/lc_selectdialog.ui" line="48"/>
<source>Invert</source> <source>Invert</source>
<translation>Інвертувати</translation> <translation>Інвертувати</translation>
</message> </message>
+4 -4
View File
@@ -7740,22 +7740,22 @@ Anisotropic: %5
<context> <context>
<name>lcSelectDialog</name> <name>lcSelectDialog</name>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="14"/> <location filename="../common/lc_selectdialog.ui" line="14"/>
<source>Select Objects</source> <source>Select Objects</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="34"/> <location filename="../common/lc_selectdialog.ui" line="34"/>
<source>All</source> <source>All</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="41"/> <location filename="../common/lc_selectdialog.ui" line="41"/>
<source>None</source> <source>None</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../qt/lc_qselectdialog.ui" line="48"/> <location filename="../common/lc_selectdialog.ui" line="48"/>
<source>Invert</source> <source>Invert</source>
<translation></translation> <translation></translation>
</message> </message>