Refactor the creation of a new Window/Terminal pair and joining them, into Terminator, and call it from the top level terminator script
This commit is contained in:
parent
1236a85370
commit
ece0cfdde0
@ -51,12 +51,7 @@ if __name__ == '__main__':
|
||||
MAKER = Factory()
|
||||
TERMINATOR = Terminator()
|
||||
TERMINATOR.reconfigure()
|
||||
WINDOW = MAKER.make('Window')
|
||||
TERMINAL = MAKER.make('Terminal')
|
||||
|
||||
WINDOW.add(TERMINAL)
|
||||
WINDOW.show()
|
||||
TERMINAL.spawn_child()
|
||||
TERMINATOR.new_window()
|
||||
|
||||
if OPTIONS.debug > 2:
|
||||
import terminatorlib.debugserver as debugserver
|
||||
|
@ -8,8 +8,8 @@ import gtk
|
||||
from borg import Borg
|
||||
from config import Config
|
||||
from keybindings import Keybindings
|
||||
from util import dbg, err, get_top_window
|
||||
import util
|
||||
from util import dbg, err
|
||||
from factory import Factory
|
||||
|
||||
class Terminator(Borg):
|
||||
"""master object for the application"""
|
||||
@ -90,6 +90,17 @@ class Terminator(Borg):
|
||||
dbg('Terminator::deregister_terminal: %d terminals remain' %
|
||||
len(self.terminals))
|
||||
|
||||
def new_window(self):
|
||||
"""Create a window with a Terminal in it"""
|
||||
maker = Factory()
|
||||
window = maker.make('Window')
|
||||
terminal = maker.make('Terminal')
|
||||
window.add(terminal)
|
||||
window.show()
|
||||
terminal.spawn_child()
|
||||
|
||||
return(window, terminal)
|
||||
|
||||
def reconfigure(self):
|
||||
"""Update configuration for the whole application"""
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user