Merge lp:~simar/clicompanion/clicompanion.tabnumbering into lp:clicompanion

Proposed by Gursimran singh
Status: Merged
Approved by: Duane Hinnen
Approved revision: 62
Merged at revision: 62
Proposed branch: lp:~simar/clicompanion/clicompanion.tabnumbering
Merge into: lp:clicompanion
Diff against target: 23 lines (+4/-2)
1 file modified
clicompanionlib/tabs.py (+4/-2)
To merge this branch: bzr merge lp:~simar/clicompanion/clicompanion.tabnumbering
Reviewer Review Type Date Requested Status
Duane Hinnen Approve
Review via email: mp+51888@code.launchpad.net

Description of the change

The property notebook.get_current_page() will give the current tab no which is unique(set by gtk) and changes as we add and delete tabs to remain within the range [0 max_no_of_tabs-1].

Added a global variable that will hold the value of latest tab number to fix the bug.

Renaming of tabs will not get affected with this solution as we can get the 'current tab unique no' using notebook and change its label.

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

This looks good to me.

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-01 13:34:50 +0000
+++ clicompanionlib/tabs.py 2011-03-02 12:25:03 +0000
@@ -28,6 +28,7 @@
28import clicompanionlib.controller28import clicompanionlib.controller
2929
30CONFIGFILE = os.path.expanduser("~/.config/clicompanion/config")30CONFIGFILE = os.path.expanduser("~/.config/clicompanion/config")
31gcp=0;
3132
32class Tabs(object):33class Tabs(object):
33 '''34 '''
@@ -45,8 +46,9 @@
45 vte_tab.add(_vte)46 vte_tab.add(_vte)
46 #notebook.set_show_tabs(True)47 #notebook.set_show_tabs(True)
47 #notebook.set_show_border(True)48 #notebook.set_show_border(True)
4849
49 gcp = notebook.get_current_page() +150 global gcp
51 gcp += 1
50 pagenum = ('Tab %d') % gcp52 pagenum = ('Tab %d') % gcp
5153
52 box = gtk.HBox()54 box = gtk.HBox()

Subscribers

People subscribed via source and target branches