29 #include <KCmdLineArgs>
32 #define KONSOLE_VERSION "2.12.4"
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");
98 QStringList qtProblematicOptions;
99 qtProblematicOptions <<
"session" <<
"name" <<
"reverse"
100 <<
"stylesheet" <<
"graphicssystem";
101 #if defined(Q_WS_X11)
102 qtProblematicOptions <<
"display" <<
"visual";
104 foreach(
const QString& option, qtProblematicOptions) {
105 if ( qtArgs->isSet(option.toLocal8Bit()) ) {
111 const KCmdLineArgs* kdeArgs = KCmdLineArgs::parsedArgs(
"kde");
112 QStringList kdeProblematicOptions;
113 kdeProblematicOptions <<
"config" <<
"style";
114 #if defined(Q_WS_X11)
115 kdeProblematicOptions <<
"waitforwm";
117 foreach(
const QString& option, kdeProblematicOptions) {
118 if ( kdeArgs->isSet(option.toLocal8Bit()) ) {
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(
"new-tab")) {
144 bool hasControllingTTY =
false;
145 const int fd = KDE_open(
"/dev/tty", O_RDONLY);
147 hasControllingTTY =
true;
151 return hasControllingTTY;
156 options.add(
"profile <name>",
157 ki18nc(
"@info:shell",
"Name of profile to use for new Konsole instance"));
158 options.add(
"fallback-profile",
159 ki18nc(
"@info:shell",
"Use the internal FALLBACK profile"));
160 options.add(
"workdir <dir>",
161 ki18nc(
"@info:shell",
"Set the initial working directory of the new tab or"
162 " window to 'dir'"));
164 options.add(
"noclose",
165 ki18nc(
"@info:shell",
"Do not close the initial session automatically when it"
167 options.add(
"new-tab",
168 ki18nc(
"@info:shell",
"Create a new tab in an existing window rather than"
169 " creating a new window"));
170 options.add(
"tabs-from-file <file>",
171 ki18nc(
"@info:shell",
"Create tabs as specified in given tabs configuration"
173 options.add(
"show-menubar", ki18nc(
"@info:shell",
"Show the menubar, overriding the default setting"));
174 options.add(
"hide-menubar", ki18nc(
"@info:shell",
"Hide the menubar, overriding the default setting"));
175 options.add(
"show-tabbar", ki18nc(
"@info:shell",
"Show the tabbar, overriding the default setting"));
176 options.add(
"hide-tabbar", ki18nc(
"@info:shell",
"Hide the tabbar, overriding the default setting"));
177 options.add(
"fullscreen", ki18nc(
"@info:shell",
"Start Konsole in fullscreen mode"));
178 options.add(
"notransparency",
179 ki18nc(
"@info:shell",
"Disable transparent backgrounds, even if the system"
181 options.add(
"list-profiles", ki18nc(
"@info:shell",
"List the available profiles"));
182 options.add(
"list-profile-properties",
183 ki18nc(
"@info:shell",
"List all the profile properties names and their type"
184 " (for use with -p)"));
185 options.add(
"p <property=value>",
186 ki18nc(
"@info:shell",
"Change the value of a profile property."));
187 options.add(
"!e <cmd>",
188 ki18nc(
"@info:shell",
"Command to execute. This option will catch all following"
189 " arguments, so use it as the last option."));
190 options.add(
"+[args]", ki18nc(
"@info:shell",
"Arguments passed to command"));
191 options.add(
"", ki18nc(
"@info:shell",
"Use --nofork to run in the foreground (helpful"
192 " with the -e option)."));
197 aboutData.setProgramIconName(
"utilities-terminal");
198 aboutData.setHomepage(
"http://konsole.kde.org");
200 aboutData.addAuthor(ki18nc(
"@info:credit",
"Kurt Hindenburg"),
201 ki18nc(
"@info:credit",
"General maintainer, bug fixes and general"
203 "kurt.hindenburg@gmail.com");
204 aboutData.addAuthor(ki18nc(
"@info:credit",
"Robert Knight"),
205 ki18nc(
"@info:credit",
"Previous maintainer, ported to KDE4"),
206 "robertknight@gmail.com");
207 aboutData.addAuthor(ki18nc(
"@info:credit",
"Lars Doelle"),
208 ki18nc(
"@info:credit",
"Original author"),
209 "lars.doelle@on-line.de");
210 aboutData.addCredit(ki18nc(
"@info:credit",
"Jekyll Wu"),
211 ki18nc(
"@info:credit",
"Bug fixes and general improvements"),
212 "adaptee@gmail.com");
213 aboutData.addCredit(ki18nc(
"@info:credit",
"Waldo Bastian"),
214 ki18nc(
"@info:credit",
"Bug fixes and general improvements"),
216 aboutData.addCredit(ki18nc(
"@info:credit",
"Stephan Binner"),
217 ki18nc(
"@info:credit",
"Bug fixes and general improvements"),
219 aboutData.addCredit(ki18nc(
"@info:credit",
"Thomas Dreibholz"),
220 ki18nc(
"@info:credit",
"General improvements"),
221 "dreibh@iem.uni-due.de");
222 aboutData.addCredit(ki18nc(
"@info:credit",
"Chris Machemer"),
223 ki18nc(
"@info:credit",
"Bug fixes"),
224 "machey@ceinetworks.com");
225 aboutData.addCredit(ki18nc(
"@info:credit",
"Francesco Cecconi"),
226 ki18nc(
"@info:credit",
"Bug fixes"),
227 "francesco.cecconi@gmail.com");
228 aboutData.addCredit(ki18nc(
"@info:credit",
"Stephan Kulow"),
229 ki18nc(
"@info:credit",
"Solaris support and history"),
231 aboutData.addCredit(ki18nc(
"@info:credit",
"Alexander Neundorf"),
232 ki18nc(
"@info:credit",
"Bug fixes and improved startup performance"),
234 aboutData.addCredit(ki18nc(
"@info:credit",
"Peter Silva"),
235 ki18nc(
"@info:credit",
"Marking improvements"),
236 "Peter.A.Silva@gmail.com");
237 aboutData.addCredit(ki18nc(
"@info:credit",
"Lotzi Boloni"),
238 ki18nc(
"@info:credit",
"Embedded Konsole\n"
239 "Toolbar and session names"),
240 "boloni@cs.purdue.edu");
241 aboutData.addCredit(ki18nc(
"@info:credit",
"David Faure"),
242 ki18nc(
"@info:credit",
"Embedded Konsole\n"
243 "General improvements"),
245 aboutData.addCredit(ki18nc(
"@info:credit",
"Antonio Larrosa"),
246 ki18nc(
"@info:credit",
"Visual effects"),
248 aboutData.addCredit(ki18nc(
"@info:credit",
"Matthias Ettrich"),
249 ki18nc(
"@info:credit",
"Code from the kvt project\n"
250 "General improvements"),
252 aboutData.addCredit(ki18nc(
"@info:credit",
"Warwick Allison"),
253 ki18nc(
"@info:credit",
"Schema and text selection improvements"),
255 aboutData.addCredit(ki18nc(
"@info:credit",
"Dan Pilone"),
256 ki18nc(
"@info:credit",
"SGI port"),
258 aboutData.addCredit(ki18nc(
"@info:credit",
"Kevin Street"),
259 ki18nc(
"@info:credit",
"FreeBSD port"),
261 aboutData.addCredit(ki18nc(
"@info:credit",
"Sven Fischer"),
262 ki18nc(
"@info:credit",
"Bug fixes"),
263 "herpes@kawo2.renditionwth-aachen.de");
264 aboutData.addCredit(ki18nc(
"@info:credit",
"Dale M. Flaven"),
265 ki18nc(
"@info:credit",
"Bug fixes"),
266 "dflaven@netport.com");
267 aboutData.addCredit(ki18nc(
"@info:credit",
"Martin Jones"),
268 ki18nc(
"@info:credit",
"Bug fixes"),
269 "mjones@powerup.com.au");
270 aboutData.addCredit(ki18nc(
"@info:credit",
"Lars Knoll"),
271 ki18nc(
"@info:credit",
"Bug fixes"),
272 "knoll@mpi-hd.mpg.de");
273 aboutData.addCredit(ki18nc(
"@info:credit",
"Thanks to many others.\n"));
278 if (app.isSessionRestored()) {
280 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)