30 // BgcIndicator::BgcIndicator |
33 // BgcIndicator::BgcIndicator |
31 // @see bgcindicator.h |
34 // @see bgcindicator.h |
32 // ---------------------------------------------------------------------------- |
35 // ---------------------------------------------------------------------------- |
33 BgcIndicator::BgcIndicator(const QString &indicatorType) : |
36 BgcIndicator::BgcIndicator(const QString &indicatorType) : |
34 HbIndicatorInterface(indicatorType, |
37 HbIndicatorInterface(indicatorType, |
35 HbIndicatorInterface::GroupPriorityHigh, |
38 HbIndicatorInterface::NotificationCategory, |
36 InteractionActivated), |
39 InteractionActivated), |
37 mNrOfUpdates(0) |
40 mNrOfUpdates(0) |
38 { |
41 { |
39 } |
42 } |
40 |
43 |
41 // ---------------------------------------------------------------------------- |
44 // ---------------------------------------------------------------------------- |
68 // BgcIndicator::indicatorData |
75 // BgcIndicator::indicatorData |
69 // @see bgcindicator.h |
76 // @see bgcindicator.h |
70 // ---------------------------------------------------------------------------- |
77 // ---------------------------------------------------------------------------- |
71 QVariant BgcIndicator::indicatorData(int role) const |
78 QVariant BgcIndicator::indicatorData(int role) const |
72 { |
79 { |
73 |
80 // use iaupdate's translate file |
|
81 // loc: HbTranslator trans("z:\\resource\\iaupdate\\","Text_Map_Swupdate_"); |
|
82 |
74 switch(role) |
83 switch(role) |
75 { |
84 { |
76 case TextRole: |
85 case PrimaryTextRole: |
77 { |
86 { |
78 QString text(""); |
87 QString text(""); |
79 if ( mNrOfUpdates > 0 ) |
88 if ( mNrOfUpdates == 0 ) |
|
89 { |
|
90 // First time case |
|
91 // loc: text.append(hbTrId("txt_software_update_list_software_update")); |
|
92 text.append(QString("Check for updates?")); |
|
93 } |
|
94 else if ( mNrOfUpdates == 1 ) |
|
95 { |
|
96 // one update available |
|
97 // loc: text.append(hbTrId("txt_software_dblist_update_available")); |
|
98 text.append(QString("Update available")); |
|
99 } |
|
100 else |
|
101 { |
|
102 // several updates available |
|
103 // loc: text.append(hbTrId("txt_software_dblist_updates_available")); |
80 text.append(QString("Updates available")); |
104 text.append(QString("Updates available")); |
|
105 } |
|
106 return text; |
|
107 } |
|
108 case SecondaryTextRole: |
|
109 { |
|
110 QString text(""); |
|
111 if ( mNrOfUpdates == 0 ) |
|
112 { |
|
113 // First time case |
|
114 // loc: QString text(hbTrId("txt_software_update_list_software_update")); |
|
115 text.append(QString("Tap to view")); |
|
116 } |
|
117 else if ( mNrOfUpdates == 1 ) |
|
118 { |
|
119 // one update available |
|
120 // loc: QString text(hbTrId("txt_software_dblist_val_1_new")); |
|
121 text.append(QString("%1 new").arg(mNrOfUpdates)); |
|
122 } |
81 else |
123 else |
82 text.append(QString("Check for updates?")); |
124 { |
83 return text; |
125 // several updates available |
84 } |
126 // loc: QString text(hbTrId("txt_software_dblist_val_ln_new")); |
85 case SecondaryTextRole: |
127 text.append(QString("%1 new").arg(mNrOfUpdates)); |
86 { |
128 } |
87 QString text("Tap to view"); |
|
88 return text; |
129 return text; |
89 } |
130 } |
90 case IconNameRole: |
131 case DecorationNameRole: |
|
132 case MonoDecorationNameRole: |
91 { |
133 { |
92 // QString iconName("z:/resource/messaging/message.svg"); |
134 // QString iconName("z:/resource/messaging/message.svg"); |
93 QString iconName("c:/qgn_note_swupdate_notification.svg"); |
135 // HbIcon iconName1 ("c:/qgn_note_swupdate_notification.svg"); |
|
136 QString iconName("z:/resource/iaupdate/qgn_note_swupdate_notification.svg"); |
94 return iconName; |
137 return iconName; |
95 } |
138 } |
96 default: |
139 default: |
97 return QVariant(); |
140 return QVariant(); |
98 } |
141 } |
124 |
168 |
125 return handled; |
169 return handled; |
126 } |
170 } |
127 |
171 |
128 // ---------------------------------------------------------- |
172 // ---------------------------------------------------------- |
129 // CIAUpdateBGTimer::StartIaupdateL() |
173 // BgcIndicator::StartIaupdateL() |
130 // ---------------------------------------------------------- |
174 // ---------------------------------------------------------- |
131 void BgcIndicator::StartIaupdateL() const |
175 void BgcIndicator::StartIaupdateL() const |
132 { |
176 { |
133 |
177 |
134 const TUint KIADUpdateLauncherUid( 0x2001FE2F ); |
178 const TUint KIADUpdateLauncherUid( 0x2001FE2F ); |
135 _LIT(KIAUpdateLauncherExe, "iaupdatelauncher.exe" ); |
179 _LIT(KIAUpdateLauncherExe, "iaupdatelauncher.exe" ); |
136 _LIT8( KRefreshFromNetworkDenied, "1" ); |
180 _LIT8( KRefreshFromNetworkDenied, "1" ); |
137 |
181 |
138 //FLOG("[bgchecker] StartIaupdateL() begin"); |
|
139 RWsSession ws; |
182 RWsSession ws; |
140 User::LeaveIfError( ws.Connect() == KErrNone ); |
183 User::LeaveIfError( ws.Connect() == KErrNone ); |
141 TApaTaskList tasklist(ws); |
184 TApaTaskList tasklist(ws); |
142 TApaTask task = tasklist.FindApp( TUid::Uid( KIADUpdateLauncherUid ) ); |
185 TApaTask task = tasklist.FindApp( TUid::Uid( KIADUpdateLauncherUid ) ); |
143 if ( task.Exists() ) |
186 if ( task.Exists() ) |
144 { |
187 { |
145 //FLOG("[bgchecker] StartIaupdateL() IAD launcher process found"); |
|
146 task.BringToForeground(); |
188 task.BringToForeground(); |
147 //FLOG("[bgchecker] StartIaupdateL() after task.BringToForeground()"); |
|
148 ws.Close(); |
189 ws.Close(); |
149 } |
190 } |
150 else |
191 else |
151 { |
192 { |
152 ws.Close(); |
193 ws.Close(); |