END
POPUP "&Plugins"
BEGIN
- MENUITEM "&List...", ID_PLUGINS_LIST
+ MENUITEM "&Plugin Settings...", ID_PLUGINS_LIST
MENUITEM SEPARATOR
MENUITEM "Ma&nual Prediffer", ID_PREDIFFER_MANUAL
MENUITEM "A&utomatic Prediffer", ID_PREDIFFER_AUTO
END
POPUP "&Plugins"
BEGIN
- MENUITEM "&List...", ID_PLUGINS_LIST
+ MENUITEM "&Plugin Settings...", ID_PLUGINS_LIST
MENUITEM SEPARATOR
MENUITEM "Ma&nual Prediffer", ID_PREDIFFER_MANUAL
MENUITEM "A&utomatic Prediffer", ID_PREDIFFER_AUTO
END
POPUP "&Plugins"
BEGIN
- MENUITEM "&List...", ID_PLUGINS_LIST
+ MENUITEM "&Plugin Settings...", ID_PLUGINS_LIST
MENUITEM SEPARATOR
MENUITEM "Ma&nual Prediffer", ID_PREDIFFER_MANUAL
MENUITEM "A&utomatic Prediffer", ID_PREDIFFER_AUTO
CONTROL "&Enable plugins",IDC_PLUGINS_ENABLE,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,7,266,10
CONTROL "",IDC_PLUGINSLIST_LIST,"SysListView32",LVS_REPORT |
- LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,
+ LVS_ALIGNLEFT | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER | WS_TABSTOP,
7,22,356,155
+ DEFPUSHBUTTON "&Plugin Settings...",IDC_PLUGIN_SETTINGS,170,190,75,14
DEFPUSHBUTTON "OK",IDOK,254,190,50,14
PUSHBUTTON "Cancel",IDCANCEL,313,190,50,14
END
return (! FAILED(h));
}
+
+bool InvokeShowSettingsDialog(IDispatch *piScript)
+{
+ VARIANT vboolHandled;
+ vboolHandled.vt = VT_BOOL;
+ vboolHandled.boolVal = false;
+
+ // invoke method by name, reverse order for arguments
+ // VARIANT_BOOL ShowSettingsDialog()
+ HRESULT h = ::safeInvokeW(piScript, &vboolHandled, L"ShowSettingsDialog", opFxn[0]);
+ bool bSuccess = ! FAILED(h) && vboolHandled.boolVal;
+
+ // clear the returned variant
+ VariantClear(&vboolHandled);
+
+ return (bSuccess);
+}
* @brief Call the plugin "PrediffFile" method, event FILE_PREDIFF
*/
bool InvokePrediffFile(const String& fileSource, const String& fileDest, int & nChanged, LPDISPATCH piScript);
+/**
+ * @brief Call the plugin "ShowSettingsDialog" method
+ */
+bool InvokeShowSettingsDialog(LPDISPATCH piScript);
#endif //__PLUGINS_H__
BEGIN_MESSAGE_MAP(PluginsListDlg, CDialog)
ON_BN_CLICKED(IDOK, OnBnClickedOk)
+ ON_BN_CLICKED(IDC_PLUGIN_SETTINGS, OnBnClickedPluginSettings)
+ ON_NOTIFY(NM_DBLCLK, IDC_PLUGINSLIST_LIST, OnNMDblclkList)
END_MESSAGE_MAP()
/**
InitList();
AddPlugins();
+ m_list.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED);
BOOL pluginsEnabled = GetOptionsMgr()->GetBool(OPT_PLUGINS_ENABLED);
if (pluginsEnabled)
}
OnOK();
}
+
+void PluginsListDlg::OnBnClickedPluginSettings()
+{
+ POSITION pos = m_list.GetFirstSelectedItemPosition();
+ if (pos)
+ {
+ String pluginName = static_cast<const TCHAR *>(m_list.GetItemText(m_list.GetNextSelectedItem(pos), 0));
+ wchar_t *types[] = {L"FILE_PACK_UNPACK", L"BUFFER_PACK_UNPACK", L"FILE_PREDIFF", L"BUFFER_PREDIFF", L"EDITOR_SCRIPT"};
+ for (int i = 0; i < sizeof(types)/sizeof(types[0]); ++i)
+ {
+ PluginInfo * plugin = CAllThreadsScripts::GetActiveSet()->GetPluginByName(types[i], pluginName);
+ if (plugin)
+ {
+ EnableWindow(false);
+ InvokeShowSettingsDialog(plugin->m_lpDispatch);
+ EnableWindow(true);
+ SetForegroundWindow();
+ break;
+ }
+ }
+ }
+}\r
+\r
+void PluginsListDlg::OnNMDblclkList(NMHDR *pNMHDR, LRESULT *pResult)\r
+{\r
+ OnBnClickedPluginSettings();\r
+}\r
afx_msg BOOL OnInitDialog();
afx_msg void OnBnClickedOk();
+ afx_msg void OnBnClickedPluginSettings();
+ afx_msg void OnNMDblclkList(NMHDR *pNMHDR, LRESULT *pResult);
DECLARE_MESSAGE_MAP()
public:
#define ID_IMG_THRESHOLD_64 33248
#define IDC_COMPAREIMAGE_PATTERNS 33249
#define IDC_COMPAREIMAGE_DEFAULTS 33250
+#define IDC_PLUGIN_SETTINGS 33251
// Next default values for new objects
//
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 242
-#define _APS_NEXT_COMMAND_VALUE 33251
+#define _APS_NEXT_COMMAND_VALUE 33252
#define _APS_NEXT_CONTROL_VALUE 1358
#define _APS_NEXT_SYMED_VALUE 115
#endif