~ubuntu-branches/debian/jessie/italc/jessie

« back to all changes in this revision

Viewing changes to ima/src/main.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Winnertz
  • Date: 2011-02-11 14:50:22 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20110211145022-sn173siax6lywjus
Tags: upstream-1.0.13
ImportĀ upstreamĀ versionĀ 1.0.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * main.cpp - main-file for iTALC-Application
3
3
 *
4
 
 * Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
 
4
 * Copyright (c) 2004-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
5
5
 *
6
6
 * This file is part of iTALC - http://italc.sourceforge.net
7
7
 *
22
22
 *
23
23
 */
24
24
 
25
 
 
26
 
#include <QtCore/QLocale>
27
25
#include <QtCore/QModelIndex>
28
 
#include <QtCore/QTranslator>
29
26
#include <QtGui/QApplication>
30
27
#include <QtGui/QSplashScreen>
31
28
 
32
 
#include "main_window.h"
 
29
#include "MainWindow.h"
33
30
#include "ivs_connection.h"
34
31
#include "local_system_ima.h"
35
32
#include "remote_control_widget.h"
69
66
                        "font-weight:bold; padding: 4px 32px 4px 20px; }" );
70
67
#endif
71
68
 
72
 
        // load translations
73
 
        QString loc =  QLocale::system().name().toLower();
74
 
        if( loc.left( 2 ) == loc.right( 2 ) )
75
 
        {
76
 
                loc = loc.left( 2 );
77
 
        }
78
 
 
79
 
        QTranslator app_tr;
80
 
        app_tr.load( ":/resources/" + loc + ".qm" );
81
 
        app.installTranslator( &app_tr );
82
 
 
83
 
        QTranslator core_tr;
84
 
        core_tr.load( ":/resources/" + loc + "-core.qm" );
85
 
        app.installTranslator( &core_tr );
86
 
 
87
 
        QTranslator qt_tr;
88
 
        qt_tr.load( ":/resources/qt_" + loc + ".qm" );
89
 
        app.installTranslator( &qt_tr );
90
 
 
91
 
 
92
69
        qRegisterMetaType<QModelIndex>( "QModelIndex" );
93
70
        qRegisterMetaType<quint16>( "quint16" );
94
71
 
95
72
 
96
73
        localSystem::initialize();
 
74
        if( QLocale::system().language() == QLocale::Hebrew ||
 
75
                QLocale::system().language() == QLocale::Arabic )
 
76
        {
 
77
                QApplication::setLayoutDirection( Qt::RightToLeft );
 
78
        }
 
79
 
97
80
 
98
81
        __role = ISD::RoleTeacher;
99
82
        if( localSystem::parameter( "isdport" ).toInt() > 0 )
167
150
 
168
151
 
169
152
        // now create the main-window
170
 
        mainWindow * main_window = new mainWindow( screen );
 
153
        MainWindow * mainWindow = new MainWindow( screen );
171
154
 
172
 
        if( !main_window->localISD() ||
173
 
                main_window->localISD()->state() != isdConnection::Connected )
 
155
        if( !mainWindow->localISD() ||
 
156
                mainWindow->localISD()->state() != isdConnection::Connected )
174
157
        {
175
 
                return( -1 );
 
158
                return -1;
176
159
        }
177
160
 
178
161
        // hide splash-screen as soon as main-window is shown
179
 
        splashScreen->finish( main_window );
 
162
        splashScreen->finish( mainWindow );
180
163
 
181
 
        main_window->show();
 
164
        mainWindow->show();
182
165
 
183
166
        // let's rock!!
184
 
        return( app.exec() );
 
167
        return app.exec();
185
168
}
186
169