kjots
main.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include <stdlib.h>
00027 #include <stdio.h>
00028 #include <kuniqueapplication.h>
00029 #include <kcmdlineargs.h>
00030 #include <kconfig.h>
00031 #include <kaboutdata.h>
00032 #include <klocale.h>
00033 #include <kglobal.h>
00034 #include "KJotsMain.h"
00035
00036
00037 static const char description[] = I18N_NOOP("KDE note taking utility");
00038
00039 int main( int argc, char **argv )
00040 {
00041 KAboutData aboutData( "kjots", 0, ki18n("KJots"),
00042 KDE_VERSION_STRING, ki18n(description), KAboutData::License_GPL,
00043 ki18n("(c) 1997-2002, Christoph Neerfeld"));
00044 aboutData.addAuthor(ki18n("Pradeepto K. Bhattacharya"), ki18n("Current maintainer"), "pradeepto@kde.org");
00045 aboutData.addAuthor(ki18n("Stephen Kelly"), ki18n("Current maintainer"), "steveire@gmail.com");
00046 aboutData.addAuthor(ki18n("Jaison Lee"), KLocalizedString(), "lee.jaison@gmail.com");
00047 aboutData.addAuthor(ki18n("Aaron J. Seigo"), KLocalizedString(), "aseigo@kde.org");
00048 aboutData.addAuthor(ki18n("Stanislav Kljuhhin"), KLocalizedString(), "crz@starman.ee");
00049 aboutData.addAuthor(ki18n("Christoph Neerfeld"), ki18n("Original author"), "chris@kde.org");
00050 KCmdLineArgs::init(argc, argv, &aboutData);
00051 KUniqueApplication::addCmdLineOptions();
00052
00053 if (!KUniqueApplication::start()) {
00054 fprintf(stderr, "kjots is already running!\n");
00055 exit(0);
00056 }
00057
00058 KUniqueApplication a;
00059
00060
00061
00062 KConfigGroup config(KGlobal::config(), "kjots");
00063 if (config.hasKey("EFontFamily")) {
00064
00065 QFont font( config.readEntry("EFontFamily"),
00066 config.readEntry("EFontSize", 12),
00067 config.readEntry("EFontWeight", 0),
00068 config.readEntry("EFontItalic", 0));
00069
00070 config.deleteEntry("EFontFamily");
00071 config.deleteEntry("EFontSize");
00072 config.deleteEntry("EFontWeight");
00073 config.deleteEntry("EFontItalic");
00074 config.deleteEntry("EFontCharset");
00075
00076 config.writeEntry("Font", font);
00077 }
00078
00079 KJotsMain *jots = new KJotsMain;
00080 if( a.isSessionRestored() ) {
00081 if( KJotsMain::canBeRestored(1) ) {
00082 jots->restore(1);
00083 }
00084 }
00085
00086 jots->show();
00087 jots->resize(jots->size());
00088 return a.exec();
00089 }
00090
00091
00092