summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
blob: 51579aa8270a4b18c6a4b7b04b8d2f5bd68f02ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/***************************************************************************
                          main.cpp  -  description
                             -------------------
    begin                : �t srp 21 19:12:20 CEST 2001
    copyright            : (C) 2001 by Daniel Prynych
    email                : [email protected]
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include <tdecmdlineargs.h>
#include <tdeaboutdata.h>
#include <tdecmdlineargs.h>
#include <tdelocale.h>
#include <tdeapplication.h>
#include <kuniqueapplication.h> 

#include "knutclient.h"

#include <stdio.h>
#include <stdlib.h>

static const char *description =
  I18N_NOOP("Client for Network UPS Tool");
// INSERT A DESCRIPTION FOR YOUR APPLICATION HERE


static TDECmdLineOptions options[] =
{
  {"nodock",I18N_NOOP("Don't dock in Kicker"),0},
  { 0, 0, 0 }
  // INSERT YOUR COMMANDLINE OPTIONS HERE
};



int main(int argc, char *argv[])
{

  TDEAboutData aboutData( "knutclient", I18N_NOOP("KNutClient"),
    VERSION, description, TDEAboutData::License_GPL,
    "(c) 2002 - 2009 Daniel Prynych", "Zajecov, Czech Republic", 0, "[email protected]");
  aboutData.addAuthor("Daniel Prynych",0, "[email protected]","http://www.knut.noveradsl.cz/knutclient/");
  aboutData.addCredit("Arnaud Quette",0,"[email protected]","http://www.networkupstools.org/");
  aboutData.addCredit("MGE",0,0,"http://opensource.mgeups.com");

  TDECmdLineArgs::init( argc, argv, &aboutData );
  TDECmdLineArgs::addCmdLineOptions( options ); // Add our own options.
  KUniqueApplication::addCmdLineOptions();

  TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs();
  bool noDock = args->isSet("dock");
  args->clear();

 // main KUApp this is remark
  if (!KUniqueApplication::start()) {
    fprintf(stderr,"Sorry : KNutClient is already running!\n");
    exit(0);
    }
  KUniqueApplication a;

//  next line is for testing only.
//  I don't debug KUniqueApplication 

//  TDEApplication a;
//
  KNutClient *knutclient = new KNutClient(!noDock);
  int returnCode = a.exec();
  delete knutclient;
  return returnCode;
}