Gui: Attach PythonConsole to parameter group and handle changes in its OnChange() method
This avoids code duplications and makes sure the group name is used only once. The parameters are saved to the group 'PythonConsole' instead of 'General'.
This commit is contained in:
@@ -38,7 +38,6 @@
|
||||
#include "DockWindowManager.h"
|
||||
#include "MainWindow.h"
|
||||
#include "PrefWidgets.h"
|
||||
#include "PythonConsole.h"
|
||||
#include "Language/Translator.h"
|
||||
#include "Gui/PreferencePackManager.h"
|
||||
#include "DlgPreferencesImp.h"
|
||||
@@ -140,19 +139,6 @@ void DlgGeneralImp::saveSettings()
|
||||
ui->EnableCursorBlinking->onSave();
|
||||
ui->SplashScreen->onSave();
|
||||
|
||||
QWidget* pc = DockWindowManager::instance()->getDockWindow("Python console");
|
||||
PythonConsole *pcPython = qobject_cast<PythonConsole*>(pc);
|
||||
if (pcPython) {
|
||||
bool pythonWordWrap = App::GetApplication().GetUserParameter().
|
||||
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("General")->GetBool("PythonWordWrap", true);
|
||||
|
||||
if (pythonWordWrap) {
|
||||
pcPython->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
|
||||
} else {
|
||||
pcPython->setWordWrapMode(QTextOption::NoWrap);
|
||||
}
|
||||
}
|
||||
|
||||
setRecentFileSize();
|
||||
ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("General");
|
||||
QString lang = QLocale::languageToString(QLocale().language());
|
||||
|
||||
Reference in New Issue
Block a user