|
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.Collections.Generic; |
|
20 using System.ComponentModel; |
|
21 using System.Data; |
|
22 using System.Text; |
|
23 using System.Windows.Forms; |
|
24 using CAPluginNICD.Plugin; |
|
25 |
|
26 namespace CAPluginNICDUi.Wizards |
|
27 { |
|
28 internal partial class CAWizardNICD : Form |
|
29 { |
|
30 #region Constructors |
|
31 public CAWizardNICD( CAPluginNICD.Plugin.CAPluginNICD aPlugin ) |
|
32 { |
|
33 iPlugin = aPlugin; |
|
34 // |
|
35 InitializeComponent(); |
|
36 } |
|
37 #endregion |
|
38 |
|
39 #region Properties |
|
40 #endregion |
|
41 |
|
42 #region Events |
|
43 private void iWizard_WizardClosedFromFinish( SymbianWizardLib.Engine.SymWizardClosureEvent aEventArgs ) |
|
44 { |
|
45 string errorText = string.Empty; |
|
46 bool isReady = iPG_DebugEngine_Control.IsReadyToPrime( out errorText ); |
|
47 if ( isReady ) |
|
48 { |
|
49 // Prime debug engine |
|
50 iPG_DebugEngine_Control.Prime(); |
|
51 |
|
52 // Store the settings at this point as we are largely past the |
|
53 // initial configuration |
|
54 iPlugin.Settings.Store(); |
|
55 |
|
56 // Also save debug engine configuration |
|
57 iPG_DebugEngine_Control.XmlSettingsSave(); |
|
58 |
|
59 // Read NICD trace file |
|
60 string fileName = iFB_NICD_Trace.EntityName; |
|
61 CrashDebuggerUiLib.Dialogs.ParserProgressDialog.Read( iPlugin.CrashDebuggerInfo, fileName ); |
|
62 |
|
63 DialogResult = DialogResult.OK; |
|
64 } |
|
65 else |
|
66 { |
|
67 MessageBox.Show( errorText, "Error" ); |
|
68 aEventArgs.CancelClosure = true; |
|
69 } |
|
70 } |
|
71 #endregion |
|
72 |
|
73 #region Page - source files |
|
74 private void iPG_SourceFile_Load( object sender, EventArgs e ) |
|
75 { |
|
76 iPlugin.Settings.Load( this.Name, iFB_NICD_Trace ); |
|
77 } |
|
78 |
|
79 private void iPG_SourceFile_PageClosedFromButtonNext( SymbianWizardLib.Engine.SymWizardPageTransitionEvent aEventArgs ) |
|
80 { |
|
81 if ( iFB_NICD_Trace.IsValid ) |
|
82 { |
|
83 iPlugin.Settings.Save( this.Name, iFB_NICD_Trace ); |
|
84 } |
|
85 else |
|
86 { |
|
87 // Don't let a page transition occur if a valid file is not entered |
|
88 aEventArgs.SuggestedNewPage = aEventArgs.CurrentPage; |
|
89 } |
|
90 } |
|
91 #endregion |
|
92 |
|
93 #region Page - debug engine |
|
94 private void iPG_DebugEngine_Load( object aSender, EventArgs aArgs ) |
|
95 { |
|
96 iPG_DebugEngine_Control.Engine = iPlugin.DebugEngine; |
|
97 } |
|
98 |
|
99 private void iPG_DebugEngine_PageClosedFromButtonNext( SymbianWizardLib.Engine.SymWizardPageTransitionEvent aEventArgs ) |
|
100 { |
|
101 string errorText = string.Empty; |
|
102 bool isReady = iPG_DebugEngine_Control.IsReadyToPrime( out errorText ); |
|
103 if ( isReady == false ) |
|
104 { |
|
105 MessageBox.Show( errorText, "Error" ); |
|
106 aEventArgs.SuggestedNewPage = aEventArgs.CurrentPage; |
|
107 } |
|
108 } |
|
109 #endregion |
|
110 |
|
111 #region Internal methods |
|
112 #endregion |
|
113 |
|
114 #region Data members |
|
115 private readonly CAPluginNICD.Plugin.CAPluginNICD iPlugin; |
|
116 #endregion |
|
117 } |
|
118 } |