23 #include <karambaapp.h>
26 #include <kaboutdata.h>
27 #include <kcmdlineargs.h>
30 #include <kmainwindow.h>
31 #include <tqfileinfo.h>
32 #include <tqstringlist.h>
34 #include <kstandarddirs.h>
35 #include <kdeversion.h>
38 #include "karambasessionmanaged.h"
39 #include "karambainterface.h"
40 #include "karamba_python.h"
42 static const char *description =
43 I18N_NOOP(
"A KDE Eye-candy Application");
45 static const char *version =
"0.42";
47 static KCmdLineOptions options[] =
51 {
"+file", I18N_NOOP(
"A required argument 'file'"), 0 },
61 void karambaMessageOutput(TQtMsgType type,
const char *msg)
63 FILE* fp = fopen(
"/tmp/karamba.log",
"a");
71 fprintf( fp,
"Debug (%d): %s\n", pid, msg );
74 if (strncmp(msg,
"X Error", 7) != 0)
75 fprintf( fp,
"Warning (%d): %s\n", pid, msg );
78 fprintf( fp,
"Fatal (%d): %s\n", pid, msg );
87 int main(
int argc,
char **argv)
90 tqInstallMsgHandler(karambaMessageOutput);
92 KAboutData about(
"superkaramba", I18N_NOOP(
"SuperKaramba"),
94 KAboutData::License_GPL,
95 "(c) 2003-2006 The SuperKaramba developers");
96 about.addAuthor(
"Adam Geitgey", 0,
"adam@rootnode.org");
97 about.addAuthor(
"Hans Karlsson", 0,
"karlsson.h@home.se");
98 about.addAuthor(
"Ryan Nickell", 0,
"p0z3r@earthlink.net");
99 about.addAuthor(
"Petri Damstén", 0,
"petri.damsten@iki.fi");
100 about.addAuthor(
"Alexander Wiedenbruch", 0,
"mail@wiedenbruch.de");
101 about.addAuthor(
"Luke Kenneth Casson Leighton", 0,
"lkcl@lkcl.net");
102 KCmdLineArgs::init(argc, argv, &about);
103 KCmdLineArgs::addCmdLineOptions(options);
104 KarambaSessionManaged ksm;
106 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
111 KarambaApplication::checkSuperKarambaDir();
113 KarambaApplication::lockKaramba();
115 KarambaApplication app;
117 TQString mainAppId = app.getMainKaramba();
118 if(!mainAppId.isEmpty())
120 app.initDcopStub(mainAppId.ascii());
125 app.setUpSysTray(&about);
129 KarambaApplication::unlockKaramba();
131 app.connect(tqApp,TQT_SIGNAL(lastWindowClosed()),tqApp,TQT_SLOT(quit()));
134 app.checkPreviousSession(app, lst);
135 if( (lst.size() == 0) && !app.isRestored() )
138 app.checkCommandLine(args, lst);
144 app.globalShowThemeDialog();
150 KarambaPython::initPython();
152 if(app.startThemes(lst) || mainAppId.isEmpty())
154 KarambaPython::shutdownPython();