00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <kstandarddirs.h>
00021 #include <klocale.h>
00022 #include <kcmdlineargs.h>
00023 #include <kaboutdata.h>
00024 #include <kglobal.h>
00025 #include <kconfig.h>
00026 #include <kinstance.h>
00027
00028 #include "kateapp.h"
00029
00030 static KCmdLineOptions options[] =
00031 {
00032 { "n", I18N_NOOP("Start a new Kate process (off by default)"), 0 },
00033 { "w", I18N_NOOP("Open a new Kate window"), 0 },
00034 { "initplugin <argument>", I18N_NOOP("Allow Kate to be initialized by a plugin. You most probably have to specify a file too."),0},
00035 { "encoding <argument>", I18N_NOOP("Set encoding for the file to open"), 0 },
00036 { "line <argument>", I18N_NOOP("Navigate to this line"), 0 },
00037 { "column <argument>", I18N_NOOP("Navigate to this column"), 0 },
00038 { "+[URL]", I18N_NOOP("Document to open"), 0 },
00039 KCmdLineLastOption
00040 };
00041
00042 extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
00043 {
00044 Kate::Document::setFileChangedDialogsActivated (true);
00045
00046 KAboutData aboutData ("kate", I18N_NOOP("Kate"), KATE_VERSION,
00047 I18N_NOOP( "Kate - Advanced Text Editor" ), KAboutData::License_LGPL_V2,
00048 I18N_NOOP( "(c) 2000-2004 The Kate Authors" ), 0, "http://kate.kde.org");
00049
00050 aboutData.addAuthor ("Christoph Cullmann", I18N_NOOP("Maintainer"), "cullmann@kde.org", "http://www.babylon2k.de");
00051 aboutData.addAuthor ("Anders Lund", I18N_NOOP("Core Developer"), "anders@alweb.dk", "http://www.alweb.dk");
00052 aboutData.addAuthor ("Joseph Wenninger", I18N_NOOP("Core Developer"), "jowenn@kde.org","http://stud3.tuwien.ac.at/~e9925371");
00053 aboutData.addAuthor ("Hamish Rodda",I18N_NOOP("Core Developer"), "rodda@kde.org");
00054 aboutData.addAuthor ("Waldo Bastian", I18N_NOOP( "The cool buffersystem" ), "bastian@kde.org" );
00055 aboutData.addAuthor ("Charles Samuels", I18N_NOOP("The Editing Commands"), "charles@kde.org");
00056 aboutData.addAuthor ("Matt Newell", I18N_NOOP("Testing, ..."), "newellm@proaxis.com");
00057 aboutData.addAuthor ("Michael Bartl", I18N_NOOP("Former Core Developer"), "michael.bartl1@chello.at");
00058 aboutData.addAuthor ("Michael McCallum", I18N_NOOP("Core Developer"), "gholam@xtra.co.nz");
00059 aboutData.addAuthor ("Jochen Wilhemly", I18N_NOOP( "KWrite Author" ), "digisnap@cs.tu-berlin.de" );
00060 aboutData.addAuthor ("Michael Koch",I18N_NOOP("KWrite port to KParts"), "koch@kde.org");
00061 aboutData.addAuthor ("Christian Gebauer", 0, "gebauer@kde.org" );
00062 aboutData.addAuthor ("Simon Hausmann", 0, "hausmann@kde.org" );
00063 aboutData.addAuthor ("Glen Parker",I18N_NOOP("KWrite Undo History, Kspell integration"), "glenebob@nwlink.com");
00064 aboutData.addAuthor ("Scott Manson",I18N_NOOP("KWrite XML Syntax highlighting support"), "sdmanson@alltel.net");
00065 aboutData.addAuthor ("John Firebaugh",I18N_NOOP("Patches and more"), "jfirebaugh@kde.org");
00066 aboutData.addAuthor ("Dominik Haumann", I18N_NOOP("Developer & Highlight wizard"), "dhdev@gmx.de");
00067
00068 aboutData.addCredit ("Matteo Merli",I18N_NOOP("Highlighting for RPM Spec-Files, Perl, Diff and more"), "merlim@libero.it");
00069 aboutData.addCredit ("Rocky Scaletta",I18N_NOOP("Highlighting for VHDL"), "rocky@purdue.edu");
00070 aboutData.addCredit ("Yury Lebedev",I18N_NOOP("Highlighting for SQL"),"");
00071 aboutData.addCredit ("Chris Ross",I18N_NOOP("Highlighting for Ferite"),"");
00072 aboutData.addCredit ("Nick Roux",I18N_NOOP("Highlighting for ILERPG"),"");
00073 aboutData.addCredit ("Carsten Niehaus", I18N_NOOP("Highlighting for LaTeX"),"");
00074 aboutData.addCredit ("Per Wigren", I18N_NOOP("Highlighting for Makefiles, Python"),"");
00075 aboutData.addCredit ("Jan Fritz", I18N_NOOP("Highlighting for Python"),"");
00076 aboutData.addCredit ("Daniel Naber","","");
00077 aboutData.addCredit ("Roland Pabel",I18N_NOOP("Highlighting for Scheme"),"");
00078 aboutData.addCredit ("Cristi Dumitrescu",I18N_NOOP("PHP Keyword/Datatype list"),"");
00079 aboutData.addCredit ("Carsten Pfeiffer", I18N_NOOP("Very nice help"), "");
00080 aboutData.addCredit (I18N_NOOP("All people who have contributed and I have forgotten to mention"),"","");
00081
00082 aboutData.setTranslator(I18N_NOOP("_: NAME OF TRANSLATORS\nYour names"), I18N_NOOP("_: EMAIL OF TRANSLATORS\nYour emails"));
00083
00084 KCmdLineArgs::init (argc, argv, &aboutData);
00085 KCmdLineArgs::addCmdLineOptions (options);
00086 KateApp::addCmdLineOptions ();
00087 KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
00088
00089 bool newProcess = false;
00090 bool oldState = false;
00091
00092 if (args->isSet ("n"))
00093 newProcess = true;
00094
00095 if (newProcess)
00096 {
00097 KInstance instance (&aboutData);
00098
00099 KConfig *config = instance.config();
00100 config->setGroup("KDE");
00101 oldState = config->readBoolEntry("MultipleInstances",false);
00102 config->writeEntry("MultipleInstances",true);
00103 config->sync();
00104 }
00105
00106 KateApp app (newProcess, oldState);
00107 return app.exec();
00108 }