58 // ~CGlxCommandHandlerAiwEdit |
58 // ~CGlxCommandHandlerAiwEdit |
59 // ----------------------------------------------------------------------------- |
59 // ----------------------------------------------------------------------------- |
60 // |
60 // |
61 EXPORT_C CGlxCommandHandlerAiwEdit::~CGlxCommandHandlerAiwEdit() |
61 EXPORT_C CGlxCommandHandlerAiwEdit::~CGlxCommandHandlerAiwEdit() |
62 { |
62 { |
63 delete iFeatManager; |
|
64 delete iServiceHandler; |
63 delete iServiceHandler; |
65 |
64 |
66 if (NULL != iImageViewerInstance) |
65 if (NULL != iImageViewerInstance) |
67 { |
66 { |
68 iImageViewerInstance->DeleteInstance(); |
67 iImageViewerInstance->DeleteInstance(); |
73 // ConstructL |
72 // ConstructL |
74 // ----------------------------------------------------------------------------- |
73 // ----------------------------------------------------------------------------- |
75 // |
74 // |
76 void CGlxCommandHandlerAiwEdit::ConstructL() |
75 void CGlxCommandHandlerAiwEdit::ConstructL() |
77 { |
76 { |
78 TRAP_IGNORE( |
77 CFeatureDiscovery* featManager = CFeatureDiscovery::NewL(); |
79 { |
78 CleanupStack::PushL(featManager); |
80 iServiceHandler = CAiwServiceHandler::NewL(); |
79 |
81 iServiceHandler->AttachL( R_GLX_AIW_EDIT_INTEREST ); |
80 if(featManager->IsFeatureSupportedL(KFeatureIdFfImageEditor) |
82 iEditSupported = ETrue; |
81 && featManager->IsFeatureSupportedL(KFeatureIdFfVideoEditor)) |
83 }); |
82 { |
|
83 TRAP_IGNORE( |
|
84 { |
|
85 iServiceHandler = CAiwServiceHandler::NewL(); |
|
86 iServiceHandler->AttachL( R_GLX_AIW_EDIT_INTEREST ); |
|
87 iEditSupported = ETrue; |
|
88 }); |
|
89 } |
|
90 CleanupStack::PopAndDestroy(featManager); |
84 |
91 |
85 if (iCommandSingleClick) |
92 if (iCommandSingleClick) |
86 { |
93 { |
87 TCommandInfo info(EGlxCmdAiwSingleClickEdit); |
94 TCommandInfo info(EGlxCmdAiwSingleClickEdit); |
88 AddCommandL(info); |
95 AddCommandL(info); |
91 { |
98 { |
92 TCommandInfo info(EGlxCmdAiwEdit); |
99 TCommandInfo info(EGlxCmdAiwEdit); |
93 AddCommandL(info); |
100 AddCommandL(info); |
94 } |
101 } |
95 |
102 |
96 iImageViewerInstance = CGlxImageViewerManager::InstanceL(); |
103 iImageViewerInstance = CGlxImageViewerManager::InstanceL(); |
97 iFeatManager = CFeatureDiscovery::NewL(); |
104 |
|
105 iIsFullScreenMode = IsInFullScreenViewingModeL(); |
98 } |
106 } |
99 |
107 |
100 // ----------------------------------------------------------------------------- |
108 // ----------------------------------------------------------------------------- |
101 // CGlxCommandHandlerAiwEdit |
109 // CGlxCommandHandlerAiwEdit |
102 // ----------------------------------------------------------------------------- |
110 // ----------------------------------------------------------------------------- |
121 // ----------------------------------------------------------------------------- |
129 // ----------------------------------------------------------------------------- |
122 // DynInitMenuPaneL |
130 // DynInitMenuPaneL |
123 // ----------------------------------------------------------------------------- |
131 // ----------------------------------------------------------------------------- |
124 // |
132 // |
125 void CGlxCommandHandlerAiwEdit::DynInitMenuPaneL(TInt /*aResourceId*/, |
133 void CGlxCommandHandlerAiwEdit::DynInitMenuPaneL(TInt /*aResourceId*/, |
126 CEikMenuPane* aMenuPane) |
134 CEikMenuPane* aMenuPane, TBool /*aIsBrowseMode*/) |
127 { |
135 { |
128 MGlxMediaList& mediaList = MediaList(); |
|
129 TInt pos; |
|
130 |
136 |
131 if (aMenuPane) |
137 if (aMenuPane) |
132 { |
138 { |
|
139 MGlxMediaList& mediaList = MediaList(); |
|
140 TInt pos; |
133 //If stylus menu is present, hide it for multiple selection |
141 //If stylus menu is present, hide it for multiple selection |
134 if (iCommandSingleClick && aMenuPane->MenuItemExists( |
142 if (iCommandSingleClick && aMenuPane->MenuItemExists( |
135 EGlxCmdAiwSingleClickEdit, pos) |
143 EGlxCmdAiwSingleClickEdit, pos) |
136 |
144 |
137 && (((!mediaList.Count()) || (mediaList.SelectionCount() > 1)) |
145 && (((!mediaList.Count()) || (mediaList.SelectionCount() > 1)) |
138 || (!iFeatManager->IsFeatureSupportedL( |
146 || !iEditSupported)) |
139 KFeatureIdFfImageEditor) |
|
140 && !iFeatManager->IsFeatureSupportedL( |
|
141 KFeatureIdFfVideoEditor)))) |
|
142 { |
147 { |
143 aMenuPane->SetItemDimmed(EGlxCmdAiwSingleClickEdit, ETrue); |
148 aMenuPane->SetItemDimmed(EGlxCmdAiwSingleClickEdit, ETrue); |
144 } |
149 } |
145 //For Edit menu item present in Options CBA |
150 //For Edit menu item present in Options CBA |
146 else if (aMenuPane->MenuItemExists(EGlxCmdAiwEdit, pos)) |
151 else if (aMenuPane->MenuItemExists(EGlxCmdAiwEdit, pos)) |
147 { |
152 { |
148 // If the image path is private or view is in grid & |
153 // If the image path is private or view is in grid & |
149 // selection is not equal to 1, we should hide Edit menu item |
154 // selection is not equal to 1, we should hide Edit menu item |
150 if ((iImageViewerInstance->IsPrivate() |
155 if ((iImageViewerInstance->IsPrivate() |
151 || (mediaList.SelectionCount() != 1 |
156 || (mediaList.SelectionCount() != 1 |
152 && !IsInFullScreenViewingModeL())) |
157 && !iIsFullScreenMode)) |
153 || (!iFeatManager->IsFeatureSupportedL( |
158 || !iEditSupported) |
154 KFeatureIdFfImageEditor) |
|
155 && !iFeatManager->IsFeatureSupportedL( |
|
156 KFeatureIdFfVideoEditor))) |
|
157 { |
159 { |
158 aMenuPane->SetItemDimmed(EGlxCmdAiwEdit, ETrue); |
160 aMenuPane->SetItemDimmed(EGlxCmdAiwEdit, ETrue); |
159 } |
161 } |
160 } |
162 } |
161 } |
163 } |