22 #include "iaupdatemainview.h" |
22 #include "iaupdatemainview.h" |
23 #include "iaupdatesettingdialog.h" |
23 #include "iaupdatesettingdialog.h" |
24 |
24 |
25 IAUpdateApplication::IAUpdateApplication( int argc, char* argv[] ) : |
25 IAUpdateApplication::IAUpdateApplication( int argc, char* argv[] ) : |
26 HbApplication( argc, argv ), |
26 HbApplication( argc, argv ), |
27 mEngine (new IAUpdateEngine), |
27 mEngine (new IAUpdateEngine) |
28 mMainWindow (new IAUpdateMainWindow(mEngine)) |
28 { |
29 { |
29 connect(&(*mEngine), SIGNAL(createUI()), |
30 |
30 &(*this), SLOT(createUI())); |
31 // get mainview |
31 } |
32 IAUpdateMainView* mainView = mMainWindow->GetMainView(); |
|
33 |
|
34 // get settig view |
|
35 CIAUpdateSettingDialog* settingView = mMainWindow->GetSettingView(); |
|
36 |
|
37 // Connect view change signals to the view change slots |
|
38 //connect(&(*mEngine), SIGNAL(toMainView()), &(*mMainWindow), SLOT(toMainView())); |
|
39 connect(&(*settingView), SIGNAL(toMainView()), &(*mMainWindow), SLOT(toMainView())); |
|
40 connect(&(*mainView), SIGNAL(toSettingView()), &(*mMainWindow), SLOT(toSettingView())); |
|
41 connect(&(*mEngine), SIGNAL(refresh(const RPointerArray<MIAUpdateNode>&, const RPointerArray<MIAUpdateFwNode>&,int)), |
|
42 &(*mMainWindow), SLOT(refreshMainView(const RPointerArray<MIAUpdateNode>&, const RPointerArray<MIAUpdateFwNode>&,int))); |
|
43 connect(&(*mEngine), SIGNAL(refreshProgress()), |
|
44 &(*mMainWindow), SLOT(refreshMainViewProgress())); |
|
45 connect(&(*mEngine), SIGNAL(setUpdatesRefreshing(bool)), |
|
46 &(*mMainWindow), SLOT(setRefreshingAnimation(bool))); |
|
47 connect(&(*mEngine), SIGNAL(updateCompleted()), |
|
48 &(*mMainWindow), SLOT(updateCompleted())); |
|
49 } |
|
50 |
32 |
51 IAUpdateApplication::~IAUpdateApplication() |
33 IAUpdateApplication::~IAUpdateApplication() |
52 { |
34 { |
53 delete mEngine; |
35 delete mEngine; |
54 } |
36 } |
|
37 |
|
38 void IAUpdateApplication::createUI() |
|
39 { |
|
40 if (mMainWindow.isNull()) |
|
41 { |
|
42 mMainWindow = (QSharedPointer<IAUpdateMainWindow>) new IAUpdateMainWindow(mEngine); |
|
43 // get mainview |
|
44 IAUpdateMainView* mainView = mMainWindow->GetMainView(); |
|
45 |
|
46 // get setting view |
|
47 CIAUpdateSettingDialog* settingView = mMainWindow->GetSettingView(); |
|
48 |
|
49 // Connect view change signals to the view change slots |
|
50 connect(&(*settingView), SIGNAL(toMainView()), &(*mMainWindow), SLOT(toMainView())); |
|
51 connect(&(*mainView), SIGNAL(toSettingView()), &(*mMainWindow), SLOT(toSettingView())); |
|
52 connect(&(*mEngine), SIGNAL(refresh(const RPointerArray<MIAUpdateNode>&, const RPointerArray<MIAUpdateFwNode>&,int)), |
|
53 &(*mMainWindow), SLOT(refreshMainView(const RPointerArray<MIAUpdateNode>&, const RPointerArray<MIAUpdateFwNode>&,int))); |
|
54 connect(&(*mEngine), SIGNAL(refreshProgress()), |
|
55 &(*mMainWindow), SLOT(refreshMainViewProgress())); |
|
56 connect(&(*mEngine), SIGNAL(setUpdatesRefreshing(bool)), |
|
57 &(*mMainWindow), SLOT(setRefreshingAnimation(bool))); |
|
58 connect(&(*mEngine), SIGNAL(updateCompleted()), |
|
59 &(*mMainWindow), SLOT(updateCompleted())); |
|
60 } |
|
61 } |