1 // Copyright (C) 2015-2016 OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // File : PyEditor_StdSettings.cxx
20 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
23 #include "PyEditor_StdSettings.h"
25 PyEditor_StdSettings::PyEditor_StdSettings() :
31 PyEditor_StdSettings::PyEditor_StdSettings( const QString& group ) :
38 PyEditor_StdSettings::PyEditor_StdSettings( const QString& group,
39 const QString& filename,
40 QSettings::Format format ) :
41 mySettings( filename, format ),
48 void PyEditor_StdSettings::setLanguage( const QString& language )
50 myLanguage = language;
53 QString PyEditor_StdSettings::language() const
58 void PyEditor_StdSettings::load()
60 mySettings.beginGroup( myGroup.isEmpty() ? option( snEditor ) : myGroup );
62 setHighlightCurrentLine( mySettings.value( option( snHighlightCurrentLine ), highlightCurrentLine() ).toBool() );
63 setTextWrapping( mySettings.value( option( snTextWrapping ), textWrapping() ).toBool() );
64 setCenterCursorOnScroll( mySettings.value( option( snCenterCursorOnScroll ), centerCursorOnScroll() ).toBool() );
65 setLineNumberArea( mySettings.value( option( snLineNumberArea ), lineNumberArea() ).toBool() );
66 setVerticalEdge( mySettings.value( option( snVerticalEdge ), verticalEdge() ).toBool() );
67 setNumberColumns( mySettings.value( option( snNumberColumns ), numberColumns() ).toInt() );
68 setTabSpaceVisible( mySettings.value( option( snTabSpaceVisible ), tabSpaceVisible() ).toBool() );
69 setTabSize( mySettings.value( option( snTabSize ), tabSize() ).toInt() );
70 setFont( mySettings.value( option( snFont ), font() ).value<QFont>() );
71 setLanguage( mySettings.value( "language", language() ).toString() );
73 mySettings.endGroup();
76 void PyEditor_StdSettings::save()
78 mySettings.beginGroup( myGroup.isEmpty() ? option( snEditor ) : myGroup );
80 mySettings.setValue( option( snHighlightCurrentLine ), highlightCurrentLine() );
81 mySettings.setValue( option( snTextWrapping ), textWrapping() );
82 mySettings.setValue( option( snCenterCursorOnScroll ), centerCursorOnScroll() );
83 mySettings.setValue( option( snLineNumberArea ), lineNumberArea() );
84 mySettings.setValue( option( snVerticalEdge ), verticalEdge() );
85 mySettings.setValue( option( snNumberColumns ), numberColumns() );
86 mySettings.setValue( option( snTabSpaceVisible ), tabSpaceVisible() );
87 mySettings.setValue( option( snTabSize ), tabSize() );
88 mySettings.setValue( option( snFont ), font() );
89 mySettings.setValue( "language", language() );
91 mySettings.endGroup();