• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdeutils
  • Sitemap
  • Contact Us
 

kjots

main.cpp

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //
00004 //  kjots
00005 //
00006 //  Copyright (C) 1997 Christoph Neerfeld <Christoph.Neerfeld@home.ivm.de>
00007 //  Copyright (C) 2002, 2003 Aaron J. Seigo <aseigo@kde.org>
00008 //  Copyright (C) 2003 Stanislav Kljuhhin <crz@hot.ee>
00009 //  Copyright (C) 2005-2006 Jaison Lee <lee.jaison@gmail.com>
00010 //
00011 //  This program is free software; you can redistribute it and/or modify
00012 //  it under the terms of the GNU General Public License as published by
00013 //  the Free Software Foundation; either version 2 of the License, or
00014 //  (at your option) any later version.
00015 //
00016 //  This program is distributed in the hope that it will be useful,
00017 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 //  GNU General Public License for more details.
00020 //
00021 //  You should have received a copy of the GNU General Public License
00022 //  along with this program; if not, write to the Free Software
00023 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
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     // backwards compatibility code to convert "old" user font settings
00061     // to the new config settings
00062     KConfigGroup config(KGlobal::config(), "kjots");
00063     if (config.hasKey("EFontFamily")) {
00064       // read old font and create it
00065       QFont font( config.readEntry("EFontFamily"),
00066                   config.readEntry("EFontSize", 12),
00067                   config.readEntry("EFontWeight", 0),
00068                   config.readEntry("EFontItalic", 0));
00069       // delete old entries
00070       config.deleteEntry("EFontFamily");
00071       config.deleteEntry("EFontSize");
00072       config.deleteEntry("EFontWeight");
00073       config.deleteEntry("EFontItalic");
00074       config.deleteEntry("EFontCharset");
00075       // write new "converted" entry
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 /* ex: set tabstop=4 softtabstop=4 shiftwidth=4 expandtab: */
00092 /* kate: tab-indents off; replace-tabs on; tab-width 4; remove-trailing-space on; encoding utf-8;*/

kjots

Skip menu "kjots"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdeutils

Skip menu "kdeutils"
  • ark
  • kcalc
  • kcharselect
  • kdelirc
  • kdessh
  • kdf
  • kfloppy
  • kgpg
  • kjots
  • klaptopdaemon
  • kmilo
  • ksim
  • ktimer
  • kwallet
  • superkaramba
Generated for kdeutils by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal