Changeset 99518efdf730844e6adc35309b321332710a2460

Show
Ignore:
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:
3 modified

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rf57bb4a r99518ef  
     12008-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 
    182008-06-10  Lincoln de Sousa  <lincoln@minaslivre.org> 
    29 
  • src/guake.py

    r23e5b55 r99518ef  
    394394        globalhotkeys.init() 
    395395        key = self.client.get_string(GHOTKEYS[0][0]) 
    396         filename = common.pixmapfile('guake.png') 
     396        filename = common.pixmapfile('guake-notification.png') 
    397397        if not globalhotkeys.bind(key, self.show_hide): 
    398398            n = pynotify.Notification(_('Guake!'), 
     
    413413 
    414414        # adding images from a different path. 
    415         ipath = common.pixmapfile('statusicon_out.png') 
     415        ipath = common.pixmapfile('guake.png') 
    416416        self.get_widget('image1').set_from_file(ipath) 
    417417        ipath = common.pixmapfile('add_tab.png') 
     
    420420        self.window = self.get_widget('window-root') 
    421421        self.notebook = self.get_widget('notebook-teminals') 
     422        self.tabs = self.get_widget('hbox-tabs') 
    422423        self.toolbar = self.get_widget('toolbar') 
    423424        self.mainframe = self.get_widget('mainframe') 
     
    426427        self.last_pos = -1 
    427428        self.term_list = [] 
     429 
    428430        self.animation_speed = 30 
    429431        self.visible = False 
     
    574576 
    575577    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() 
    577582        return True 
    578583 
    579584    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() 
    581589        return True 
    582590 
     
    707715                self.show_context_menu) 
    708716 
    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... 
    728729        mhbox = gtk.HBox() 
    729730        mhbox.pack_start(self.term_list[last_added], True, True) 
     731 
    730732        adj = self.term_list[last_added].get_adjustment() 
    731733        scroll = gtk.VScrollbar(adj) 
     
    734736            scroll.set_no_show_all(True) 
    735737        mhbox.pack_start(scroll, False, False) 
    736  
    737738        mhbox.show_all() 
    738739 
     
    745746        self.term_list[last_added].set_scroll_on_output(True) # auto scroll 
    746747        self.term_list[last_added].set_scroll_on_keystroke(True) # auto scroll 
    747         #self.term_list[last_added].set_scroll_background(True) 
     748 
    748749        history_size = self.client.get_int(GCONF_PATH+'general/history_size') 
    749750        self.term_list[last_added].set_scrollback_lines(history_size) # history size 
     
    756757        self.term_list[last_added].grab_focus() 
    757758 
    758         self.notebook.append_page(mhbox, hbox) 
     759        self.notebook.append_page(mhbox, None) 
    759760        self.notebook.connect('switch-page', self.set_last_pos) 
    760761        self.notebook.connect('focus-tab', self.set_terminal_focus) 
    761762 
    762         self.set_tabs_visible() 
    763763        self.load_config() 
    764764        self.term_list[last_added].show() 
     
    768768    def delete_tab(self, pagepos): 
    769769        self.notebook.remove_page(pagepos) 
     770        self.tabs.get_children()[pagepos].destroy() 
    770771        self.clear_old_terms() 
    771         self.set_tabs_visible() 
    772772        if not self.term_list: 
    773773            self.hide() 
    774774 
    775     def set_terminal_focus(self): 
     775    def set_terminal_focus(self, *args): 
    776776        self.notebook.set_current_page(self.last_pos) 
    777777        self.term_list[self.last_pos].grab_focus() 
    778778 
    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) 
    784781 
    785782    def set_last_pos(self, notebook, page, page_num): 
  • src/statusicon.py

    r512b8d8 r99518ef  
    6161        self.style = None 
    6262 
    63         img = common.pixmapfile('statusicon_out.png') 
     63        img = common.pixmapfile('guake-tray.png') 
    6464        tooltip = _('Guake-Terminal') 
    6565        try: