aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/data/scripts/uzbl-tabbed
diff options
context:
space:
mode:
authorGravatar Dmytro Milinevskyy <milinevskyy@gmail.com>2010-02-26 00:29:30 +0200
committerGravatar Dmytro Milinevskyy <milinevskyy@gmail.com>2010-02-26 00:29:30 +0200
commit332941e9d86e9c2a5238620390fcc39ffccaeed4 (patch)
tree69e36286ec541e4c002a8bb7cc1de177a102ffec /examples/data/scripts/uzbl-tabbed
parent455964bf57758f8adfa6e48f0bb69ed543c26754 (diff)
[uzbl-tabbed] add support for opening tab next to current and background tabs
Diffstat (limited to 'examples/data/scripts/uzbl-tabbed')
-rwxr-xr-xexamples/data/scripts/uzbl-tabbed11
1 files changed, 9 insertions, 2 deletions
diff --git a/examples/data/scripts/uzbl-tabbed b/examples/data/scripts/uzbl-tabbed
index 7bd90d5..e3e890d 100755
--- a/examples/data/scripts/uzbl-tabbed
+++ b/examples/data/scripts/uzbl-tabbed
@@ -488,6 +488,13 @@ class UzblInstance:
self.parent.update_tablist()
elif type == "NEW_TAB":
self.parent.new_tab(args)
+ elif type == "NEW_BG_TAB":
+ self.parent.new_tab(args, '', 0)
+ elif type == "NEW_TAB_NEXT":
+ self.parent.new_tab(args, next=True)
+ elif type == "NEW_BG_TAB_NEXT":
+ self.parent.new_tab(args, '', 0, next=True)
+
elif type == "NEXT_TAB":
if args:
self.parent.next_tab(int(args))
@@ -966,7 +973,7 @@ class UzblTabbed:
return False
- def new_tab(self, uri='', title='', switch=None):
+ def new_tab(self, uri='', title='', switch=None, next=False):
'''Add a new tab to the notebook and start a new instance of uzbl.
Use the switch option to negate config['switch_to_new_tabs'] option
when you need to load multiple tabs at a time (I.e. like when
@@ -974,7 +981,7 @@ class UzblTabbed:
tab = gtk.Socket()
tab.show()
- self.notebook.append_page(tab)
+ self.notebook.insert_page(tab, position=next and self.notebook.get_current_page() + 1 or -1)
sid = tab.get_id()
uri = uri.strip()
name = "%d-%d" % (os.getpid(), self.next_pid())