36 // ----------------------------------------------------------------------------- |
36 // ----------------------------------------------------------------------------- |
37 // NewL |
37 // NewL |
38 // ----------------------------------------------------------------------------- |
38 // ----------------------------------------------------------------------------- |
39 // |
39 // |
40 EXPORT_C CGlxCommandHandlerAiwEdit* CGlxCommandHandlerAiwEdit::NewL( |
40 EXPORT_C CGlxCommandHandlerAiwEdit* CGlxCommandHandlerAiwEdit::NewL( |
41 MGlxMediaListProvider* aMediaListProvider, TInt aMenuResource) |
41 MGlxMediaListProvider* aMediaListProvider, TInt aMenuResource, |
|
42 TBool aCommandSingleClick) |
42 { |
43 { |
43 CGlxCommandHandlerAiwEdit* self = new ( ELeave ) |
44 CGlxCommandHandlerAiwEdit* self = new ( ELeave ) |
44 CGlxCommandHandlerAiwEdit(aMediaListProvider, aMenuResource); |
45 CGlxCommandHandlerAiwEdit(aMediaListProvider, aMenuResource); |
45 CleanupStack::PushL( self ); |
46 CleanupStack::PushL( self ); |
46 self->ConstructL(); |
47 self->ConstructL(aCommandSingleClick); |
47 CleanupStack::Pop( self ); |
48 CleanupStack::Pop( self ); |
48 return self; |
49 return self; |
|
50 } |
|
51 |
|
52 // --------------------------------------------------------------------------- |
|
53 // Symbian 2nd phase constructor can leave. |
|
54 // --------------------------------------------------------------------------- |
|
55 // |
|
56 void CGlxCommandHandlerAiwEdit::ConstructL(TBool aCommandSingleClick) |
|
57 { |
|
58 TRACER("CGlxCommandHandlerAiwEdit::ConstructL"); |
|
59 CGlxCommandHandlerAiwBase::ConstructL(); |
|
60 iCommandSingleClick = aCommandSingleClick; |
49 } |
61 } |
50 |
62 |
51 // ----------------------------------------------------------------------------- |
63 // ----------------------------------------------------------------------------- |
52 // CGlxCommandHandlerAiwEdit::DoGetRequiredAttributesL |
64 // CGlxCommandHandlerAiwEdit::DoGetRequiredAttributesL |
53 // ----------------------------------------------------------------------------- |
65 // ----------------------------------------------------------------------------- |
77 // CommandId |
89 // CommandId |
78 // ----------------------------------------------------------------------------- |
90 // ----------------------------------------------------------------------------- |
79 // |
91 // |
80 TInt CGlxCommandHandlerAiwEdit::CommandId() const |
92 TInt CGlxCommandHandlerAiwEdit::CommandId() const |
81 { |
93 { |
|
94 if (iCommandSingleClick) |
|
95 { |
|
96 return EGlxCmdAiwSingleClickEdit; |
|
97 } |
82 return EGlxCmdAiwEdit; |
98 return EGlxCmdAiwEdit; |
83 } |
99 } |
84 |
100 |
85 // ----------------------------------------------------------------------------- |
101 // ----------------------------------------------------------------------------- |
86 // AiwCommandId |
102 // AiwCommandId |
95 // AiwInterestResource |
111 // AiwInterestResource |
96 // ----------------------------------------------------------------------------- |
112 // ----------------------------------------------------------------------------- |
97 // |
113 // |
98 TInt CGlxCommandHandlerAiwEdit::AiwInterestResource() const |
114 TInt CGlxCommandHandlerAiwEdit::AiwInterestResource() const |
99 { |
115 { |
|
116 if (iCommandSingleClick) |
|
117 { |
|
118 return R_GLX_AIW_SINGLE_CLICK_EDIT_INTEREST; |
|
119 } |
100 return R_GLX_AIW_EDIT_INTEREST; |
120 return R_GLX_AIW_EDIT_INTEREST; |
101 } |
121 } |
102 |
122 |
103 // ----------------------------------------------------------------------------- |
123 // ----------------------------------------------------------------------------- |
104 // AppendAiwParameterL |
124 // AppendAiwParameterL |
132 { |
152 { |
133 TRACER("CGlxCommandHandlerAiwEdit::AiwDoDynInitMenuPaneL()"); |
153 TRACER("CGlxCommandHandlerAiwEdit::AiwDoDynInitMenuPaneL()"); |
134 HBufC* currentTitle = StringLoader::LoadLC( R_QTN_LGAL_OPTIONS_EDIT ); |
154 HBufC* currentTitle = StringLoader::LoadLC( R_QTN_LGAL_OPTIONS_EDIT ); |
135 TInt cmdId = AiwMenuCmdIdL( *currentTitle,aMenuPane ) ; |
155 TInt cmdId = AiwMenuCmdIdL( *currentTitle,aMenuPane ) ; |
136 CleanupStack::PopAndDestroy(currentTitle); |
156 CleanupStack::PopAndDestroy(currentTitle); |
137 if( KErrNotFound != cmdId ) |
157 |
|
158 if (KErrNotFound != cmdId) |
138 { |
159 { |
139 if ((MediaList().SelectionCount() > 1)) |
160 if (iCommandSingleClick && (MediaList().SelectionCount() > 1)) |
140 { |
161 { |
141 aMenuPane->SetItemDimmed(cmdId,ETrue); |
162 aMenuPane->SetItemDimmed(cmdId,ETrue); |
142 } |
163 } |
|
164 else if ( MediaList().SelectionCount() != 1) |
|
165 { |
|
166 // Enable ONLY when a single item marked |
|
167 aMenuPane->SetItemDimmed(cmdId,ETrue); |
|
168 } |
143 } |
169 } |
144 } |
170 } |