| 71 | |
| 72 | |
| 73 | INT_PTR CALLBACK NotifyUpdatesDialog::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam) |
| 74 | { |
| 75 | switch (Message) |
| 76 | { |
| 77 | case WM_INITDIALOG : |
| 78 | { |
| 79 | PluginListView::VERSIONCOLUMN columns[2]; |
| 80 | columns[0] = PluginListView::VERSION_INSTALLED; |
| 81 | columns[1] = PluginListView::VERSION_AVAILABLE; |
| 82 | _hListView = ::GetDlgItem(_hSelf, IDC_LISTUPDATES); |
| 83 | _hUpdateDescription = ::GetDlgItem(_hSelf, IDC_UPDATEDESC); |
| 84 | _pluginListView.init(_hListView, _hUpdateDescription, 2, columns, true); |
| 85 | |
| 86 | _pluginListView.setList(_updateList); |
| 87 | _pluginListView.selectAll(); |
| 88 | |
| 89 | |
| 90 | goToCenter(); |
| 91 | return TRUE; |
| 92 | } |
| 93 | case WM_COMMAND : |
| 94 | { |
| 95 | switch (wParam) |
| 96 | { |
| 97 | case IDC_IGNORE: |
| 98 | { |
| 99 | std::shared_ptr<list<Plugin*> > selectedPlugins = _pluginListView.getSelectedPlugins(); |
| 100 | tstring pluginConfigFilename(_pluginList->getVariableHandler()->getVariable(_T("CONFIGDIR"))); |
| 101 | pluginConfigFilename.append(_T("\\PluginManager.ini")); |
| 102 | |
| 103 | list<Plugin*>::iterator iter = selectedPlugins->begin(); |
| 104 | while (iter != selectedPlugins->end()) |
| 105 | { |
| 106 | ::WritePrivateProfileString(_T("IgnoreUpdates"), |
| 107 | (*iter)->getName().c_str(), |
| 108 | (*iter)->getVersion().getDisplayString(), |
| 109 | pluginConfigFilename.c_str()); |
| 110 | ++iter; |
| 111 | } |
| 112 | |
| 113 | _pluginListView.removeSelected(); |
| 114 | |
| 115 | if (_pluginListView.empty()) |
| 116 | ::EndDialog(_hSelf, 0); |
| 117 | |
| 118 | return TRUE; |
| 119 | } |
| 120 | |
| 121 | case IDC_UPDATE: |
| 122 | { |
| 123 | CancelToken cancelToken; |
| 124 | ProgressDialog progress(_hInst, |
| 125 | cancelToken, |
| 126 | std::bind(&PluginList::startInstall, _pluginList, _nppData._nppHandle, _1, &_pluginListView, TRUE, cancelToken)); |
| 127 | progress.doModal(_hSelf); |
| 128 | |
| 129 | _pluginListView.removeSelected(); |
| 130 |
nothing calls this directly
no test coverage detected