|
1 /* |
|
2 * Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 using System; |
|
19 using System.Text; |
|
20 using System.IO; |
|
21 using System.Collections.Generic; |
|
22 using System.Threading; |
|
23 using System.Windows.Forms; |
|
24 using CrashAnalyserEngine.Plugins; |
|
25 using CrashItemLib.Engine; |
|
26 using CrashItemLib.Engine.Interfaces; |
|
27 using CrashItemLib.Crash; |
|
28 using CrashItemLib.Crash.Container; |
|
29 using CrashItemLib.PluginAPI; |
|
30 using CrashAnalyserEngine.Engine; |
|
31 using CrashAnalyserEngine.Interfaces; |
|
32 using CAPluginCrashAnalysisUi.Wizards; |
|
33 using CAPluginCrashAnalysisUi.Tabs; |
|
34 using CAPCrashAnalysis.Plugin; |
|
35 using SymbianUtils; |
|
36 |
|
37 namespace CAPluginCrashAnalysisUi.Plugin |
|
38 { |
|
39 public class CAPluginCrashAnalysisUi : CAPluginCrashAnalysis |
|
40 { |
|
41 #region Constructors |
|
42 public CAPluginCrashAnalysisUi( CAEngine aEngine ) |
|
43 : base( aEngine ) |
|
44 { |
|
45 // Switch debug engine to UI mode |
|
46 aEngine.DebugEngine.UiMode = SymbianDebugLib.TDbgUiMode.EUiEnabled; |
|
47 RegisterMenuItems(); |
|
48 } |
|
49 #endregion |
|
50 |
|
51 #region API |
|
52 #endregion |
|
53 |
|
54 #region From CAPlugin |
|
55 public override CAPlugin.TType Type |
|
56 { |
|
57 get { return CAPlugin.TType.ETypeUi; } |
|
58 } |
|
59 #endregion |
|
60 |
|
61 #region Properties |
|
62 #endregion |
|
63 |
|
64 #region Event handlers |
|
65 private void Menu_File_New_CrashAnalyser_Click( object aTag, string aCaption ) |
|
66 { |
|
67 CAWizardCrashAnalysis wizard = new CAWizardCrashAnalysis( this ); |
|
68 DialogResult result = wizard.ShowDialog(); |
|
69 if ( result == DialogResult.OK ) |
|
70 { |
|
71 // Wizard was closed without error so prepare main summary form |
|
72 // and register with UI. Only show the summary form if we have |
|
73 // multiple crash items, otherwise just show the container explorer. |
|
74 int count = CrashItemEngine.Count; |
|
75 if ( count > 1 ) |
|
76 { |
|
77 CATabCrashContainerSummary control = new CATabCrashContainerSummary( this ); |
|
78 base.UIManager.UIManagerContentAdd( control ); |
|
79 } |
|
80 else if ( count == 1 ) |
|
81 { |
|
82 CIContainer container = (CIContainer) CrashItemEngine[ 0 ]; |
|
83 // |
|
84 CATabCrashContainerExplorer control = new CATabCrashContainerExplorer( this, container ); |
|
85 base.UIManager.UIManagerContentAdd( control ); |
|
86 } |
|
87 } |
|
88 } |
|
89 #endregion |
|
90 |
|
91 #region Internal constants |
|
92 #endregion |
|
93 |
|
94 #region Internal methods |
|
95 private void RegisterMenuItems() |
|
96 { |
|
97 // Register "new" menu item |
|
98 base.UIManager.UIManagerMenuItemAdd( TEngineUIMenuPane.EFileNew, base.Name, new UIMenuItemClickHandler( Menu_File_New_CrashAnalyser_Click ), null ); |
|
99 } |
|
100 #endregion |
|
101 |
|
102 #region Data members |
|
103 #endregion |
|
104 } |
|
105 } |