29 #include <KCmdLineArgs>
32 #define KONSOLE_VERSION "2.14.2"
52 extern "C" int KDE_EXPORT
kdemain(
int argc,
char** argv)
54 KAboutData about(
"konsole",
56 ki18nc(
"@title",
"<application>Konsole</application>"),
58 ki18nc(
"@title",
"Terminal emulator"),
59 KAboutData::License_GPL_V2
63 KCmdLineArgs::init(argc, argv, &about);
64 KCmdLineArgs::addStdCmdLineOptions();
65 KUniqueApplication::addCmdLineOptions();
66 KCmdLineOptions konsoleOptions;
68 KCmdLineArgs::addCmdLineOptions(konsoleOptions);
70 KUniqueApplication::StartFlags startFlags;
72 startFlags = KUniqueApplication::NonUniqueInstance;
76 if (!KUniqueApplication::start(startFlags)) {
83 KGlobal::locale()->insertCatalog(
"libkonq");
97 const KCmdLineArgs* qtArgs = KCmdLineArgs::parsedArgs(
"qt");
99 qtProblematicOptions <<
"session" <<
"name" <<
"reverse"
100 <<
"stylesheet" <<
"graphicssystem";
101 #if defined(Q_WS_X11)
102 qtProblematicOptions <<
"display" <<
"visual";
104 foreach(
const QString& option, qtProblematicOptions) {
111 const KCmdLineArgs* kdeArgs = KCmdLineArgs::parsedArgs(
"kde");
113 kdeProblematicOptions <<
"config" <<
"style";
114 #if defined(Q_WS_X11)
115 kdeProblematicOptions <<
"waitforwm";
117 foreach(
const QString& option, kdeProblematicOptions) {
123 const KCmdLineArgs* kUniqueAppArgs = KCmdLineArgs::parsedArgs(
"kuniqueapp");
128 const bool shouldRunInForeground = !kUniqueAppArgs->isSet(
"fork");
129 if (shouldRunInForeground) {
133 const KCmdLineArgs* konsoleArgs = KCmdLineArgs::parsedArgs();
136 if (konsoleArgs->isSet(
"separate")) {
141 if (konsoleArgs->isSet(
"new-tab")) {
149 bool hasControllingTTY =
false;
150 const int fd = KDE_open(
"/dev/tty", O_RDONLY);
152 hasControllingTTY =
true;
156 return hasControllingTTY;
161 options.add(
"profile <name>",
162 ki18nc(
"@info:shell",
"Name of profile to use for new Konsole instance"));
163 options.add(
"fallback-profile",
164 ki18nc(
"@info:shell",
"Use the internal FALLBACK profile"));
165 options.add(
"workdir <dir>",
166 ki18nc(
"@info:shell",
"Set the initial working directory of the new tab or"
167 " window to 'dir'"));
169 options.add(
"noclose",
170 ki18nc(
"@info:shell",
"Do not close the initial session automatically when it"
172 options.add(
"new-tab",
173 ki18nc(
"@info:shell",
"Create a new tab in an existing window rather than"
174 " creating a new window"));
175 options.add(
"tabs-from-file <file>",
176 ki18nc(
"@info:shell",
"Create tabs as specified in given tabs configuration"
178 options.add(
"background-mode",
179 ki18nc(
"@info:shell",
"Start Konsole in the background and bring to the front"
180 " when Ctrl+Shift+F12 (by default) is pressed"));
181 options.add(
"separate", ki18n(
"Run in a separate process"));
182 options.add(
"show-menubar", ki18nc(
"@info:shell",
"Show the menubar, overriding the default setting"));
183 options.add(
"hide-menubar", ki18nc(
"@info:shell",
"Hide the menubar, overriding the default setting"));
184 options.add(
"show-tabbar", ki18nc(
"@info:shell",
"Show the tabbar, overriding the default setting"));
185 options.add(
"hide-tabbar", ki18nc(
"@info:shell",
"Hide the tabbar, overriding the default setting"));
186 options.add(
"fullscreen", ki18nc(
"@info:shell",
"Start Konsole in fullscreen mode"));
187 options.add(
"notransparency",
188 ki18nc(
"@info:shell",
"Disable transparent backgrounds, even if the system"
190 options.add(
"list-profiles", ki18nc(
"@info:shell",
"List the available profiles"));
191 options.add(
"list-profile-properties",
192 ki18nc(
"@info:shell",
"List all the profile properties names and their type"
193 " (for use with -p)"));
194 options.add(
"p <property=value>",
195 ki18nc(
"@info:shell",
"Change the value of a profile property."));
196 options.add(
"!e <cmd>",
197 ki18nc(
"@info:shell",
"Command to execute. This option will catch all following"
198 " arguments, so use it as the last option."));
199 options.add(
"+[args]", ki18nc(
"@info:shell",
"Arguments passed to command"));
200 options.add(
"", ki18nc(
"@info:shell",
"Use --nofork to run in the foreground (helpful"
201 " with the -e option)."));
206 aboutData.setProgramIconName(
"utilities-terminal");
207 aboutData.setHomepage(
"http://konsole.kde.org");
209 aboutData.addAuthor(ki18nc(
"@info:credit",
"Kurt Hindenburg"),
210 ki18nc(
"@info:credit",
"General maintainer, bug fixes and general"
212 "kurt.hindenburg@gmail.com");
213 aboutData.addAuthor(ki18nc(
"@info:credit",
"Robert Knight"),
214 ki18nc(
"@info:credit",
"Previous maintainer, ported to KDE4"),
215 "robertknight@gmail.com");
216 aboutData.addAuthor(ki18nc(
"@info:credit",
"Lars Doelle"),
217 ki18nc(
"@info:credit",
"Original author"),
218 "lars.doelle@on-line.de");
219 aboutData.addCredit(ki18nc(
"@info:credit",
"Jekyll Wu"),
220 ki18nc(
"@info:credit",
"Bug fixes and general improvements"),
221 "adaptee@gmail.com");
222 aboutData.addCredit(ki18nc(
"@info:credit",
"Waldo Bastian"),
223 ki18nc(
"@info:credit",
"Bug fixes and general improvements"),
225 aboutData.addCredit(ki18nc(
"@info:credit",
"Stephan Binner"),
226 ki18nc(
"@info:credit",
"Bug fixes and general improvements"),
228 aboutData.addCredit(ki18nc(
"@info:credit",
"Thomas Dreibholz"),
229 ki18nc(
"@info:credit",
"General improvements"),
230 "dreibh@iem.uni-due.de");
231 aboutData.addCredit(ki18nc(
"@info:credit",
"Chris Machemer"),
232 ki18nc(
"@info:credit",
"Bug fixes"),
233 "machey@ceinetworks.com");
234 aboutData.addCredit(ki18nc(
"@info:credit",
"Francesco Cecconi"),
235 ki18nc(
"@info:credit",
"Bug fixes"),
236 "francesco.cecconi@gmail.com");
237 aboutData.addCredit(ki18nc(
"@info:credit",
"Stephan Kulow"),
238 ki18nc(
"@info:credit",
"Solaris support and history"),
240 aboutData.addCredit(ki18nc(
"@info:credit",
"Alexander Neundorf"),
241 ki18nc(
"@info:credit",
"Bug fixes and improved startup performance"),
243 aboutData.addCredit(ki18nc(
"@info:credit",
"Peter Silva"),
244 ki18nc(
"@info:credit",
"Marking improvements"),
245 "Peter.A.Silva@gmail.com");
246 aboutData.addCredit(ki18nc(
"@info:credit",
"Lotzi Boloni"),
247 ki18nc(
"@info:credit",
"Embedded Konsole\n"
248 "Toolbar and session names"),
249 "boloni@cs.purdue.edu");
250 aboutData.addCredit(ki18nc(
"@info:credit",
"David Faure"),
251 ki18nc(
"@info:credit",
"Embedded Konsole\n"
252 "General improvements"),
254 aboutData.addCredit(ki18nc(
"@info:credit",
"Antonio Larrosa"),
255 ki18nc(
"@info:credit",
"Visual effects"),
257 aboutData.addCredit(ki18nc(
"@info:credit",
"Matthias Ettrich"),
258 ki18nc(
"@info:credit",
"Code from the kvt project\n"
259 "General improvements"),
261 aboutData.addCredit(ki18nc(
"@info:credit",
"Warwick Allison"),
262 ki18nc(
"@info:credit",
"Schema and text selection improvements"),
264 aboutData.addCredit(ki18nc(
"@info:credit",
"Dan Pilone"),
265 ki18nc(
"@info:credit",
"SGI port"),
267 aboutData.addCredit(ki18nc(
"@info:credit",
"Kevin Street"),
268 ki18nc(
"@info:credit",
"FreeBSD port"),
270 aboutData.addCredit(ki18nc(
"@info:credit",
"Sven Fischer"),
271 ki18nc(
"@info:credit",
"Bug fixes"),
272 "herpes@kawo2.renditionwth-aachen.de");
273 aboutData.addCredit(ki18nc(
"@info:credit",
"Dale M. Flaven"),
274 ki18nc(
"@info:credit",
"Bug fixes"),
275 "dflaven@netport.com");
276 aboutData.addCredit(ki18nc(
"@info:credit",
"Martin Jones"),
277 ki18nc(
"@info:credit",
"Bug fixes"),
278 "mjones@powerup.com.au");
279 aboutData.addCredit(ki18nc(
"@info:credit",
"Lars Knoll"),
280 ki18nc(
"@info:credit",
"Bug fixes"),
281 "knoll@mpi-hd.mpg.de");
282 aboutData.addCredit(ki18nc(
"@info:credit",
"Thanks to many others.\n"));
287 if (app.isSessionRestored()) {
289 while (KMainWindow::canBeRestored(n))
void restoreSession(Application &app)
void fillAboutData(KAboutData &aboutData)
MainWindow * newMainWindow()
Creates a new, empty main window and connects to its newSessionRequest() and newWindowRequest() signa...
bool shouldUseNewProcess()
int KDE_EXPORT kdemain(int argc, char **argv)
void fillCommandLineOptions(KCmdLineOptions &options)
QByteArray toLocal8Bit() const