Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Ortiz <rafael@activitycentral.com>2011-07-25 19:22:20 (GMT)
committer Rafael Ortiz <rafael@activitycentral.com>2011-07-25 19:22:20 (GMT)
commita8a37e67bbe1b4f558736527a407369d97fe9ad8 (patch)
treeb08fe75fb5e14e15a52d8f7d03b1519adc992c20
parentfb1646127dc35b27f9264f8b686bf0095f977c5d (diff)
code comments
-rwxr-xr-xterminal.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/terminal.py b/terminal.py
index f04fece..7c21c73 100755
--- a/terminal.py
+++ b/terminal.py
@@ -314,7 +314,7 @@ class TerminalActivity(activity.Activity):
self._next_tab_button.show()
return tab_toolbar
- def __open_tab_cb(self, btn):
+ def __open_tab_cb(self, btn): # cb per open tab
index = self._create_tab(None)
self._notebook.page = index
if self._notebook.get_n_pages() == 2:
@@ -322,14 +322,14 @@ class TerminalActivity(activity.Activity):
self._previous_tab_button.props.sensitive = True
self._next_tab_button.props.sensitive = True
- def __close_tab_cb(self, btn):
+ def __close_tab_cb(self, btn): # cb per closed tab
self._close_tab(self._notebook.props.page)
if self._notebook.get_n_pages() == 1:
self._delete_tab_button.props.sensitive = False
self._previous_tab_button.props.sensitive = False
self._next_tab_button.props.sensitive = False
- def __prev_tab_cb(self, btn):
+ def __prev_tab_cb(self, btn): # cb per previous tab
if self._notebook.props.page == 0:
self._notebook.props.page = self._notebook.get_n_pages() - 1
else:
@@ -337,7 +337,7 @@ class TerminalActivity(activity.Activity):
vt = self._notebook.get_nth_page(self._notebook.get_current_page()).vt
vt.grab_focus()
- def __next_tab_cb(self, btn):
+ def __next_tab_cb(self, btn): # cb per nex tab
if self._notebook.props.page == self._notebook.get_n_pages() - 1:
self._notebook.props.page = 0
else:
@@ -345,31 +345,31 @@ class TerminalActivity(activity.Activity):
vt = self._notebook.get_nth_page(self._notebook.get_current_page()).vt
vt.grab_focus()
- def _close_tab(self, index):
+ def _close_tab(self, index): # cb per close tab
self._notebook.remove_page(index)
if self._notebook.get_n_pages() == 0:
self.close()
- def __tab_child_exited_cb(self, vt):
+ def __tab_child_exited_cb(self, vt): # cb per child exited tab
for i in range(self._notebook.get_n_pages()):
if self._notebook.get_nth_page(i).vt == vt:
self._close_tab(i)
return
- def __tab_title_changed_cb(self, vt):
+ def __tab_title_changed_cb(self, vt): # cb per title changed
for i in range(self._notebook.get_n_pages()):
if self._notebook.get_nth_page(i).vt == vt:
label = self._notebook.get_nth_page(i).label
label.set_text(vt.get_window_title())
return
- def __drag_data_received_cb(self, widget, context, x, y, selection,
+ def __drag_data_received_cb(self, widget, context, x, y, selection, # cb per drag data recieved
target, time):
widget.feed_child(selection.data)
context.finish(True, False, time)
return True
- def _create_tab(self, tab_state):
+ def _create_tab(self, tab_state): #code ofr creating tab
vt = vte.Terminal()
vt.connect("child-exited", self.__tab_child_exited_cb)
vt.connect("window-title-changed", self.__tab_title_changed_cb)
@@ -444,15 +444,15 @@ class TerminalActivity(activity.Activity):
return index
- def __motion_notify_cb(self, widget, event):
+ def __motion_notify_cb(self, widget, event): #cb for notifying motion
self.canvas.parent.emit('motion-notify-event', event)
- def __become_root_cb(self, button):
+ def __become_root_cb(self, button): # cb for becoming root
vt = self._notebook.get_nth_page(self._notebook.get_current_page()).vt
vt.feed('\r\n')
vt.fork_command("/bin/su", ('/bin/su', '-'))
- def __key_press_cb(self, window, event):
+ def __key_press_cb(self, window, event): # cb for key pressing events
# Escape keypresses are routed directly to the vte and then dropped.
# This hack prevents Sugar from hijacking them and canceling
# fullscreen mode.