Fix exception when changing font

Thanks: Roland Hieber
Closes: #751401
parent f3e93c6f
From: Roland Hieber <rohieb@rohieb.name>
Subject: Fix editor font not being written to config file
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=751401
Index: seascope-0.8/src/DialogManager.py
===================================================================
--- seascope-0.8.orig/src/DialogManager.py
+++ seascope-0.8/src/DialogManager.py
@@ -146,7 +146,7 @@ class FilePreferencesDialog(QObject):
self.inner_editing = self.dlg.prd_opt_inner_ed.checkState() == Qt.Checked
self.show_ln_nr = self.dlg.prd_opt_show_ln_nr.checkState() == Qt.Checked
return (self.app_style, self.dlg.prd_font_app_btn.font().toString(), self.edit_ext_cmd,
- self.ev_font, self.exit_dontask, self.inner_editing, self.show_ln_nr)
+ self.ev_font.toString(), self.exit_dontask, self.inner_editing, self.show_ln_nr)
def show_preferences_dialog(app_style, edit_ext_cmd, ev_font, dontask, innered, ln_nr):
d = FilePreferencesDialog(app_style, edit_ext_cmd, ev_font, dontask, innered, ln_nr)
Index: seascope-0.8/src/Seascope.py
===================================================================
--- seascope-0.8.orig/src/Seascope.py
+++ seascope-0.8/src/Seascope.py
@@ -33,13 +33,13 @@ class SeascopeApp(QMainWindow):
ev_font = QFont()
ev_font.fromString(self.edit_book.ev_font)
res = DialogManager.show_preferences_dialog(self.app_style, self.edit_ext_cmd, ev_font, self.exit_dont_ask, self.inner_editing, self.eb_is_show_line)
- (self.app_style, self.app_font, self.edit_ext_cmd, ev_font, self.exit_dont_ask, self.inner_editing_conf, self.eb_is_show_line) = res
+ (self.app_style, self.app_font, self.edit_ext_cmd, self.ev_font, self.exit_dont_ask, self.inner_editing_conf, self.eb_is_show_line) = res
if self.edit_ext_cmd != None:
self.edit_ext_cmd = str(self.edit_ext_cmd).strip()
if (self.edit_ext_cmd == None or self.edit_ext_cmd == ''):
self.edit_ext_cmd = 'x-terminal-emulator -e vim %F +%L'
- self.edit_book.change_ev_font(ev_font.toString())
- self.code_ctx_view.change_ev_font(ev_font.toString())
+ self.edit_book.change_ev_font(self.ev_font)
+ self.code_ctx_view.change_ev_font(self.ev_font)
self.edit_book.show_line_number_pref(self.eb_is_show_line)
self.app_write_config()
Index: seascope-0.8/src/view/EdView.py
===================================================================
--- seascope-0.8.orig/src/view/EdView.py
+++ seascope-0.8/src/view/EdView.py
@@ -73,8 +73,10 @@ class EditorViewBase(QsciScintilla):
self.setFont(self.font)
self.setMarginsFont(self.font)
- self.lexer.setFont(self.font,-1)
- self.setLexer(self.lexer)
+ if self.lexer:
+ # lexer can be null if no file is open at the moment
+ self.lexer.setFont(self.font,-1)
+ self.setLexer(self.lexer)
def lpropChanged(self, prop, val):
print 'lpropChanged', prop, val
bug-751401-save-editor-font-in-config.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment