Changeset 38142c77f3dc358917b2a802d6e5c0620bfa67f7
- Timestamp:
- 06/11/08 16:15:52 (4 years ago)
- Author:
- Lincoln de Sousa <lincoln@…>
- Children:
- 5d1bd3021693e54e7d206613f99797ed5d29b05d
- Parents:
- 99518efdf730844e6adc35309b321332710a2460
- git-committer:
- Lincoln de Sousa <lincoln@…> (06/11/08 16:15:52)
- Message:
-
Finishing initial tab issues, like close, now the child process is
being killed with SIGKILL. Terminal focus on tab click was fixed
too. last_pos attribute and its setter were removed.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r99518ef
|
r38142c7
|
|
| 32 | 32 | |
| 33 | 33 | import os |
| | 34 | import signal |
| 34 | 35 | import sys |
| 35 | 36 | import warnings |
| … |
… |
|
| 62 | 63 | ) |
| 63 | 64 | |
| 64 | | |
| 65 | 65 | class AboutDialog(SimpleGladeApp): |
| 66 | 66 | def __init__(self): |
| … |
… |
|
| 73 | 73 | |
| 74 | 74 | # images |
| 75 | | ipath = common.pixmapfile('guake.png') |
| | 75 | ipath = common.pixmapfile('guake-notification.png') |
| 76 | 76 | img = gtk.gdk.pixbuf_new_from_file(ipath) |
| 77 | 77 | ad.set_property('logo', img) |
| … |
… |
|
| 95 | 95 | |
| 96 | 96 | # images |
| 97 | | ipath = common.pixmapfile('guake.png') |
| | 97 | ipath = common.pixmapfile('guake-notification.png') |
| 98 | 98 | self.get_widget('image_logo').set_from_file(ipath) |
| 99 | 99 | ipath = common.pixmapfile('tabdown.svg') |
| … |
… |
|
| 425 | 425 | |
| 426 | 426 | self.accel_group = gtk.AccelGroup() |
| 427 | | self.last_pos = -1 |
| 428 | 427 | self.term_list = [] |
| | 428 | self.pid_list = [] |
| 429 | 429 | |
| 430 | 430 | self.animation_speed = 30 |
| … |
… |
|
| 694 | 694 | self.term_list[current_pos].paste_clipboard() |
| 695 | 695 | |
| | 696 | def on_context_close_tab_activate(self, *args): |
| | 697 | current_pos = self.notebook.get_current_page() |
| | 698 | pid = self.pid_list.pop(current_pos) |
| | 699 | os.kill(pid, signal.SIGKILL) |
| | 700 | |
| 696 | 701 | def on_context_close_activate(self, widget): |
| 697 | 702 | gtk.main_quit() |
| 698 | | |
| 699 | | def on_close_button_close_clicked(self, widget, index): |
| 700 | | self.term_list[index].fork_command("bash", "exit") |
| 701 | | self.set_terminal_focus() |
| 702 | 703 | |
| 703 | 704 | # -- tab related functions -- |
| … |
… |
|
| 710 | 711 | # TODO: make new terminal opens in the same dir of the already in use. |
| 711 | 712 | shell_name = self.client.get_string(GCONF_PATH+'general/default_shell') |
| 712 | | self.term_list[last_added].fork_command(shell_name or "bash", |
| 713 | | directory=os.path.expanduser('~')) |
| | 713 | directory = os.path.expanduser('~') |
| | 714 | pid = self.term_list[last_added].\ |
| | 715 | fork_command(shell_name or "bash", directory=directory) |
| | 716 | |
| | 717 | self.pid_list.append(pid) |
| 714 | 718 | self.term_list[last_added].connect('button-press-event', |
| 715 | 719 | self.show_context_menu) |
| … |
… |
|
| 720 | 724 | bnt = gtk.RadioButton(group=parent, |
| 721 | 725 | label=_('Terminal %s') % (last_added+1)) |
| 722 | | bnt.connect('clicked', self.set_terminal_focus) |
| | 726 | bnt.connect('clicked', lambda *x: |
| | 727 | self.notebook.set_current_page (len(tabs))) |
| 723 | 728 | bnt.set_property('draw-indicator', False) |
| 724 | 729 | bnt.show() |
| … |
… |
|
| 758 | 763 | |
| 759 | 764 | self.notebook.append_page(mhbox, None) |
| 760 | | self.notebook.connect('switch-page', self.set_last_pos) |
| 761 | | self.notebook.connect('focus-tab', self.set_terminal_focus) |
| 762 | 765 | |
| 763 | 766 | self.load_config() |
| 764 | 767 | self.term_list[last_added].show() |
| 765 | 768 | self.notebook.set_current_page(last_added) |
| 766 | | self.last_pos = last_added |
| 767 | 769 | |
| 768 | 770 | def delete_tab(self, pagepos): |
| … |
… |
|
| 773 | 775 | self.hide() |
| 774 | 776 | |
| 775 | | def set_terminal_focus(self, *args): |
| 776 | | self.notebook.set_current_page(self.last_pos) |
| 777 | | self.term_list[self.last_pos].grab_focus() |
| | 777 | def set_terminal_focus(self): |
| | 778 | page = self.notebook.get_current_page() |
| | 779 | self.term_list[page].grab_focus() |
| 778 | 780 | |
| 779 | 781 | def select_current_tab(self, notebook, user_data, page): |
| 780 | 782 | self.tabs.get_children()[page].set_active(True) |
| 781 | | |
| 782 | | def set_last_pos(self, notebook, page, page_num): |
| 783 | | self.last_pos = page_num |
| 784 | 783 | |
| 785 | 784 | def clear_old_terms(self): |