23 #include <karambaapp.h>
26 #include <tdeaboutdata.h>
27 #include <tdecmdlineargs.h>
28 #include <tdelocale.h>
29 #include <tdeconfig.h>
30 #include <tdemainwindow.h>
31 #include <tqfileinfo.h>
32 #include <tqstringlist.h>
33 #include <tdeconfig.h>
34 #include <tdestandarddirs.h>
37 #include "karambasessionmanaged.h"
38 #include "karambainterface.h"
39 #include "karamba_python.h"
41 static const char *description =
42 I18N_NOOP(
"A TDE Eye-candy Application");
44 static const char *version =
"0.42";
46 static TDECmdLineOptions options[] =
50 {
"+file", I18N_NOOP(
"A required argument 'file'"), 0 },
60 void karambaMessageOutput(TQtMsgType type,
const char *msg)
62 FILE* fp = fopen(
"/tmp/karamba.log",
"a");
70 fprintf( fp,
"Debug (%d): %s\n", pid, msg );
73 if (strncmp(msg,
"X Error", 7) != 0)
74 fprintf( fp,
"Warning (%d): %s\n", pid, msg );
77 fprintf( fp,
"Fatal (%d): %s\n", pid, msg );
86 int main(
int argc,
char **argv)
89 qInstallMsgHandler(karambaMessageOutput);
91 TDEAboutData about(
"superkaramba", I18N_NOOP(
"SuperKaramba"),
93 TDEAboutData::License_GPL,
94 I18N_NOOP(
"(c) 2003-2006 The SuperKaramba developers"));
95 about.addAuthor(
"Adam Geitgey", 0,
"adam@rootnode.org");
96 about.addAuthor(
"Hans Karlsson", 0,
"karlsson.h@home.se");
97 about.addAuthor(
"Ryan Nickell", 0,
"p0z3r@earthlink.net");
98 about.addAuthor(
"Petri Damstén", 0,
"petri.damsten@iki.fi");
99 about.addAuthor(
"Alexander Wiedenbruch", 0,
"mail@wiedenbruch.de");
100 about.addAuthor(
"Luke Kenneth Casson Leighton", 0,
"lkcl@lkcl.net");
101 TDECmdLineArgs::init(argc, argv, &about);
102 TDECmdLineArgs::addCmdLineOptions(options);
103 KarambaSessionManaged ksm;
105 TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
110 KarambaApplication::checkSuperKarambaDir();
112 KarambaApplication::lockKaramba();
114 KarambaApplication app;
116 TQString mainAppId = app.getMainKaramba();
117 if(!mainAppId.isEmpty())
119 app.initDcopStub(mainAppId.ascii());
124 app.setUpSysTray(&about);
128 KarambaApplication::unlockKaramba();
130 app.connect(tqApp,TQ_SIGNAL(lastWindowClosed()),tqApp,TQ_SLOT(quit()));
133 app.checkPreviousSession(app, lst);
134 if( (lst.size() == 0) && !app.isRestored() )
137 app.checkCommandLine(args, lst);
143 app.globalShowThemeDialog();
149 KarambaPython::initPython();
151 if(app.startThemes(lst) || mainAppId.isEmpty())
153 KarambaPython::shutdownPython();