~ubuntu-branches/ubuntu/precise/sflphone/precise

« back to all changes in this revision

Viewing changes to kde/src/main.cpp

  • Committer: Package Import Robot
  • Author(s): Whoopie
  • Date: 2012-03-22 10:29:10 UTC
  • mfrom: (4.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20120322102910-tb8hugi2su1tguwh
Tags: 1.0.2-1ubuntu1
* Apply some upstream patches to fix FTBFS (LP: #913018):
  - debian/patches/05_glib_includes.patch: fix glib includes.
  - debian/patches/06_use_XkbKeycodeToKeysym.patch: use 
    XkbKeycodeToKeysym instead of (deprecated) XKeycodeToKeysym.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2009-2012 by Savoir-Faire Linux                         *
 
3
 *   Author : Jérémy Quentin <jeremy.quentin@savoirfairelinux.com>         *
 
4
 *            Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com>*
 
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 3 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                         *
 
18
 *   Free Software Foundation, Inc.,                                       *
 
19
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 
20
 **************************************************************************/
 
21
 
 
22
//System
 
23
#include <unistd.h>
 
24
 
 
25
//Qt
 
26
#include <QtGui/QAction>
 
27
#include <QApplication>
 
28
#include <QtCore/QString>
 
29
#include <QtGui/QMenu>
 
30
#include <QTableView>
 
31
#include <QListView>
 
32
 
 
33
//KDE
 
34
#include <KDebug>
 
35
#include <kcmdlineargs.h>
 
36
#include <kaboutdata.h>
 
37
#include <klocale.h>
 
38
#include <KNotification>
 
39
 
 
40
//SFLPhone
 
41
#include "AccountWizard.h"
 
42
#include "SFLPhoneapplication.h"
 
43
#include "conf/ConfigurationDialog.h"
 
44
#include "conf/ConfigurationSkeleton.h"
 
45
#include "CallView.h"
 
46
#include "SFLPhone.h"
 
47
#include "AccountListModel.h"
 
48
 
 
49
//SFLPhone library
 
50
#include "lib/instance_interface_singleton.h"
 
51
#include "lib/sflphone_const.h"
 
52
 
 
53
static const char description[] = "A KDE 4 Client for SFLphone";
 
54
 
 
55
static const char version[] = "1.0.2";
 
56
 
 
57
int main(int argc, char **argv)
 
58
{
 
59
 
 
60
   try
 
61
   {
 
62
      KLocale::setMainCatalog("sflphone-client-kde");
 
63
 
 
64
      KAboutData about(
 
65
         "sflphone-client-kde"                      ,
 
66
         "sflphone-client-kde"                      ,
 
67
         ki18n("SFLphone KDE Client")               ,
 
68
         version                                    ,
 
69
         ki18n(description)                         ,
 
70
         KAboutData::License_GPL_V3                 ,
 
71
         ki18n("(C) 2009-2012 Savoir-faire Linux")  ,
 
72
         KLocalizedString()                         ,
 
73
         "http://www.sflphone.org."                 ,
 
74
         "sflphone@lists.savoirfairelinux.net"
 
75
      );
 
76
      about.addAuthor( ki18n( "Jérémy Quentin"         ), KLocalizedString(), "jeremy.quentin@savoirfairelinux.com"  );
 
77
      about.addAuthor( ki18n( "Emmanuel Lepage Vallee" ), KLocalizedString(), "emmanuel.lepage@savoirfairelinux.com" );
 
78
      //about.setTranslator( ki18nc("NAME OF TRANSLATORS","Your names"), ki18nc("EMAIL OF TRANSLATORS","Your emails") );
 
79
      KCmdLineArgs::init(argc, argv, &about);
 
80
      KCmdLineOptions options;
 
81
      KCmdLineArgs::addCmdLineOptions(options);
 
82
 
 
83
      //configuration dbus
 
84
      TreeWidgetCallModel::init();
 
85
 
 
86
      SFLPhoneApplication app;
 
87
 
 
88
      SFLPhone* sflphoneWindow_ = new SFLPhone();
 
89
      if( ! sflphoneWindow_->initialize() ) {
 
90
         exit(1);
 
91
         return 1;
 
92
      };
 
93
      sflphoneWindow_->show();
 
94
 
 
95
      int retVal = app.exec();
 
96
 
 
97
      ConfigurationSkeleton* conf = ConfigurationSkeleton::self();
 
98
      conf->writeConfig();
 
99
      delete sflphoneWindow_;
 
100
      return retVal;
 
101
   }
 
102
   catch(const char * msg)
 
103
   {
 
104
      kDebug() << msg;
 
105
   }
 
106
   catch(QString msg)
 
107
   {
 
108
      kDebug() << msg;
 
109
   }
 
110
}