korganizer

korgacmain.cpp
1 /*
2  This file is part of the KOrganizer alarm client.
3 
4  Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 
20  As a special exception, permission is given to link this program
21  with any edition of TQt, and distribute the resulting executable,
22  without including the source code for TQt in the source distribution.
23 */
24 
25 #include <stdlib.h>
26 
27 #include <tdeglobal.h>
28 #include <kdebug.h>
29 #include <tdelocale.h>
30 #include <tdecmdlineargs.h>
31 #include <tdeaboutdata.h>
32 #include <tdeuniqueapplication.h>
33 
34 #include "koalarmclient.h"
35 
36 class MyApp : public TDEUniqueApplication
37 {
38  public:
39  MyApp() : mClient( 0 ) {}
40  int newInstance()
41  {
42  // Check if we already have a running alarm daemon widget
43  if ( mClient ) return 0;
44 
45  mClient = new KOAlarmClient;
46 
47  return 0;
48  }
49 
50  private:
51  KOAlarmClient *mClient;
52 };
53 
54 
55 static const char korgacVersion[] = "0.9";
56 
57 static const TDECmdLineOptions options[] =
58 {
59  { 0, 0, 0 }
60 };
61 
62 int main( int argc, char **argv )
63 {
64  TDELocale::setMainCatalogue( "korganizer" );
65  TDEAboutData aboutData( "korgac", I18N_NOOP("KOrganizer Reminder Daemon"),
66  korgacVersion, I18N_NOOP("KOrganizer Reminder Daemon"),
67  TDEAboutData::License_GPL,
68  "(c) 2003 Cornelius Schumacher",
69  0, "http://pim.kde.org" );
70  aboutData.addAuthor( "Cornelius Schumacher", I18N_NOOP("Maintainer"),
71  "schumacher@kde.org" );
72  aboutData.addAuthor( "Reinhold Kainhofer", I18N_NOOP("Maintainer"),
73  "kainhofer@kde.org" );
74 
75  TDECmdLineArgs::init( argc, argv, &aboutData );
76  TDECmdLineArgs::addCmdLineOptions( options );
77  TDEUniqueApplication::addCmdLineOptions();
78 
79  if ( !MyApp::start() ) exit( 0 );
80 
81  MyApp app;
82  app.disableSessionManagement();
83  TDEGlobal::locale()->insertCatalogue( "libkcal" );
84 
85  return app.exec();
86 }