Prepare for the new Terminator class
This commit is contained in:
parent
49510266ed
commit
b3635d2912
|
@ -11,6 +11,7 @@ import gtk
|
||||||
from util import dbg, err
|
from util import dbg, err
|
||||||
from version import APP_NAME
|
from version import APP_NAME
|
||||||
from container import Container
|
from container import Container
|
||||||
|
from newterminator import Terminator
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import deskbar.core.keybinder as bindkey
|
import deskbar.core.keybinder as bindkey
|
||||||
|
@ -21,6 +22,7 @@ except ImportError:
|
||||||
class Window(Container, gtk.Window):
|
class Window(Container, gtk.Window):
|
||||||
"""Class implementing a top-level Terminator window"""
|
"""Class implementing a top-level Terminator window"""
|
||||||
|
|
||||||
|
terminator = None
|
||||||
title = None
|
title = None
|
||||||
isfullscreen = None
|
isfullscreen = None
|
||||||
ismaximised = None
|
ismaximised = None
|
||||||
|
@ -29,6 +31,8 @@ class Window(Container, gtk.Window):
|
||||||
|
|
||||||
def __init__(self, configobject):
|
def __init__(self, configobject):
|
||||||
"""Class initialiser"""
|
"""Class initialiser"""
|
||||||
|
self.terminator = Terminator()
|
||||||
|
|
||||||
Container.__init__(self, configobject)
|
Container.__init__(self, configobject)
|
||||||
gtk.Window.__init__(self)
|
gtk.Window.__init__(self)
|
||||||
gobject.type_register(Window)
|
gobject.type_register(Window)
|
||||||
|
@ -40,6 +44,8 @@ class Window(Container, gtk.Window):
|
||||||
self.register_callbacks()
|
self.register_callbacks()
|
||||||
self.apply_config()
|
self.apply_config()
|
||||||
|
|
||||||
|
self.default_setup()
|
||||||
|
|
||||||
def register_callbacks(self):
|
def register_callbacks(self):
|
||||||
"""Connect the GTK+ signals we care about"""
|
"""Connect the GTK+ signals we care about"""
|
||||||
self.connect('key-press-event', self.on_key_press)
|
self.connect('key-press-event', self.on_key_press)
|
||||||
|
@ -85,6 +91,15 @@ class Window(Container, gtk.Window):
|
||||||
|
|
||||||
self.set_icon(icon)
|
self.set_icon(icon)
|
||||||
|
|
||||||
|
def default_setup(self):
|
||||||
|
"""Set up the default child widget"""
|
||||||
|
terminal = self.terminator.new_terminal()
|
||||||
|
|
||||||
|
self.add(terminal)
|
||||||
|
terminal.hide_titlebar()
|
||||||
|
self.show()
|
||||||
|
terminal.spawn_child()
|
||||||
|
|
||||||
def on_key_press(self, window, event):
|
def on_key_press(self, window, event):
|
||||||
"""Handle a keyboard event"""
|
"""Handle a keyboard event"""
|
||||||
pass
|
pass
|
||||||
|
@ -197,10 +212,4 @@ CONFIG = {'fullscreen':False,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WINDOW = Window(CONFIG)
|
|
||||||
WINDOWTITLE = WindowTitle(WINDOW)
|
|
||||||
WINDOWTITLE.update()
|
|
||||||
WINDOW.show_all()
|
|
||||||
gtk.main()
|
|
||||||
|
|
||||||
# vim: set expandtab ts=4 sw=4:
|
# vim: set expandtab ts=4 sw=4:
|
||||||
|
|
Loading…
Reference in New Issue