Tizen 2.0 Release
[pkgs/o/oma-ds-service.git] / data / my_tools / jj / rsa / apps / osp / Settings / src / StDeveloperOptionForm.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://floralicense.org/license/
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file                StDeveloperOptionForm.cpp
19  * @brief               This is the implementation file for DeveloperOptionForm class.
20  */
21
22 #include <FSystem.h>
23 #include "StDeveloperOptionForm.h"
24 #include "StResourceManager.h"
25 #include "StTypes.h"
26
27 using namespace Tizen::App;
28 using namespace Tizen::Base;
29 using namespace Tizen::Base::Collection;
30 using namespace Tizen::Graphics;
31 using namespace Tizen::System;
32 using namespace Tizen::Ui;
33 using namespace Tizen::Ui::Controls;
34 using namespace Tizen::Ui::Scenes;
35
36 static const int ID_GROUP_DEVELOPER_MAIN = 0;
37 static const int ID_GROUP_DEVELOPER_MAIN_ITEM_COUNT = 1;
38 static const int ID_ITEM_DEVELOPER_MAIN_USB_DEBUGGING = 0;
39
40 static const int ID_GROUP_DEVELOPER_CPU = 1;
41 static const int ID_GROUP_DEVELOPER_CPU_ITEM_COUNT = 1;
42 static const int ID_ITEM_DEVELOPER_CPU_USAGE = 0;
43
44 static const int ID_GROUP_DEVELOPER_CPU_RENDERING = 2;
45 static const int ID_GROUP_DEVELOPER_CPU_RENDERING_ITEM_COUNT = 1;
46 static const int ID_ITEM_DEVELOPER_CPU_RENDERING = 0;
47
48 static const int ID_GROUP_DEVELOPER_LIMIT_PROCESS = 3;
49 static const int ID_GROUP_DEVELOPER_LIMIT_PROCESS_ITEM_COUNT = 1;
50 static const int ID_ITEM_DEVELOPER_LIMIT_PROCESS = 0;
51
52 static const int IDA_USB_DEBUGGING_POPUP_OK = 100;
53 static const int IDA_USB_DEBUGGING_POPUP_CANCEL = 200;
54
55 static const int ID_GROUP_COUNT = 2;
56 static const int ID_GROUP_MAX_ITEM_COUNT = ID_GROUP_DEVELOPER_LIMIT_PROCESS_ITEM_COUNT;
57 static const int H_HELP_TEXT_GAP = 3;
58 static const int W_RESIZE_LABEL_GAP = 170;
59
60 static const int Y_ALERT_POPUP_CLIENT_RECT_DEFAULT = 160;
61 static const int Y_ALERT_POPUP_ITEM_RECT_LABEL_DEFAULT = 20;
62 static const int H_ALERT_POPUP_ITEM_RECT_LABEL_DEFAULT = 340;
63 static const int W_ALERT_POPUP_ITEM_RECT_LABEL_DEFAULT = 690;
64 static const int X_ALERT_POPUP_ITEM_RECT_LHS_BUTTON_DEFAULT = 12;
65 static const int Y_ALERT_POPUP_ITEM_RECT_LHS_BUTTON_DEFAULT = 360;
66 static const int W_ALERT_POPUP_ITEM_RECT_LHS_BUTTON_DEFAULT = 310;
67 static const int H_ALERT_POPUP_ITEM_RECT_LHS_BUTTON_DEFAULT = 80;
68 static const int X_ALERT_POPUP_ITEM_RECT_RHS_BUTTON_RESIZE = 20;
69 static const int ALERT_POPUP_LABEL_FONT_SIZE = 40;
70
71 static const int W_ALERT_POPUP_CLIENT_RECT_DEFAULT = 700;
72 static const int H_ALERT_POPUP_CLIENT_RECT_DEFAULT = 550;
73 static const int RELATIVE_LAYOUT_RIGHT_MARGIN_ONOFF_SLIDING = 230;
74
75 DeveloperOptionForm::DeveloperOptionForm(void)
76         : __isAppControlRequest(false)
77         , __usbDebuggingPopup(null)
78 {
79 }
80
81 DeveloperOptionForm::~DeveloperOptionForm(void)
82 {
83 }
84
85 void
86 DeveloperOptionForm::CreateFooter(void)
87 {
88         Footer* pFooter = GetFooter();
89         AppAssert(pFooter);
90
91         pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
92         pFooter->SetBackButton();
93         pFooter->AddActionEventListener(*this);
94
95         SetFormBackEventListener(this);
96 }
97
98 result
99 DeveloperOptionForm::OnInitializing(void)
100 {
101         CreateHeader(ResourceManager::GetString(L"IDS_ST_BODY_DEVELOPER_OPTIONS"));
102         CreateFooter();
103         CreateTableView();
104         AppLogDebug("ENTER");
105
106         return E_SUCCESS;
107 }
108
109 result
110 DeveloperOptionForm::OnTerminating(void)
111 {
112         delete __usbDebuggingPopup;
113         __usbDebuggingPopup = null;
114         __pTableView = null;
115
116         SetFormBackEventListener(null);
117         return E_SUCCESS;
118 }
119
120 void
121 DeveloperOptionForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
122 {
123         bool usbStatus= false;
124
125         if (pArgs != null)
126         {
127                 String categoryCheck = static_cast<String*>(pArgs->GetAt(0))->GetPointer();
128
129                 if (categoryCheck == L"category:USB")
130                 {
131                         __isAppControlRequest = true;
132                 }
133                 delete pArgs;
134         }
135         __pTableView->UpdateTableView();
136
137         if (SettingInfo::GetValue(SETTING_INFO_KEY_USB_DEBUGGING, usbStatus) == E_SUCCESS)
138         {
139                 __pTableView->SetItemChecked(ID_GROUP_DEVELOPER_MAIN, ID_ITEM_DEVELOPER_MAIN_USB_DEBUGGING, usbStatus);
140         }
141         AppLogDebug("result Read usbDebugging [%s] value[%d]", GetErrorMessage(GetLastResult()), usbStatus);
142 }
143
144 void
145 DeveloperOptionForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
146 {
147 }
148
149 void
150 DeveloperOptionForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
151 {
152         SceneManager* pSceneManager = SceneManager::GetInstance();
153         AppAssert(pSceneManager);
154
155         if (__isAppControlRequest == true)
156         {
157                 UiApp* pApp = UiApp::GetInstance();
158                 AppAssert(pApp);
159                 pApp->Terminate();
160         }
161         else
162         {
163                 pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
164         }
165 }
166
167 int
168 DeveloperOptionForm::GetGroupCount(void)
169 {
170         AppLogDebug("ENTER");
171         return ID_GROUP_COUNT;
172 }
173
174 int
175 DeveloperOptionForm::GetItemCount(int groupIndex)
176 {
177         int itemCount = 0;
178
179         switch (groupIndex)
180         {
181         case ID_GROUP_DEVELOPER_MAIN:
182                 {
183                         itemCount = ID_GROUP_MAX_ITEM_COUNT;
184                 }
185                 break;
186
187         default:
188                 break;
189         }
190
191         AppLogDebug("GetItemCount %d", itemCount);
192         return itemCount;
193 }
194
195 TableViewGroupItem*
196 DeveloperOptionForm::CreateGroupItem(int groupIndex, int itemWidth)
197 {
198         AppLogDebug("ENTER");
199
200         int itemHeight = H_GROUP_INDEX_NO_TITLE_DEFAULT;
201         int yItemOffset = H_GROUP_INDEX_HELP_TEXT_TOP_GAP;
202         LabelTextStyle style = LABEL_TEXT_STYLE_BOLD;
203         Rectangle itemRectangle;
204         String groupText;
205         Label* pLabel = null;
206         int fontSize = GetFontSize();
207
208         TableViewGroupItem* pItem = new (std::nothrow) TableViewGroupItem();
209
210         switch (groupIndex)
211         {
212         case ID_GROUP_DEVELOPER_MAIN:
213                 {
214                         yItemOffset = Y_GROUP_INDEX_DEFAULT;
215                         itemHeight = H_GROUP_INDEX_NO_TITLE_DEFAULT;
216                 }
217                 break;
218
219         case ID_GROUP_DEVELOPER_CPU:
220                 {
221                         style = LABEL_TEXT_STYLE_NORMAL;
222                         yItemOffset = H_GROUP_INDEX_HELP_TEXT_TOP_GAP;
223                         itemHeight = (((fontSize * H_HELP_TEXT_GAP) * LINE_COUNT_2) + H_GROUP_INDEX_NO_TITLE_TEXT_GAP);
224
225                         groupText = ResourceManager::GetString(L"IDS_ST_BODY_DEBUGGING_MODE_LAUNCHES_WHEN_USB_IS_CONNECTED");
226                 }
227                 break;
228
229         case ID_GROUP_DEVELOPER_CPU_RENDERING:
230                 {
231                         style = LABEL_TEXT_STYLE_NORMAL;
232                         yItemOffset = H_GROUP_INDEX_HELP_TEXT_TOP_GAP;
233                         itemHeight = ((H_GROUP_INDEX_HELP_TEXT * LINE_COUNT_2) + H_GROUP_INDEX_NO_TITLE_TEXT_GAP);
234                 }
235                 break;
236
237         case ID_GROUP_DEVELOPER_LIMIT_PROCESS:
238                 {
239                         style = LABEL_TEXT_STYLE_NORMAL;
240                         yItemOffset = H_GROUP_INDEX_HELP_TEXT_TOP_GAP;
241                         itemHeight = ((H_GROUP_INDEX_HELP_TEXT * LINE_COUNT_2) + H_GROUP_INDEX_NO_TITLE_TEXT_GAP);
242                 }
243                 break;
244
245         default:
246                 {
247                         yItemOffset = Y_GROUP_INDEX_DEFAULT;
248                         itemHeight = H_GROUP_INDEX_NO_TITLE_DEFAULT;
249                 }
250                 break;
251         }
252
253         itemRectangle.x = X_GROUP_INDEX_DEFAULT_LABEL;
254         itemRectangle.y = yItemOffset;
255         itemRectangle.width = itemWidth;
256         itemRectangle.height = itemHeight;
257
258         RelativeLayout relativeLayout;
259         relativeLayout.Construct();
260
261         pItem->Construct(relativeLayout, Dimension(itemWidth, itemHeight));
262         pItem->SetBackgroundColor(COLOR_BG_GROUP_INDEX_DEFAULT);
263
264         pLabel = new (std::nothrow) Label();
265         pLabel->Construct(itemRectangle, groupText);
266         pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
267         pLabel->SetTextVerticalAlignment(ALIGNMENT_TOP);
268         pLabel->SetTextConfig(fontSize, style);
269         pLabel->SetTextColor(COLOR_HELP_TEXT_TYPE_01);
270
271         pItem->AddControl(*pLabel);
272         relativeLayout.SetMargin(*pLabel, 0, 0, 0, 0);
273         relativeLayout.SetRelation(*pLabel, *pItem, RECT_EDGE_RELATION_LEFT_TO_LEFT);
274         relativeLayout.SetRelation(*pLabel, *pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
275         pItem->SetEnabled(false);
276
277         return pItem;
278 }
279
280 TableViewItem*
281 DeveloperOptionForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
282 {
283         AppLogDebug("group[%d] index[%d]", groupIndex, itemIndex);
284
285         TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING;
286         Rectangle itemRectangle;
287         String itemText;
288         Label* pLabel = null;
289         int fontSize = GetFontSize();
290
291         TableViewItem* pItem = new (std::nothrow) TableViewItem();
292
293         ItemTypeOneLine(itemRectangle);
294
295         if (groupIndex == ID_GROUP_DEVELOPER_MAIN)
296         {
297                 itemText = ResourceManager::GetString(L"IDS_ST_BODY_USB_DEBUGGING");
298                 itemRectangle.width -= W_RESIZE_LABEL_GAP;
299         }
300
301         RelativeLayout relativeLayout;
302         relativeLayout.Construct();
303
304         pItem->Construct(relativeLayout, Dimension(itemWidth, H_GROUP_ITEM_DEFAULT), style);
305         pItem->SetBackgroundColor(COLOR_BG_GROUP_ITEM_DEFAULT);
306
307         pLabel = new (std::nothrow) Label();
308         pLabel->Construct(itemRectangle, itemText);
309         pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
310         pLabel->SetTextConfig(fontSize, LABEL_TEXT_STYLE_BOLD);
311         pLabel->SetTextColor(COLOR_MAIN_TEXT);
312
313         pItem->AddControl(*pLabel);
314         relativeLayout.SetMargin(*pLabel, itemRectangle.x, RELATIVE_LAYOUT_RIGHT_MARGIN_ONOFF_SLIDING, 0, 0);
315         relativeLayout.SetRelation(*pLabel, *pItem, RECT_EDGE_RELATION_LEFT_TO_LEFT);
316         relativeLayout.SetRelation(*pLabel, *pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
317
318         return pItem;
319 }
320
321 bool
322 DeveloperOptionForm::DeleteGroupItem(int groupIndex, TableViewGroupItem* pItem)
323 {
324         AppLogDebug("ENTER");
325
326         delete pItem;
327         pItem = null;   
328
329         return true;
330 }
331
332 bool
333 DeveloperOptionForm::DeleteItem(int groupIndex, int itemIndex, TableViewItem* pItem)
334 {
335         AppLogDebug("ENTER");
336
337         delete pItem;
338         pItem = null;
339
340         return true;
341 }
342
343 void
344 DeveloperOptionForm::OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
345 {
346         SceneManager* pSceneManager = SceneManager::GetInstance();
347         AppAssert(pSceneManager);
348
349         bool itemSelectStatus = tableView.IsItemChecked(groupIndex, itemIndex);
350
351         AppLogDebug("group[%d] index[%d]", groupIndex, itemIndex);
352
353         switch (groupIndex)
354         {
355         case ID_GROUP_DEVELOPER_MAIN:
356                 {
357                         if (itemIndex == ID_ITEM_DEVELOPER_MAIN_USB_DEBUGGING)
358                         {
359                                 if (status == TABLE_VIEW_ITEM_STATUS_SELECTED)
360                                 {
361                                         itemSelectStatus = !itemSelectStatus;
362                                 }
363
364                                 if (itemSelectStatus == true)
365                                 {
366                                         status = TABLE_VIEW_ITEM_STATUS_UNCHECKED;
367                                         tableView.SetItemChecked(groupIndex, itemIndex, false);
368                                         CreateAlertPopup();
369                                         ShowAlertPopup();
370                                 }
371                                 else
372                                 {
373                                         bool usbStatus = false;
374                                         if (SettingInfo::SetValue(SETTING_INFO_KEY_USB_DEBUGGING, usbStatus) == E_SUCCESS)
375                                         {
376                                                 __pTableView->SetItemChecked(ID_GROUP_DEVELOPER_MAIN, ID_ITEM_DEVELOPER_MAIN_USB_DEBUGGING, usbStatus);
377                                         }
378                                         else
379                                         {
380                                                 __pTableView->SetItemChecked(ID_GROUP_DEVELOPER_MAIN, ID_ITEM_DEVELOPER_MAIN_USB_DEBUGGING, true);
381                                                 ShowMessageBox(ResourceManager::GetString(L"IDS_EMAIL_POP_ALERT"), ResourceManager::GetString(L"IDS_ST_POP_NOT_SUPPORTED"));
382                                         }
383                                 }
384                         }
385                 }
386                 break;
387
388         case ID_GROUP_DEVELOPER_CPU:
389                 {
390                         if (itemIndex == ID_ITEM_DEVELOPER_CPU_USAGE)
391                         {
392                                 // TODO: Show CPU usage on/off.
393                         }
394                 }
395                 break;
396
397         case ID_GROUP_DEVELOPER_CPU_RENDERING:
398                 {
399                         if (itemIndex == ID_ITEM_DEVELOPER_CPU_RENDERING)
400                         {
401                                 // TODO: Show CPU rendering on/off
402                         }
403                 }
404                 break;
405
406         case ID_GROUP_DEVELOPER_LIMIT_PROCESS:
407                 {
408                         if (itemIndex == ID_ITEM_DEVELOPER_LIMIT_PROCESS)
409                         {
410                                 // TODO: Limit background process.
411                         }
412                 }
413                 break;
414
415         default:
416                 break;
417         }
418 }
419
420 int
421 DeveloperOptionForm::GetDefaultGroupItemHeight(void)
422 {
423         return H_GROUP_INDEX_NO_TITLE_DEFAULT;
424 }
425
426 int
427 DeveloperOptionForm::GetDefaultItemHeight(void)
428 {
429         return H_GROUP_ITEM_DEFAULT;
430 }
431
432 void
433 DeveloperOptionForm::UpdateGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem)
434 {
435 }
436
437 void
438 DeveloperOptionForm::UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem)
439 {
440 }
441
442 void
443 DeveloperOptionForm::OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated)
444 {
445 }
446
447 void
448 DeveloperOptionForm::OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
449 {
450 }
451
452 result
453 DeveloperOptionForm::CreateAlertPopup(void)
454 {
455         String buttonText;
456         Label* pLabel = null;
457         Button* pLhsButton = null;
458         Button* pRhslButton = null;
459
460         Rectangle clientRect = GetClientAreaBounds();
461         Rectangle itemRectLabel;
462         Rectangle itemRectLhsButton;
463         Rectangle itemRectRhsButton;
464
465         clientRect.x = 0;
466         clientRect.y = Y_ALERT_POPUP_CLIENT_RECT_DEFAULT;
467         clientRect.width = W_ALERT_POPUP_CLIENT_RECT_DEFAULT;
468         clientRect.height = H_ALERT_POPUP_CLIENT_RECT_DEFAULT;
469
470         itemRectLabel.x = 0;
471         itemRectLabel.y = Y_ALERT_POPUP_ITEM_RECT_LABEL_DEFAULT;
472         itemRectLabel.width = W_ALERT_POPUP_ITEM_RECT_LABEL_DEFAULT;
473         itemRectLabel.height = H_ALERT_POPUP_ITEM_RECT_LABEL_DEFAULT;
474
475         itemRectLhsButton.x = X_ALERT_POPUP_ITEM_RECT_LHS_BUTTON_DEFAULT;
476         itemRectLhsButton.y = Y_ALERT_POPUP_ITEM_RECT_LHS_BUTTON_DEFAULT;
477         itemRectLhsButton.width = W_ALERT_POPUP_ITEM_RECT_LHS_BUTTON_DEFAULT;
478         itemRectLhsButton.height = H_ALERT_POPUP_ITEM_RECT_LHS_BUTTON_DEFAULT;
479
480         itemRectRhsButton = itemRectLhsButton;
481         itemRectRhsButton.x = itemRectLhsButton.x + itemRectLhsButton.width + X_ALERT_POPUP_ITEM_RECT_RHS_BUTTON_RESIZE;
482
483         Dimension bounds = Dimension(clientRect.width, clientRect.height);
484
485         __usbDebuggingPopup = new (std::nothrow) Popup();
486         __usbDebuggingPopup->Construct(true, bounds);
487         __usbDebuggingPopup->SetTitleText(ResourceManager::GetString(L"IDS_ST_HEADER_ALLOW_USB_DEBUGGING_Q_ABB"));
488         __usbDebuggingPopup->SetTitleTextColor(COLOR_SUB_TEXT);
489
490         pLabel = new (std::nothrow) Label();
491         pLabel->Construct(itemRectLabel, ResourceManager::GetString(L"IDS_ST_BODY_USB_DEBUGGING_IS_INTENDED_FOR_DEVELOPMENT_PURPOSES_ONLY_MSG"));
492         pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
493         pLabel->SetTextVerticalAlignment(ALIGNMENT_TOP);
494         pLabel->SetTextConfig(ALERT_POPUP_LABEL_FONT_SIZE, LABEL_TEXT_STYLE_BOLD);
495
496         __usbDebuggingPopup->AddControl(*pLabel);
497
498         buttonText = ResourceManager::GetString(L"IDS_ST_BUTTON_OK");
499         pLhsButton = new (std::nothrow) Button();
500         pLhsButton->Construct(itemRectLhsButton, buttonText);
501         pLhsButton->SetActionId(IDA_USB_DEBUGGING_POPUP_OK);
502
503         __usbDebuggingPopup->AddControl(*pLhsButton);
504
505         buttonText = ResourceManager::GetString(L"IDS_ST_BODY_CANCEL");
506
507         pRhslButton = new (std::nothrow) Button();
508         pRhslButton->Construct(itemRectRhsButton, buttonText);
509         pRhslButton->SetActionId(IDA_USB_DEBUGGING_POPUP_CANCEL);
510
511         __usbDebuggingPopup->AddControl(*pRhslButton);
512
513         pLhsButton->AddActionEventListener(*this);
514         pRhslButton->AddActionEventListener(*this);
515
516         return E_SUCCESS;
517 }
518
519 void
520 DeveloperOptionForm::ShowAlertPopup(void)
521 {
522         __usbDebuggingPopup->SetShowState(true);
523         __usbDebuggingPopup->Show();
524 }
525
526 void
527 DeveloperOptionForm::HideAlertPopup(void)
528 {
529         __usbDebuggingPopup->SetShowState(false);
530         __usbDebuggingPopup->Invalidate(true);
531 }
532
533 void
534 DeveloperOptionForm::OnActionPerformed(const Control& source, int actionId)
535 {
536         result r = E_FAILURE;
537
538         switch (actionId)
539         {
540         case IDA_USB_DEBUGGING_POPUP_OK:
541                 {
542                         r = SettingInfo::SetValueForPrivilegedKey(SETTING_INFO_KEY_USB_DEBUGGING, true);
543
544                         switch (r)
545                         {
546                         case E_UNSUPPORTED_OPERATION:
547                                 {
548                                         HideAlertPopup();
549                                         ShowMessageBox(ResourceManager::GetString(L"IDS_EMAIL_POP_ALERT"), ResourceManager::GetString(L"IDS_ST_POP_NOT_SUPPORTED"));
550                                 }
551                                 break;
552
553                         case E_SUCCESS:
554                                 {
555                                         __pTableView->SetItemChecked(ID_GROUP_DEVELOPER_MAIN, ID_ITEM_DEVELOPER_MAIN_USB_DEBUGGING, true);
556                                         HideAlertPopup();
557                                 }
558                                 break;
559
560                         default:
561                                 break;
562                         }
563                         AppLogDebug("Set UsbDebugging result [%s] ", GetErrorMessage(r));
564
565                 }
566                 break;
567
568         case IDA_USB_DEBUGGING_POPUP_CANCEL:
569                 {
570                         HideAlertPopup();
571                 }
572                 break;
573
574         default:
575                 break;
576         }
577         __pTableView->UpdateTableView();
578 }