Changeset 99518efdf730844e6adc35309b321332710a2460
- Timestamp:
- 06/11/08 01:49:57 (4 years ago)
- Author:
- Lincoln de Sousa <lincoln@…>
- Children:
- 38142c77f3dc358917b2a802d6e5c0620bfa67f7
- Parents:
- f57bb4a0103346bdff2bb62c2c3de9f61ad27396
- git-committer:
- Lincoln de Sousa <lincoln@…> (06/11/08 01:49:57)
- Message:
-
adding the new tab system and fixing the new image paths
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
rf57bb4a
|
r99518ef
|
|
| | 1 | 2008-06-10 Lincoln de Sousa <lincoln@minaslivre.org> |
| | 2 | |
| | 3 | * src/guake.py: Starting to implement the new tabs |
| | 4 | system (acctualy almost finishing =) and updating image names. |
| | 5 | |
| | 6 | * src/statusicon.py: Updating notification image name. |
| | 7 | |
| 1 | 8 | 2008-06-10 Lincoln de Sousa <lincoln@minaslivre.org> |
| 2 | 9 | |
-
|
r23e5b55
|
r99518ef
|
|
| 394 | 394 | globalhotkeys.init() |
| 395 | 395 | key = self.client.get_string(GHOTKEYS[0][0]) |
| 396 | | filename = common.pixmapfile('guake.png') |
| | 396 | filename = common.pixmapfile('guake-notification.png') |
| 397 | 397 | if not globalhotkeys.bind(key, self.show_hide): |
| 398 | 398 | n = pynotify.Notification(_('Guake!'), |
| … |
… |
|
| 413 | 413 | |
| 414 | 414 | # adding images from a different path. |
| 415 | | ipath = common.pixmapfile('statusicon_out.png') |
| | 415 | ipath = common.pixmapfile('guake.png') |
| 416 | 416 | self.get_widget('image1').set_from_file(ipath) |
| 417 | 417 | ipath = common.pixmapfile('add_tab.png') |
| … |
… |
|
| 420 | 420 | self.window = self.get_widget('window-root') |
| 421 | 421 | self.notebook = self.get_widget('notebook-teminals') |
| | 422 | self.tabs = self.get_widget('hbox-tabs') |
| 422 | 423 | self.toolbar = self.get_widget('toolbar') |
| 423 | 424 | self.mainframe = self.get_widget('mainframe') |
| … |
… |
|
| 426 | 427 | self.last_pos = -1 |
| 427 | 428 | self.term_list = [] |
| | 429 | |
| 428 | 430 | self.animation_speed = 30 |
| 429 | 431 | self.visible = False |
| … |
… |
|
| 574 | 576 | |
| 575 | 577 | def accel_prev(self, *args): |
| 576 | | self.notebook.prev_page() |
| | 578 | if self.notebook.get_current_page() == 0: |
| | 579 | self.notebook.set_current_page(self.notebook.get_n_pages()-1) |
| | 580 | else: |
| | 581 | self.notebook.prev_page() |
| 577 | 582 | return True |
| 578 | 583 | |
| 579 | 584 | def accel_next(self, *args): |
| 580 | | self.notebook.next_page() |
| | 585 | if self.notebook.get_current_page()+1 == self.notebook.get_n_pages(): |
| | 586 | self.notebook.set_current_page(0) |
| | 587 | else: |
| | 588 | self.notebook.next_page() |
| 581 | 589 | return True |
| 582 | 590 | |
| … |
… |
|
| 707 | 715 | self.show_context_menu) |
| 708 | 716 | |
| 709 | | image = gtk.Image() |
| 710 | | image.set_from_file(common.pixmapfile('close.svg')) |
| 711 | | |
| 712 | | label = gtk.Label(_('Terminal %s') % (last_added+1)) |
| 713 | | label.connect('button-press-event', self.set_terminal_focus) |
| 714 | | |
| 715 | | button = gtk.Button() |
| 716 | | button.set_image(image) |
| 717 | | button.set_relief(gtk.RELIEF_NONE) |
| 718 | | button.connect('clicked', self.on_close_button_close_clicked, |
| 719 | | last_added) |
| 720 | | |
| 721 | | hbox = gtk.HBox(False, False) |
| 722 | | hbox.set_border_width(1) |
| 723 | | hbox.pack_start(label) |
| 724 | | hbox.pack_start(button) |
| 725 | | hbox.show_all() |
| 726 | | |
| 727 | | # preparing the way to a scrollbar... |
| | 717 | # Adding a new radio button to tabbar |
| | 718 | tabs = self.tabs.get_children() |
| | 719 | parent = tabs and tabs[0] or None |
| | 720 | bnt = gtk.RadioButton(group=parent, |
| | 721 | label=_('Terminal %s') % (last_added+1)) |
| | 722 | bnt.connect('clicked', self.set_terminal_focus) |
| | 723 | bnt.set_property('draw-indicator', False) |
| | 724 | bnt.show() |
| | 725 | |
| | 726 | self.tabs.pack_start(bnt, expand=False, padding=1) |
| | 727 | |
| | 728 | # preparing the way to the scrollbar... |
| 728 | 729 | mhbox = gtk.HBox() |
| 729 | 730 | mhbox.pack_start(self.term_list[last_added], True, True) |
| | 731 | |
| 730 | 732 | adj = self.term_list[last_added].get_adjustment() |
| 731 | 733 | scroll = gtk.VScrollbar(adj) |
| … |
… |
|
| 734 | 736 | scroll.set_no_show_all(True) |
| 735 | 737 | mhbox.pack_start(scroll, False, False) |
| 736 | | |
| 737 | 738 | mhbox.show_all() |
| 738 | 739 | |
| … |
… |
|
| 745 | 746 | self.term_list[last_added].set_scroll_on_output(True) # auto scroll |
| 746 | 747 | self.term_list[last_added].set_scroll_on_keystroke(True) # auto scroll |
| 747 | | #self.term_list[last_added].set_scroll_background(True) |
| | 748 | |
| 748 | 749 | history_size = self.client.get_int(GCONF_PATH+'general/history_size') |
| 749 | 750 | self.term_list[last_added].set_scrollback_lines(history_size) # history size |
| … |
… |
|
| 756 | 757 | self.term_list[last_added].grab_focus() |
| 757 | 758 | |
| 758 | | self.notebook.append_page(mhbox, hbox) |
| | 759 | self.notebook.append_page(mhbox, None) |
| 759 | 760 | self.notebook.connect('switch-page', self.set_last_pos) |
| 760 | 761 | self.notebook.connect('focus-tab', self.set_terminal_focus) |
| 761 | 762 | |
| 762 | | self.set_tabs_visible() |
| 763 | 763 | self.load_config() |
| 764 | 764 | self.term_list[last_added].show() |
| … |
… |
|
| 768 | 768 | def delete_tab(self, pagepos): |
| 769 | 769 | self.notebook.remove_page(pagepos) |
| | 770 | self.tabs.get_children()[pagepos].destroy() |
| 770 | 771 | self.clear_old_terms() |
| 771 | | self.set_tabs_visible() |
| 772 | 772 | if not self.term_list: |
| 773 | 773 | self.hide() |
| 774 | 774 | |
| 775 | | def set_terminal_focus(self): |
| | 775 | def set_terminal_focus(self, *args): |
| 776 | 776 | self.notebook.set_current_page(self.last_pos) |
| 777 | 777 | self.term_list[self.last_pos].grab_focus() |
| 778 | 778 | |
| 779 | | def set_tabs_visible(self): |
| 780 | | if self.notebook.get_n_pages() == 1: |
| 781 | | self.notebook.set_show_tabs(False) |
| 782 | | else: |
| 783 | | self.notebook.set_show_tabs(True) |
| | 779 | def select_current_tab(self, notebook, user_data, page): |
| | 780 | self.tabs.get_children()[page].set_active(True) |
| 784 | 781 | |
| 785 | 782 | def set_last_pos(self, notebook, page, page_num): |
-
|
r512b8d8
|
r99518ef
|
|
| 61 | 61 | self.style = None |
| 62 | 62 | |
| 63 | | img = common.pixmapfile('statusicon_out.png') |
| | 63 | img = common.pixmapfile('guake-tray.png') |
| 64 | 64 | tooltip = _('Guake-Terminal') |
| 65 | 65 | try: |