| | |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | #include <QPointer> |
| |
|
| |
|
| | #include <Gui/Command.h> |
| | #include <Gui/Control.h> |
| | #include <Gui/MainWindow.h> |
| | #include <Gui/Selection/Selection.h> |
| |
|
| | #include "DlgDisplayPropertiesImp.h" |
| | #include "DlgInspectAppearance.h" |
| | #include "DlgInspectMaterial.h" |
| | #include "DlgMaterialImp.h" |
| | #include "MaterialSave.h" |
| | #include "MaterialsEditor.h" |
| | #include "ModelSelect.h" |
| | #include "TaskMigrateExternal.h" |
| |
|
| |
|
| | |
| |
|
| | |
| | |
| | |
| | DEF_STD_CMD_A(CmdMaterialEdit) |
| |
|
| | CmdMaterialEdit::CmdMaterialEdit() |
| | : Command("Material_Edit") |
| | { |
| | sAppModule = "Material"; |
| | sGroup = QT_TR_NOOP("Material"); |
| | sMenuText = QT_TR_NOOP("Edit"); |
| | sToolTipText = QT_TR_NOOP("Edits material properties"); |
| | sWhatsThis = "Material_Edit"; |
| | sStatusTip = sToolTipText; |
| | sPixmap = "Material_Edit"; |
| | } |
| |
|
| | void CmdMaterialEdit::activated(int iMsg) |
| | { |
| | Q_UNUSED(iMsg); |
| |
|
| | static QPointer<QDialog> dlg = nullptr; |
| | if (!dlg) { |
| | dlg = new MatGui::MaterialsEditor(Gui::getMainWindow()); |
| | } |
| | dlg->setAttribute(Qt::WA_DeleteOnClose); |
| | dlg->show(); |
| | } |
| |
|
| | bool CmdMaterialEdit::isActive() |
| | { |
| | |
| | return true; |
| | } |
| |
|
| | |
| | |
| | |
| | DEF_STD_CMD_A(StdCmdSetAppearance) |
| |
|
| | StdCmdSetAppearance::StdCmdSetAppearance() |
| | : Command("Std_SetAppearance") |
| | { |
| | sGroup = "Standard-View"; |
| | sMenuText = QT_TR_NOOP("&Appearance"); |
| | sToolTipText = QT_TR_NOOP("Sets the display properties of the selected object"); |
| | sWhatsThis = "Std_SetAppearance"; |
| | sStatusTip = QT_TR_NOOP("Sets the display properties of the selected object"); |
| | sPixmap = "Std_SetAppearance"; |
| | sAccel = "Ctrl+D"; |
| | eType = Alter3DView; |
| | } |
| |
|
| | void StdCmdSetAppearance::activated(int iMsg) |
| | { |
| | Q_UNUSED(iMsg); |
| | Gui::Control().showDialog(new MatGui::TaskDisplayProperties()); |
| | } |
| |
|
| | bool StdCmdSetAppearance::isActive() |
| | { |
| | return (Gui::Control().activeDialog() == nullptr) && (Gui::Selection().size() != 0); |
| | } |
| |
|
| | |
| | |
| | |
| | DEF_STD_CMD_A(StdCmdSetMaterial) |
| |
|
| | StdCmdSetMaterial::StdCmdSetMaterial() |
| | : Command("Std_SetMaterial") |
| | { |
| | sGroup = "Standard-View"; |
| | sMenuText = QT_TR_NOOP("&Material"); |
| | sToolTipText = QT_TR_NOOP("Sets the material of the selected object"); |
| | sWhatsThis = "Std_SetMaterial"; |
| | sStatusTip = QT_TR_NOOP("Sets the material of the selected object"); |
| | sPixmap = "Material_Edit"; |
| | |
| | |
| | } |
| |
|
| | void StdCmdSetMaterial::activated(int iMsg) |
| | { |
| | Q_UNUSED(iMsg); |
| | Gui::Control().showDialog(new MatGui::TaskMaterial()); |
| | } |
| |
|
| | bool StdCmdSetMaterial::isActive() |
| | { |
| | return (Gui::Control().activeDialog() == nullptr) && (Gui::Selection().size() != 0); |
| | } |
| |
|
| | |
| | |
| | |
| | DEF_STD_CMD_A(CmdInspectAppearance) |
| |
|
| | CmdInspectAppearance::CmdInspectAppearance() |
| | : Command("Materials_InspectAppearance") |
| | { |
| | sGroup = "Standard-View"; |
| | sMenuText = QT_TR_NOOP("Inspect Appearance"); |
| | sToolTipText = QT_TR_NOOP("Inspects the appearance properties of the selected object"); |
| | sWhatsThis = "Materials_InspectAppearance"; |
| | sStatusTip = QT_TR_NOOP("Inspect the appearance properties of the selected object"); |
| | |
| | } |
| |
|
| | void CmdInspectAppearance::activated(int iMsg) |
| | { |
| | Q_UNUSED(iMsg); |
| | Gui::Control().showDialog(new MatGui::TaskInspectAppearance()); |
| | } |
| |
|
| | bool CmdInspectAppearance::isActive() |
| | { |
| | return (Gui::Control().activeDialog() == nullptr); |
| | } |
| |
|
| | |
| | |
| | |
| | DEF_STD_CMD_A(CmdInspectMaterial) |
| |
|
| | CmdInspectMaterial::CmdInspectMaterial() |
| | : Command("Materials_InspectMaterial") |
| | { |
| | sGroup = "Standard-View"; |
| | sMenuText = QT_TR_NOOP("Inspect Material"); |
| | sToolTipText = QT_TR_NOOP("Inspects the material properties of the selected object"); |
| | sWhatsThis = "Materials_InspectMaterial"; |
| | sStatusTip = QT_TR_NOOP("Inspect the material properties of the selected object"); |
| | |
| | } |
| |
|
| | void CmdInspectMaterial::activated(int iMsg) |
| | { |
| | Q_UNUSED(iMsg); |
| | Gui::Control().showDialog(new MatGui::TaskInspectMaterial()); |
| | } |
| |
|
| | bool CmdInspectMaterial::isActive() |
| | { |
| | return (Gui::Control().activeDialog() == nullptr); |
| | } |
| |
|
| | |
| | |
| | |
| |
|
| | #if defined(BUILD_MATERIAL_EXTERNAL) |
| | DEF_STD_CMD_A(CmdMigrateToExternal) |
| |
|
| | CmdMigrateToExternal::CmdMigrateToExternal() |
| | : Command("Materials_MigrateToExternal") |
| | { |
| | sGroup = "Standard-View"; |
| | sMenuText = QT_TR_NOOP("Migrate"); |
| | sToolTipText = QT_TR_NOOP("Migrates the materials to the external materials manager"); |
| | sWhatsThis = "Materials_MigrateToDatabase"; |
| | sStatusTip = QT_TR_NOOP("Migrate existing materials to the external materials manager"); |
| | |
| | } |
| |
|
| | void CmdMigrateToExternal::activated(int iMsg) |
| | { |
| | Q_UNUSED(iMsg); |
| | MatGui::TaskMigrateExternal* dlg = new MatGui::TaskMigrateExternal(); |
| | Gui::Control().showDialog(dlg); |
| | } |
| |
|
| | bool CmdMigrateToExternal::isActive() |
| | { |
| | return true; |
| | } |
| | #endif |
| |
|
| | |
| |
|
| | void CreateMaterialCommands() |
| | { |
| | Gui::CommandManager& rcCmdMgr = Gui::Application::Instance->commandManager(); |
| |
|
| | rcCmdMgr.addCommand(new CmdMaterialEdit()); |
| | rcCmdMgr.addCommand(new StdCmdSetAppearance()); |
| | rcCmdMgr.addCommand(new StdCmdSetMaterial()); |
| | rcCmdMgr.addCommand(new CmdInspectAppearance()); |
| | rcCmdMgr.addCommand(new CmdInspectMaterial()); |
| | #if defined(BUILD_MATERIAL_EXTERNAL) |
| | rcCmdMgr.addCommand(new CmdMigrateToExternal()); |
| | #endif |
| | } |
| |
|