17 |
17 |
18 #include <exception> // must be before e32base.h so uncaught_exception gets defined |
18 #include <exception> // must be before e32base.h so uncaught_exception gets defined |
19 #include <starterclient.h> |
19 #include <starterclient.h> |
20 #include <telinternalpskeys.h> |
20 #include <telinternalpskeys.h> |
21 #include <QLocale> |
21 #include <QLocale> |
22 #include <QTranslator> |
22 #include <HbTranslator> |
23 #include <telremotepartyinformationpskeys.h> |
23 #include <telremotepartyinformationpskeys.h> |
24 #include <telinformationpskeys.h> |
24 #include <telinformationpskeys.h> |
25 #include <UikonInternalPSKeys.h> |
25 #include <UikonInternalPSKeys.h> |
26 #include <startupdomainpskeys.h> |
26 #include <startupdomainpskeys.h> |
27 #include <featmgr.h> // for FeatureManager |
27 #include <featmgr.h> // for FeatureManager |
28 #include <hbmainwindow.h> |
28 #include <hbmainwindow.h> |
29 #include "phoneconstants.h" |
29 #include "phoneconstants.h" |
30 #include "cphonelogger.h" |
30 #include "cphonelogger.h" |
31 #include "cphonepubsubproxy.h" |
31 #include "cphonepubsubproxy.h" |
32 #include "cphoneqwertyhandler.h" |
|
33 #include "cphoneuicontroller.h" |
32 #include "cphoneuicontroller.h" |
34 #include "phoneuihousehold_p.h" |
33 #include "phoneuihousehold_p.h" |
35 #include "phoneuiqtviewadapter.h" |
34 #include "phoneuiqtviewadapter.h" |
36 #include "phoneuiqtview.h" |
35 #include "phoneuiqtview.h" |
37 #include "phoneuikeyeventadapter.h" |
36 #include "phoneuikeyeventadapter.h" |
41 #include "cphoneclearblacklist.h" |
40 #include "cphoneclearblacklist.h" |
42 #include "hbinstance.h" |
41 #include "hbinstance.h" |
43 |
42 |
44 PhoneUiHouseHoldPrivate::PhoneUiHouseHoldPrivate(HbMainWindow &window) : |
43 PhoneUiHouseHoldPrivate::PhoneUiHouseHoldPrivate(HbMainWindow &window) : |
45 iAppsReady (0), iStartupSignalRecoveryId (0), iLightIdleReached (EFalse), |
44 iAppsReady (0), iStartupSignalRecoveryId (0), iLightIdleReached (EFalse), |
46 iOnScreenDialer (EFalse), iQwertyHandler (0), iPhoneUIController (0), |
45 iOnScreenDialer (EFalse), iPhoneUIController (0), |
47 m_window (window) |
46 m_window (window) |
48 { |
47 { |
49 PHONE_DEBUG("phoneui - Start phoneapp"); |
48 PHONE_DEBUG("phoneui - Start phoneapp"); |
50 |
49 |
51 TRAPD( error, ConstructL() ); |
50 TRAPD( error, ConstructL() ); |
176 void PhoneUiHouseHoldPrivate::ConstructL() |
174 void PhoneUiHouseHoldPrivate::ConstructL() |
177 { |
175 { |
178 new( ELeave ) CPhoneLogger( KUidPhoneUILoggerSingleton ); |
176 new( ELeave ) CPhoneLogger( KUidPhoneUILoggerSingleton ); |
179 FeatureManager::InitializeLibL(); |
177 FeatureManager::InitializeLibL(); |
180 |
178 |
181 QString locale = QLocale::system ().name (); |
179 HbTranslator *translator = new HbTranslator(QString("telephone")); |
182 QTranslator *translator = new QTranslator; |
180 |
183 QString path = QString("z:\\resource\\qt\\translations\\"); |
181 if (translator) { |
184 |
182 translator->loadCommon(); |
185 bool translatorLoaded = translator->load(QString(path + "telephone_" + locale)); |
|
186 PHONE_DEBUG2("PhoneUiHouseHoldPrivate::ConstructL() translator.load:", translatorLoaded); |
|
187 if (translatorLoaded) { |
|
188 qApp->installTranslator(translator); |
|
189 m_translators.append(translator); |
183 m_translators.append(translator); |
190 }else { |
184 } else { |
191 delete translator; |
185 delete translator; |
192 translator = 0; |
186 translator = 0; |
193 } |
187 } |
194 |
188 |
195 QTranslator *translator2 = new QTranslator; |
189 HbTranslator *translator2 = new HbTranslator(QString("telephone_cp")); |
196 translatorLoaded = translator2->load(path + "telephone_cp_" + locale); |
190 if (translator2) { |
197 if (translatorLoaded) { |
|
198 qApp->installTranslator(translator2); |
|
199 m_translators.append(translator2); |
191 m_translators.append(translator2); |
200 } else { |
192 } else { |
201 delete translator2; |
193 delete translator2; |
202 translator2 = 0; |
194 translator2 = 0; |
203 } |
195 } |
204 |
196 |
205 QTranslator *translator3 = new QTranslator; |
|
206 translatorLoaded = translator3->load(path + "common_" + locale); |
|
207 if (translatorLoaded) { |
|
208 qApp->installTranslator(translator3); |
|
209 m_translators.append(translator3); |
|
210 } else { |
|
211 delete translator3; |
|
212 translator3 = 0; |
|
213 } |
|
214 |
|
215 PhoneUIQtView *view = new PhoneUIQtView(m_window); |
197 PhoneUIQtView *view = new PhoneUIQtView(m_window); |
216 iViewAdapter = new PhoneUIQtViewAdapter(*view); |
198 iViewAdapter = new PhoneUIQtViewAdapter(*view); |
217 iPhoneUIController = CPhoneUIController::NewL(iViewAdapter); |
199 iPhoneUIController = CPhoneUIController::NewL(iViewAdapter); |
218 |
200 |
219 m_window.addView (view); |
201 m_window.addView (view); |
220 m_window.setCurrentView (view); |
202 m_window.setCurrentView (view); |
221 m_window.scene ()->setFocusItem (view); |
203 m_window.scene ()->setFocusItem (view); |
222 iQwertyHandler = CPhoneQwertyHandler::NewL(); |
|
223 iKeyEventAdapter = new PhoneUIKeyEventAdapter (*iPhoneUIController); |
204 iKeyEventAdapter = new PhoneUIKeyEventAdapter (*iPhoneUIController); |
224 iCommandAdapter = new PhoneUiCommandAdapter (*iPhoneUIController); |
205 iCommandAdapter = new PhoneUiCommandAdapter (*iPhoneUIController); |
225 QObject::connect(view, SIGNAL(dialpadIsAboutToClose()), iViewAdapter, SLOT(dialpadClosed())); |
206 QObject::connect(view, SIGNAL(dialpadIsAboutToClose()), iViewAdapter, SLOT(dialpadClosed())); |
226 QObject::connect(view, SIGNAL(keyReleased(QKeyEvent *)), iViewAdapter, SLOT(keyReleased (QKeyEvent *))); |
207 QObject::connect(view, SIGNAL(keyReleased(QKeyEvent *)), iViewAdapter, SLOT(keyReleased (QKeyEvent *))); |
227 QObject::connect(view, SIGNAL(keyPressed (QKeyEvent *)), iKeyEventAdapter, SLOT(keyPressed (QKeyEvent *))); |
208 QObject::connect(view, SIGNAL(keyPressed (QKeyEvent *)), iKeyEventAdapter, SLOT(keyPressed (QKeyEvent *))); |