Kaydet (Commit) dc72f48e authored tarafından Steven M. Gava's avatar Steven M. Gava

moving to new config system

üst 4b517854
...@@ -16,7 +16,8 @@ import tkMessageBox ...@@ -16,7 +16,8 @@ import tkMessageBox
import webbrowser import webbrowser
import idlever import idlever
import WindowList import WindowList
from IdleConf import idleconf #from IdleConf import idleconf
from configHandler import idleConf
import aboutDialog, textView, configDialog import aboutDialog, textView, configDialog
# The default tab setting for a Text widget, in average-width characters. # The default tab setting for a Text widget, in average-width characters.
...@@ -79,7 +80,6 @@ TK_TABWIDTH_DEFAULT = 8 ...@@ -79,7 +80,6 @@ TK_TABWIDTH_DEFAULT = 8
#$ unix <Control-x> #$ unix <Control-x>
class EditorWindow: class EditorWindow:
from Percolator import Percolator from Percolator import Percolator
from ColorDelegator import ColorDelegator from ColorDelegator import ColorDelegator
from UndoDelegator import UndoDelegator from UndoDelegator import UndoDelegator
...@@ -91,8 +91,7 @@ class EditorWindow: ...@@ -91,8 +91,7 @@ class EditorWindow:
vars = {} vars = {}
def __init__(self, flist=None, filename=None, key=None, root=None): def __init__(self, flist=None, filename=None, key=None, root=None):
edconf = idleconf.getsection('EditorWindow') currentTheme=idleConf.CurrentTheme()
coconf = idleconf.getsection('Colors')
self.flist = flist self.flist = flist
root = root or flist.root root = root or flist.root
self.root = root self.root = root
...@@ -102,15 +101,19 @@ class EditorWindow: ...@@ -102,15 +101,19 @@ class EditorWindow:
self.top = top = self.Toplevel(root, menu=self.menubar) self.top = top = self.Toplevel(root, menu=self.menubar)
self.vbar = vbar = Scrollbar(top, name='vbar') self.vbar = vbar = Scrollbar(top, name='vbar')
self.text_frame = text_frame = Frame(top) self.text_frame = text_frame = Frame(top)
self.text = text = Text(text_frame, name='text', padx=5, self.text = text = Text(text_frame, name='text', padx=5, wrap=None,
foreground=coconf.getdef('normal-foreground'), foreground=idleConf.GetHighlight(currentTheme,
background=coconf.getdef('normal-background'), 'normal',fgBg='fg'),
highlightcolor=coconf.getdef('hilite-foreground'), background=idleConf.GetHighlight(currentTheme,
highlightbackground=coconf.getdef('hilite-background'), 'normal',fgBg='bg'),
insertbackground=coconf.getdef('cursor-background'), highlightcolor=idleConf.GetHighlight(currentTheme,
width=edconf.getint('width'), 'hilite',fgBg='fg'),
height=edconf.getint('height'), highlightbackground=idleConf.GetHighlight(currentTheme,
wrap="none") 'hilite',fgBg='bg'),
insertbackground=idleConf.GetHighlight(currentTheme,
'cursor',fgBg='fg'),
width=idleConf.GetOption('main','EditorWindow','width'),
height=idleConf.GetOption('main','EditorWindow','height') )
self.createmenubar() self.createmenubar()
self.apply_bindings() self.apply_bindings()
...@@ -144,7 +147,8 @@ class EditorWindow: ...@@ -144,7 +147,8 @@ class EditorWindow:
vbar.pack(side=RIGHT, fill=Y) vbar.pack(side=RIGHT, fill=Y)
text['yscrollcommand'] = vbar.set text['yscrollcommand'] = vbar.set
text['font'] = edconf.get('font-name'), edconf.get('font-size') text.config(font=(idleConf.GetOption('main','EditorWindow','font'),
idleConf.GetOption('main','EditorWindow','font-size')))
text_frame.pack(side=LEFT, fill=BOTH, expand=1) text_frame.pack(side=LEFT, fill=BOTH, expand=1)
text.pack(side=TOP, fill=BOTH, expand=1) text.pack(side=TOP, fill=BOTH, expand=1)
text.focus_set() text.focus_set()
...@@ -539,7 +543,7 @@ class EditorWindow: ...@@ -539,7 +543,7 @@ class EditorWindow:
traceback.print_exc() traceback.print_exc()
def get_standard_extension_names(self): def get_standard_extension_names(self):
return idleconf.getextensions() return idleConf.GetExtensions()
def load_extension(self, name): def load_extension(self, name):
mod = __import__(name, globals(), locals(), []) mod = __import__(name, globals(), locals(), [])
......
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