@@ -36,7 +36,6 @@ def __init__(self, parent):
3636 self .restoreSettings ()
3737 self .initialCheck ()
3838 self .autoCompletionOptions ()
39- self .fontConfig ()
4039
4140 self .addAPIpath .setIcon (QIcon (":/images/themes/default/symbologyAdd.png" ))
4241 self .addAPIpath .setToolTip (QCoreApplication .translate ("PythonConsole" , "Add API path" ))
@@ -124,25 +123,13 @@ def removeAPI(self):
124123 for index in reversed (listItemSel ):
125124 self .tableWidget .removeRow (index .row ())
126125
127- def fontConfig (self ):
128- #fontFamily = ['Courier','Monospace','Aurulent Sans','Bitstream Vera Serif']
129- #for i in range(0, len(fontFamily)):
130- #self.comboBox.addItem(fontFamily[i])
131- settings = QSettings ()
132- self .fontComboBox .setCurrentIndex (settings .value ("pythonConsole/fontfamilyindex" ).toInt ()[0 ])
133- self .fontComboBoxEditor .setCurrentIndex (settings .value ("pythonConsole/fontfamilyindexEditor" ).toInt ()[0 ])
134-
135126 def saveSettings (self ):
136127 settings = QSettings ()
137128 settings .setValue ("pythonConsole/preloadAPI" , QVariant (self .preloadAPI .isChecked ()))
138129 settings .setValue ("pythonConsole/autoSaveScript" , QVariant (self .autoSaveScript .isChecked ()))
139- fontFamilyIndex = self .fontComboBox .currentIndex ()
140- settings .setValue ("pythonConsole/fontfamilyindex" , QVariant (fontFamilyIndex ))
130+
141131 fontFamilyText = self .fontComboBox .currentText ()
142132 settings .setValue ("pythonConsole/fontfamilytext" , QVariant (fontFamilyText ))
143-
144- fontFamilyIndexEditor = self .fontComboBoxEditor .currentIndex ()
145- settings .setValue ("pythonConsole/fontfamilyindexEditor" , QVariant (fontFamilyIndexEditor ))
146133 fontFamilyTextEditor = self .fontComboBoxEditor .currentText ()
147134 settings .setValue ("pythonConsole/fontfamilytextEditor" , QVariant (fontFamilyTextEditor ))
148135
@@ -176,11 +163,17 @@ def saveSettings(self):
176163 settings .setValue ("pythonConsole/autoCompleteEnabledEditor" , QVariant (self .autoCompleteEnabledEditor .isChecked ()))
177164 settings .setValue ("pythonConsole/autoCompleteEnabled" , QVariant (self .autoCompleteEnabled .isChecked ()))
178165 settings .setValue ("pythonConsole/enableObjectInsp" , QVariant (self .enableObjectInspector .isChecked ()))
166+ settings .setValue ("pythonConsole/autoCloseBracket" , QVariant (self .autoCloseBracket .isChecked ()))
167+ settings .setValue ("pythonConsole/autoCloseBracketEditor" , QVariant (self .autoCloseBracketEditor .isChecked ()))
179168
180169 def restoreSettings (self ):
181170 settings = QSettings ()
182171 self .spinBox .setValue (settings .value ("pythonConsole/fontsize" , 10 ).toInt ()[0 ])
183172 self .spinBoxEditor .setValue (settings .value ("pythonConsole/fontsizeEditor" , 10 ).toInt ()[0 ])
173+ self .fontComboBox .setCurrentFont (QFont (settings .value ("pythonConsole/fontfamilytext" ,
174+ "Monospace" ).toString ()))
175+ self .fontComboBoxEditor .setCurrentFont (QFont (settings .value ("pythonConsole/fontfamilytextEditor" ,
176+ "Monospace" ).toString ()))
184177 self .preloadAPI .setChecked (settings .value ("pythonConsole/preloadAPI" , True ).toBool ())
185178 itemTable = settings .value ("pythonConsole/userAPI" ).toStringList ()
186179 for i in range (len (itemTable )):
@@ -198,6 +191,8 @@ def restoreSettings(self):
198191 self .autoCompleteEnabledEditor .setChecked (settings .value ("pythonConsole/autoCompleteEnabledEditor" , True ).toBool ())
199192 self .autoCompleteEnabled .setChecked (settings .value ("pythonConsole/autoCompleteEnabled" , True ).toBool ())
200193 self .enableObjectInspector .setChecked (settings .value ("pythonConsole/enableObjectInsp" , False ).toBool ())
194+ self .autoCloseBracketEditor .setChecked (settings .value ("pythonConsole/autoCloseBracketEditor" , True ).toBool ())
195+ self .autoCloseBracket .setChecked (settings .value ("pythonConsole/autoCloseBracket" , True ).toBool ())
201196
202197 if settings .value ("pythonConsole/autoCompleteSource" ) == 'fromDoc' :
203198 self .autoCompFromDoc .setChecked (True )
0 commit comments