~ubuntu-branches/debian/sid/kxstitch/sid

« back to all changes in this revision

Viewing changes to kxstitch/main.cpp

  • Committer: Bazaar Package Importer
  • Author(s): eric pareja
  • Date: 2005-02-19 12:37:22 UTC
  • Revision ID: james.westby@ubuntu.com-20050219123722-kt3ru1nqvllietee
Tags: upstream-0.6
ImportĀ upstreamĀ versionĀ 0.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2003 by Stephen Allewell                                *
 
3
 *   stephen@mirramar.fsnet.co.uk                                          *
 
4
 *                                                                         *
 
5
 *   This program is free software; you can redistribute it and/or modify  *
 
6
 *   it under the terms of the GNU General Public License as published by  *
 
7
 *   the Free Software Foundation; either version 2 of the License, or     *
 
8
 *   (at your option) any later version.                                   *
 
9
 ***************************************************************************/
 
10
 
 
11
#include <kcmdlineargs.h>
 
12
#include <kaboutdata.h>
 
13
#include <klocale.h>
 
14
#include "kxstitch.h"
 
15
 
 
16
static const char *description =
 
17
  I18N_NOOP("KXStitch");
 
18
 
 
19
static KCmdLineOptions options[] =
 
20
{
 
21
  { "+[File]", I18N_NOOP("file to open"), 0 },
 
22
  { 0, 0, 0 }
 
23
};
 
24
 
 
25
int main(int argc, char *argv[])
 
26
{
 
27
  KAboutData aboutData( "kxstitch", I18N_NOOP("KXStitch"),
 
28
    VERSION, description, KAboutData::License_GPL,
 
29
    "(c) 2004, Stephen Allewell", 0, 0, "stephen@mirramar.fsnet.co.uk");
 
30
  aboutData.addAuthor("Stephen Allewell",0, "stephen@mirramar.fsnet.co.uk");
 
31
  aboutData.addCredit("Pierre Brua",I18N_NOOP("Bug fixes, application icons, French translation"),"kxstitchdev@paralline.com");
 
32
  KCmdLineArgs::init( argc, argv, &aboutData );
 
33
  KCmdLineArgs::addCmdLineOptions( options );
 
34
 
 
35
  KXStitchApplication app;
 
36
 
 
37
  if (app.isRestored())
 
38
  {
 
39
    RESTORE(KXStitchApp);
 
40
  }
 
41
  else
 
42
  {
 
43
    KXStitchApp *kxstitch = new KXStitchApp();
 
44
    kxstitch->show();
 
45
 
 
46
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
 
47
 
 
48
    if (args->count())
 
49
    {
 
50
      kxstitch->openDocumentFile(args->arg(0));
 
51
      args->clear();
 
52
    }
 
53
  }
 
54
  return app.exec();
 
55
}