22 |
22 |
23 #include "iaupdateautomaticcheck.h" |
23 #include "iaupdateautomaticcheck.h" |
24 #include "iaupdatefirsttimeinfo.h" |
24 #include "iaupdatefirsttimeinfo.h" |
25 #include "iaupdate.hrh" |
25 #include "iaupdate.hrh" |
26 #include "iaupdateprivatecrkeys.h" |
26 #include "iaupdateprivatecrkeys.h" |
|
27 #include "iaupdatedialogutil.h" |
27 |
28 |
28 //#include <avkon.hrh> |
|
29 #include <centralrepository.h> |
29 #include <centralrepository.h> |
30 #include <hbmessagebox.h> |
|
31 #include <hbaction.h> |
30 #include <hbaction.h> |
32 |
31 |
33 |
32 |
34 // --------------------------------------------------------------------------- |
33 // --------------------------------------------------------------------------- |
35 // CIAUpdateAutomaticCheck::NewL |
34 // CIAUpdateAutomaticCheck::NewL |
79 // Destructor |
78 // Destructor |
80 // --------------------------------------------------------------------------- |
79 // --------------------------------------------------------------------------- |
81 // |
80 // |
82 CIAUpdateAutomaticCheck::~CIAUpdateAutomaticCheck() |
81 CIAUpdateAutomaticCheck::~CIAUpdateAutomaticCheck() |
83 { |
82 { |
|
83 if ( mDialogUtil ) |
|
84 { |
|
85 delete mDialogUtil; |
|
86 } |
84 } |
87 } |
85 |
88 |
86 |
89 |
87 // --------------------------------------------------------------------------- |
90 // --------------------------------------------------------------------------- |
88 // CIAUpdateAutomaticCheck::AcceptAutomaticCheckL |
91 // CIAUpdateAutomaticCheck::AcceptAutomaticCheckL |
89 // |
92 // |
90 // --------------------------------------------------------------------------- |
93 // --------------------------------------------------------------------------- |
91 // |
94 // |
92 TBool CIAUpdateAutomaticCheck::AcceptAutomaticCheckL() |
95 void CIAUpdateAutomaticCheck::AcceptAutomaticCheckL() |
93 { |
96 { |
94 TBool acceptChecks = ETrue; |
|
95 CIAUpdateFirstTimeInfo* firstTimeInfo = CIAUpdateFirstTimeInfo::NewLC(); |
97 CIAUpdateFirstTimeInfo* firstTimeInfo = CIAUpdateFirstTimeInfo::NewLC(); |
96 if ( !firstTimeInfo->AutomaticUpdateChecksAskedL() ) |
98 if ( !firstTimeInfo->AutomaticUpdateChecksAskedL() ) |
97 { |
99 { |
98 if ( AutoUpdateCheckEnabledL() ) |
100 if ( AutoUpdateCheckEnabledL() ) |
99 { |
101 { |
100 // if automatic update check configured as enabled, confirmation is not asked |
102 // if automatic update check configured as enabled, confirmation is not asked |
101 firstTimeInfo->SetAutomaticUpdatesAskedL(); |
103 firstTimeInfo->SetAutomaticUpdatesAskedL(); |
102 } |
104 } |
103 else |
105 else |
104 { |
106 { |
105 HbMessageBox messageBox(HbMessageBox::MessageTypeQuestion); |
107 if ( !mDialogUtil ) |
106 messageBox.setText(QString("Turn on setting for Automatic update checks?")); |
108 { |
107 HbAction yesAction("Yes"); |
109 mDialogUtil = new IAUpdateDialogUtil(NULL, this); |
108 HbAction noAction("No"); |
110 } |
109 messageBox.setPrimaryAction(&yesAction); |
111 if ( mDialogUtil ) |
110 messageBox.setSecondaryAction(&noAction); |
112 { |
111 messageBox.setTimeout(HbPopup::NoTimeout); |
113 mPrimaryAction = NULL; |
112 messageBox.show(); |
114 mPrimaryAction = new HbAction("Yes"); |
113 //HbAction *selectedAction = messageBox.exec(); |
115 HbAction *secondaryAction = NULL; |
114 firstTimeInfo->SetAutomaticUpdatesAskedL(); |
116 secondaryAction = new HbAction("No"); |
115 //if ( selectedAction == messageBox.primaryAction() ) |
117 mDialogUtil->showQuestion(QString("Turn on setting for Automatic update checks?"), mPrimaryAction, secondaryAction); |
116 // { |
118 } |
117 //EnableAutoUpdateCheckL( ETrue ); // TEMP |
119 } |
118 // } |
|
119 } |
|
120 } |
120 } |
121 CleanupStack::PopAndDestroy( firstTimeInfo ); |
121 CleanupStack::PopAndDestroy( firstTimeInfo ); |
122 return acceptChecks; |
|
123 } |
122 } |
124 |
123 |
125 // --------------------------------------------------------------------------- |
124 // --------------------------------------------------------------------------- |
126 // CIAUpdateAutomaticCheck::AutoUpdateCheckEnabledL |
125 // CIAUpdateAutomaticCheck::AutoUpdateCheckEnabledL |
127 // |
126 // |
171 User::LeaveIfError( cenrep->CommitTransaction( ignore ) ); |
170 User::LeaveIfError( cenrep->CommitTransaction( ignore ) ); |
172 CleanupStack::PopAndDestroy(); // CleanupCancelTransactionPushL() |
171 CleanupStack::PopAndDestroy(); // CleanupCancelTransactionPushL() |
173 CleanupStack::PopAndDestroy( cenrep ); |
172 CleanupStack::PopAndDestroy( cenrep ); |
174 } |
173 } |
175 |
174 |
176 |
175 // --------------------------------------------------------------------------- |
|
176 // CIAUpdateAutomaticCheck::dialogFinished |
|
177 // |
|
178 // --------------------------------------------------------------------------- |
|
179 // |
|
180 void CIAUpdateAutomaticCheck::dialogFinished(HbAction *action) |
|
181 { |
|
182 if ( action == mPrimaryAction ) |
|
183 { |
|
184 EnableAutoUpdateCheckL( ETrue ); |
|
185 } |
|
186 CIAUpdateFirstTimeInfo* firstTimeInfo = CIAUpdateFirstTimeInfo::NewLC(); |
|
187 firstTimeInfo->SetAutomaticUpdatesAskedL(); |
|
188 CleanupStack::PopAndDestroy( firstTimeInfo ); |
|
189 } |
177 // End of File |
190 // End of File |