~ubuntu-branches/ubuntu/gutsy/kdebase-workspace/gutsy-backports

« back to all changes in this revision

Viewing changes to systemsettings/main.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-09-05 20:45:14 UTC
  • Revision ID: james.westby@ubuntu.com-20070905204514-632hhspl0nvrc84i
Tags: upstream-3.93.0
ImportĀ upstreamĀ versionĀ 3.93.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * This file is part of the System Settings package
 
3
 * Copyright (C) 2005 Benjamin C Meyer
 
4
 *                    <ben+systempreferences at meyerhome dot net>
 
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 library 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 GNU
 
14
 * Library General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU Library General Public License
 
17
 * along with this library; see the file COPYING.LIB.  If not, write to
 
18
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
19
 * Boston, MA 02110-1301, USA.
 
20
 */
 
21
 
 
22
#include <kuniqueapplication.h>
 
23
#include <kcmdlineargs.h>
 
24
#include <kaboutdata.h>
 
25
#include <klocale.h>
 
26
 
 
27
#include "mainwindow.h"
 
28
#include "version.h"
 
29
 
 
30
#include <iostream>
 
31
 
 
32
int main( int argc, char *argv[] )
 
33
{
 
34
  KLocale::setMainCatalog("systemsettings");
 
35
        // About data
 
36
  KAboutData aboutData("systemsettings", 0, ki18n("System Settings"),
 
37
          SYSTEM_SETTINGS_VERSION, ki18n("System Settings"),
 
38
          KAboutData::License_LGPL, ki18n("(c) 2005, Benjamin C. Meyer; (c) 2007, Canonical Ltd"));
 
39
  aboutData.addAuthor(ki18n("Benjamin C. Meyer"), ki18n("Author"),
 
40
          "ben+systempreferences@meyerhome.net");
 
41
  aboutData.addAuthor(ki18n("Jonathan Riddell"), ki18n("Contributor"),
 
42
          "jriddell@ubuntu.com");
 
43
  aboutData.addAuthor(ki18n("Michael D. Stemle"), ki18n("Contributor"),
 
44
          "manchicken@notsosoft.net");
 
45
  aboutData.addAuthor(ki18n("Simon Edwards"), ki18n("Contributor"),
 
46
          "simon@simonzone.com");
 
47
  aboutData.addAuthor(ki18n("Ellen Reitmayr"), ki18n("Usability"),
 
48
          "ellen@kde.org");
 
49
  KCmdLineArgs::init(argc, argv, &aboutData);
 
50
 
 
51
  // Tell which options are supported
 
52
 
 
53
  KCmdLineOptions options;
 
54
  options.add("menu <argument>", ki18n("Menu file"), "systemsettings");
 
55
  KCmdLineArgs::addCmdLineOptions( options );
 
56
  KUniqueApplication::addCmdLineOptions();
 
57
  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
 
58
 
 
59
  if (!KUniqueApplication::start()) {
 
60
    std::cerr << "This program is already running." << std::endl;
 
61
    return 0;
 
62
  }
 
63
  KUniqueApplication application;
 
64
 
 
65
  MainWindow *mainWindow = new MainWindow(args->getOption("menu"));
 
66
 
 
67
  mainWindow->show();
 
68
 
 
69
  args->clear();
 
70
 
 
71
  return application.exec();
 
72
}