Add --new-tab command line option which starts new instance in a new tab rather than creating a new window.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=700656
This commit is contained in:
Robert Knight
2007-08-16 05:48:46 +00:00
parent 978403797e
commit ec72a6d51d
2 changed files with 37 additions and 20 deletions

View File

@@ -120,8 +120,25 @@ int Application::newInstance()
return 0;
}
// create a new window and session to run in it
MainWindow* window = newMainWindow();
// create a new window or use an existing one
MainWindow* window = 0;
if ( args->isSet("new-tab") )
{
QListIterator<QWidget*> iter(topLevelWidgets());
iter.toBack();
while ( iter.hasPrevious() )
{
window = qobject_cast<MainWindow*>(iter.previous());
if ( window != 0 )
break;
}
}
if ( window == 0 )
{
window = newMainWindow();
}
if ( args->isSet("profile") )
{