Make the Shell own the console. Some view changes.
This commit is contained in:
@@ -36,6 +36,7 @@ from view.frame.frame import Frame
|
||||
from view.keyhandler import KeyHandler
|
||||
from view.home.HomeWindow import HomeWindow
|
||||
from model.shellmodel import ShellModel
|
||||
from console import Console
|
||||
|
||||
class Shell(gobject.GObject):
|
||||
def __init__(self, model):
|
||||
@@ -64,6 +65,8 @@ class Shell(gobject.GObject):
|
||||
home_model.connect('pending-activity-changed',
|
||||
self._pending_activity_changed_cb)
|
||||
|
||||
self._console = Console(model)
|
||||
|
||||
gobject.idle_add(self._start_journal_idle)
|
||||
|
||||
def _start_journal_idle(self):
|
||||
@@ -165,6 +168,12 @@ class Shell(gobject.GObject):
|
||||
return host
|
||||
return None
|
||||
|
||||
def toggle_console_visibility(self):
|
||||
if self._console.props.visible:
|
||||
self._console.hide()
|
||||
else:
|
||||
self._console.show()
|
||||
|
||||
def toggle_chat_visibility(self):
|
||||
act = self.get_current_activity()
|
||||
if not act:
|
||||
|
||||
@@ -148,7 +148,7 @@ class KeyHandler(object):
|
||||
gobject.idle_add(self._toggle_console_visibility_cb)
|
||||
|
||||
def handle_new_console(self):
|
||||
console.toggle_visibility()
|
||||
self._shell.toggle_console_visibility()
|
||||
|
||||
def handle_frame(self):
|
||||
self._shell.get_frame().notify_key_press()
|
||||
|
||||
Reference in New Issue
Block a user