QScintilla/Terminal.py

changeset 7
c679fb30c8f3
parent 0
de9c2efb9d02
child 12
1d8dd9706f46
equal deleted inserted replaced
6:52e8c820d0dd 7:c679fb30c8f3
251 self.monospacedStyles(font) 251 self.monospacedStyles(font)
252 return 252 return
253 253
254 # get the font for style 0 and set it as the default font 254 # get the font for style 0 and set it as the default font
255 key = 'Scintilla/%s/style0/font' % self.lexer_.language() 255 key = 'Scintilla/%s/style0/font' % self.lexer_.language()
256 fontVariant = Preferences.Prefs.settings.value(key) 256 fdesc = Preferences.Prefs.settings.value(key)
257 if fontVariant.isValid(): 257 if fdesc is not None:
258 fdesc = fontVariant.toStringList()
259 font = QFont(fdesc[0], int(fdesc[1])) 258 font = QFont(fdesc[0], int(fdesc[1]))
260 self.lexer_.setDefaultFont(font) 259 self.lexer_.setDefaultFont(font)
261 self.setLexer(self.lexer_) 260 self.setLexer(self.lexer_)
262 self.lexer_.readSettings(Preferences.Prefs.settings, "Scintilla") 261 self.lexer_.readSettings(Preferences.Prefs.settings, "Scintilla")
263 262
349 348
350 def loadHistory(self): 349 def loadHistory(self):
351 """ 350 """
352 Public method to load the history. 351 Public method to load the history.
353 """ 352 """
354 hVariant = Preferences.Prefs.settings.value("Terminal/History") 353 hl = Preferences.Prefs.settings.value("Terminal/History")
355 if hVariant.isValid(): 354 if hl is not None:
356 hl = hVariant.toStringList()
357 self.history = hl[-self.maxHistoryEntries:] 355 self.history = hl[-self.maxHistoryEntries:]
358 else: 356 else:
359 self.history = [] 357 self.history = []
360 358
361 def reloadHistory(self): 359 def reloadHistory(self):
368 366
369 def saveHistory(self): 367 def saveHistory(self):
370 """ 368 """
371 Public method to save the history. 369 Public method to save the history.
372 """ 370 """
373 Preferences.Prefs.settings.setValue(\ 371 Preferences.Prefs.settings.setValue("Terminal/History", self.history)
374 "Terminal/History", QVariant(self.history))
375 372
376 def getHistory(self): 373 def getHistory(self):
377 """ 374 """
378 Public method to get the history. 375 Public method to get the history.
379 376

eric ide

mercurial