Commit ec72a6d5 authored by Robert Knight's avatar Robert Knight

Add --new-tab command line option which starts new instance in a new tab...

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
parent 97840379
......@@ -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") )
{
......
......@@ -40,12 +40,7 @@ using namespace Konsole;
// fills the KAboutData structure with information about contributors to
// Konsole
void fillAboutData(KAboutData& aboutData);
#if 0
#ifdef Q_WS_X11
void getDisplayInformation(Display*& display , Visual*& visual , Colormap& colormap);
#endif
#endif
void fillCommandLineOptions(KCmdLineOptions& options);
// ***
//
......@@ -67,19 +62,8 @@ extern "C" int KDE_EXPORT kdemain(int argc,char** argv)
fillAboutData(about);
KCmdLineArgs::init(argc,argv,&about);
KCmdLineOptions options;
options.add("profile \\<file>", ki18n("Name of profile to use for new Konsole instance"));
options.add("list-profiles", ki18n("List the available profiles"));
// TODO - Update this when F12 is no longer hard coded
options.add("background-mode", ki18n("Start Konsole in the background"
" and bring to the front when the F12"
" key is pressed"));
// TODO - Document this option more clearly
options.add("p \\<property=value>",ki18n("Change the value of a profile property."));
options.add("!e \\<cmd>",ki18n("Command to execute"));
options.add("+[args]",ki18n("Arguments passed to command"));
fillCommandLineOptions(options);
KCmdLineArgs::addCmdLineOptions(options);
KUniqueApplication::addCmdLineOptions();
......@@ -96,6 +80,22 @@ extern "C" int KDE_EXPORT kdemain(int argc,char** argv)
return app.exec();
}
void fillCommandLineOptions(KCmdLineOptions& options)
{
options.add("profile \\<file>", ki18n("Name of profile to use for new Konsole instance"));
options.add("list-profiles", ki18n("List the available profiles"));
// TODO - Update this when F12 is no longer hard coded
options.add("background-mode", ki18n("Start Konsole in the background"
" and bring to the front when the F12"
" key is pressed"));
options.add("new-tab",ki18n("Create a new tab in an existing window rather than creating a new window"));
// TODO - Document this option more clearly
options.add("p \\<property=value>",ki18n("Change the value of a profile property."));
options.add("!e \\<cmd>",ki18n("Command to execute"));
options.add("+[args]",ki18n("Arguments passed to command"));
}
void fillAboutData(KAboutData& aboutData)
{
aboutData.addAuthor(ki18n("Robert Knight"),ki18n("Maintainer"), "robertknight@gmail.com");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment