Merge lp:~simar/clicompanion/fix-625648 into lp:clicompanion

Proposed by Gursimran singh
Status: Merged
Approved by: Duane Hinnen
Approved revision: 74
Merge reported by: Duane Hinnen
Merged at revision: not available
Proposed branch: lp:~simar/clicompanion/fix-625648
Merge into: lp:clicompanion
Diff against target: 47 lines (+18/-3)
1 file modified
clicompanionlib/tabs.py (+18/-3)
To merge this branch: bzr merge lp:~simar/clicompanion/fix-625648
Reviewer Review Type Date Requested Status
Duane Hinnen Approve
Review via email: mp+54954@code.launchpad.net

Description of the change

Under normal conditions if we destroy active tab the focus shifts to left but if the tab destroyed is active and its last tab (which contains a page) then the focus shifts to the left. If the destroyed tab is a tab which not does have focus then focus remains with the same tab that had the focus previously.

To post a comment you must log in.
Revision history for this message
Duane Hinnen (duanedesign) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'clicompanionlib/tabs.py'
--- clicompanionlib/tabs.py 2011-03-21 18:04:14 +0000
+++ clicompanionlib/tabs.py 2011-03-26 12:45:50 +0000
@@ -34,6 +34,9 @@
34#definition gcp - how many pages is visible34#definition gcp - how many pages is visible
35gcp=0;35gcp=0;
3636
37#definition nop - (no of pages) reflects no of terminal tabs left (some may be closed by the user)
38nop=0;
39
37class Tabs(object):40class Tabs(object):
38 '''41 '''
39 add a new terminal in a tab above the current terminal42 add a new terminal in a tab above the current terminal
@@ -56,10 +59,12 @@
56 #notebook.set_show_border(True)59 #notebook.set_show_border(True)
57 60
58 global gcp61 global gcp
62 global nop
63 nop += 1
59 gcp += 164 gcp += 1
60 pagenum = ('Tab %d') % gcp65 pagenum = ('Tab %d') % gcp
61 if gcp > 1:66 if nop > 1:
62 notebook.set_show_tabs(True)67 notebook.set_show_tabs(True)
63 box = gtk.HBox()68 box = gtk.HBox()
64 label = gtk.Label(pagenum)69 label = gtk.Label(pagenum)
65 box.pack_start(label, True, True)70 box.pack_start(label, True, True)
@@ -93,7 +98,17 @@
93 ## get the page number of the tab we wanted to close98 ## get the page number of the tab we wanted to close
94 pagenum = notebook.page_num(widget)99 pagenum = notebook.page_num(widget)
95 ## and close it100 ## and close it
96 notebook.remove_page(pagenum) 101 notebook.remove_page(pagenum)
102 global nop
103 nop -= 1
104 if nop <= 1:
105 notebook.set_show_tabs(False)
106
107 # check if the focus does not go to the last page (ie with only a + sign)
108 if notebook.get_current_page() == nop:
109 notebook.prev_page()
110
111
97 112
98 def update_term_config(self, _vte):113 def update_term_config(self, _vte):
99 ##read config file114 ##read config file

Subscribers

People subscribed via source and target branches