#!/usr/bin/python

# Epiphany notabs extension - new tabs are promoted to new windows
# Copyright (C) 2007 Jon Dowland <jon@alcopop.org>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License (in
# the file "LICENCE") for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 51
# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

from epiphany import Window

def attach_tab(window,tab):
	if len(window.get_tabs()) > 1:
		new_win = Window()
		window.remove_tab(tab)
		new_win.add_tab(tab,0,0)
		new_win.show()
