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:
@@ -425,15 +425,6 @@ MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags f)
|
||||
// Python console
|
||||
if (hiddenDockWindows.find("Std_PythonView") == std::string::npos) {
|
||||
PythonConsole* pcPython = new PythonConsole(this);
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetUserParameter().
|
||||
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("General");
|
||||
|
||||
if (hGrp->GetBool("PythonWordWrap", true)) {
|
||||
pcPython->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
|
||||
} else {
|
||||
pcPython->setWordWrapMode(QTextOption::NoWrap);
|
||||
}
|
||||
|
||||
pcPython->setWindowIcon(Gui::BitmapFactory().iconFromTheme("applications-python"));
|
||||
pcPython->setObjectName
|
||||
(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Python console")));
|
||||
|
||||
Reference in New Issue
Block a user