Browse files

Allow "Refresh XML" for testing version

  • Loading branch information...
1 parent 8a8af97 commit 51ef921a6264f3c541047038d70edbed6b51a66f @bruderstein committed May 19, 2012
View
34 pluginManager/src/PluginManager.cpp
@@ -32,7 +32,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "Encrypter.h"
/* information for notepad */
+
+#ifdef ALLOW_OVERRIDE_XML_URL
+CONST INT nbFunc = 3;
+#else
CONST INT nbFunc = 2;
+#endif
+
CONST TCHAR PLUGIN_NAME[] = _T("Plugin Manager");
/* global values */
@@ -63,7 +69,7 @@ TCHAR iniFilePath[MAX_PATH];
UINT startupChecks(LPVOID param);
-
+void doReloadXml();
using namespace std;
@@ -89,9 +95,15 @@ BOOL APIENTRY DllMain( HANDLE hModule,
_tcscpy_s(funcItem[0]._itemName, 64, _T("&Show Plugin Manager"));
_tcscpy_s(funcItem[1]._itemName, 64, _T("&About"));
+
/* Set shortcuts */
funcItem[0]._pShKey = NULL;
funcItem[1]._pShKey = NULL;
+#ifdef ALLOW_OVERRIDE_XML_URL
+ funcItem[2]._pFunc = doReloadXml;
+ _tcscpy_s(funcItem[2]._itemName, 64, _T("&Refresh XML"));
+ funcItem[2]._pShKey = NULL;
+#endif
DownloadManager::setUserAgent(_T("Notepad++/Plugin-Manager;v") _T(PLUGINMANAGERVERSION_STRING));
break;
@@ -442,4 +454,22 @@ UINT startupChecks(LPVOID /*param*/)
return 0;
-}
+}
+
+#ifdef ALLOW_OVERRIDE_XML_URL
+void doReloadXml()
+{
+ if (NULL == g_pluginList)
+ {
+ g_pluginList = new PluginList();
+ g_pluginList->init(&nppData);
+ pluginManagerDlg.setPluginList(g_pluginList);
+ }
+
+ g_pluginList->downloadList();
+
+ pluginManagerDlg.refreshLists();
+ ::MessageBox(nppData._nppHandle, _T("XML Refreshed"), _T("Plugin Manager"), MB_OK |MB_ICONINFORMATION);
+
+}
+#endif
View
1 pluginManager/src/PluginManagerDialog.h
@@ -38,6 +38,7 @@ class PluginManagerDialog : StaticDialog
void setStepProgress(const int percentageComplete);
void setStepComplete();
+ void refreshLists();
protected :
virtual BOOL CALLBACK run_dlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
View
6 pluginManager/src/pluginmanagerdialog.cpp
@@ -463,6 +463,7 @@ BOOL CALLBACK PluginManagerDialog::run_dlgProc(HWND hWnd, UINT Message, WPARAM w
}
return TRUE;
}
+
case IDOK :
case IDCANCEL :
display(FALSE);
@@ -654,6 +655,11 @@ void PluginManagerDialog::downloadAndPopulate(PVOID pvoid)
_endthread();
}
+void PluginManagerDialog::refreshLists()
+{
+ populateLists(this);
+}
+
void PluginManagerDialog::populateLists(PluginManagerDialog* dlg)
{
// Show the lists

0 comments on commit 51ef921

Please sign in to comment.