From 60a611c871388e5099b73aa9c028e88dd04069b8 Mon Sep 17 00:00:00 2001 From: DavidXanatos <3890945+DavidXanatos@users.noreply.github.com> Date: Thu, 21 Nov 2024 20:51:36 +0100 Subject: [PATCH] fix --- SandboxiePlus/SandMan/Windows/OptionsWindow.cpp | 11 ++++++----- SandboxiePlus/SandMan/Windows/SettingsWindow.cpp | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp b/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp index 9d0dd040..3f66d2ec 100644 --- a/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp @@ -415,6 +415,12 @@ COptionsWindow::COptionsWindow(const QSharedPointer& pBox, const QStri pTree->setAlternatingRowColors(true); } + m_pCodeEdit = new CCodeEdit(new CIniHighlighter); + ui.txtIniSection->parentWidget()->layout()->replaceWidget(ui.txtIniSection, m_pCodeEdit); + delete ui.txtIniSection; + ui.txtIniSection = NULL; + connect(m_pCodeEdit, SIGNAL(textChanged()), this, SLOT(OnIniChanged())); + CreateDebug(); if (m_Template) @@ -577,11 +583,6 @@ COptionsWindow::COptionsWindow(const QSharedPointer& pBox, const QStri connect(ui.tabs, SIGNAL(currentChanged(int)), this, SLOT(OnTab())); // edit - m_pCodeEdit = new CCodeEdit(new CIniHighlighter); - ui.txtIniSection->parentWidget()->layout()->replaceWidget(ui.txtIniSection, m_pCodeEdit); - ui.txtIniSection->deleteLater(); - connect(m_pCodeEdit, SIGNAL(textChanged()), this, SLOT(OnIniChanged())); - ApplyIniEditFont(); connect(ui.btnEditIni, SIGNAL(clicked(bool)), this, SLOT(OnEditIni())); diff --git a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp index 8b8dfec3..67448544 100644 --- a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp @@ -603,7 +603,8 @@ CSettingsWindow::CSettingsWindow(QWidget* parent) m_pCodeEdit = new CCodeEdit(new CIniHighlighter); ui.txtIniSection->parentWidget()->layout()->replaceWidget(ui.txtIniSection, m_pCodeEdit); - ui.txtIniSection->deleteLater(); + delete ui.txtIniSection; + ui.txtIniSection = NULL; connect(m_pCodeEdit, SIGNAL(textChanged()), this, SLOT(OnIniChanged())); ApplyIniEditFont();