Changeset 22677 for main/trunk/greenstone2/runtime-src/src
- Timestamp:
- 2010-08-18T21:13:11+12:00 (14 years ago)
- Location:
- main/trunk/greenstone2/runtime-src/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/runtime-src/src/recpt/configaction.cpp
r16321 r22677 31 31 # include <windows.h> 32 32 #endif 33 34 // constant for restart/reconfigure windows message (same as in w32server/fnord) 35 // http://msdn.microsoft.com/en-us/library/ms644931%28v=VS.85%29.aspx on WM_USER 36 // (also RegisterWindowMessage Function at http://msdn.microsoft.com/en-us/library/ms644947%28v=VS.85%29.aspx 37 // http://msdn.microsoft.com/en-us/library/ms644927%28v=VS.85%29.aspx) 38 #define WM_RESTART WM_USER+1 33 39 34 40 configaction::configaction () { … … 87 93 textout << "configured release-collection\n"; 88 94 95 } else if ((args["cmd"] == "restart")) { 96 if(!args["c"].empty()) { 97 remove_colservr(args["c"], logout); 98 textout << "configured release-collection for reconfigure-restart\n"; 99 } 100 textout << "reconfigure-restart\n"; 101 #ifdef GSDL_LOCAL_LIBRARY 102 HWND gw = FindWindow("Greenstone Digital Library Software", 103 "Greenstone Digital Library Software"); 104 PostMessage(gw, WM_RESTART, 0, 0); 105 #endif 89 106 } else if (args["cmd"] == "kill") { 90 107 textout << "killed\n"; -
main/trunk/greenstone2/runtime-src/src/w32server/fnord.cpp
r20949 r22677 100 100 #define RESTARTBUTTONY (MAINWINDOWHEIGHT-RESTARTBUTTONHEIGHT-15) 101 101 102 // constant for restart/reconfigure windows message (same as in recpt/configaction.cpp) 103 // http://msdn.microsoft.com/en-us/library/ms644931%28v=VS.85%29.aspx on WM_USER 104 // (also RegisterWindowMessage Function at http://msdn.microsoft.com/en-us/library/ms644947%28v=VS.85%29.aspx 105 // http://msdn.microsoft.com/en-us/library/ms644927%28v=VS.85%29.aspx) 106 #define WM_RESTART WM_USER+1 107 102 108 const char versionstring[] = "version " GSDL_VERSION; 103 109 … … 1070 1076 while (!init_done) { 1071 1077 if (PeekMessage(&Message, NULL, 0, 0, PM_REMOVE)) { 1072 if (Message.message == WM_QUIT) return Message.wParam;1073 if (!IsDialogMessage (MainWindow, &Message)) {1074 1075 1076 }1078 if (Message.message == WM_QUIT) return Message.wParam; 1079 if (!IsDialogMessage (MainWindow, &Message)) { 1080 TranslateMessage(&Message); /* translate keyboard messages */ 1081 DispatchMessage(&Message); /* return control to Windows NT */ 1082 } 1077 1083 } else { 1078 Sleep (1);1084 Sleep (1); 1079 1085 } 1080 1086 } … … 1157 1163 1158 1164 for (;;) { 1159 if (PeekMessage(&Message, NULL, 0, 0, PM_REMOVE)) { 1160 if (Message.message == WM_QUIT) break; 1161 if (!IsDialogMessage (MainWindow, &Message)) { 1162 TranslateMessage(&Message); /* translate keyboard messages */ 1163 DispatchMessage(&Message); /* return control to Windows NT */ 1164 } 1165 1165 if (PeekMessage(&Message, NULL, 0, 0, PM_REMOVE)) { 1166 if (Message.message == WM_QUIT) { 1167 break; 1168 } 1169 1170 if (Message.message == WM_RESTART) { 1171 1172 read_settings(0); 1173 if (!gsdl_init(false)) { // do the same as when restart library is pressed 1174 MessageBox(NULL,"Error re-initializing gsdl: gsdl_init()", 1175 "Error initialising GSDL", MB_OK|MB_SYSTEMMODAL); 1176 // when Restart Library is pressed, exit(0) is called) but a break here 1177 // will exit Greenstone same as with WM_QUIT msg above 1178 break; 1179 } 1180 } 1181 1182 if (!IsDialogMessage (MainWindow, &Message)) { 1183 TranslateMessage(&Message); /* translate keyboard messages */ 1184 DispatchMessage(&Message); /* return control to Windows NT */ 1185 } 1166 1186 } else { 1167 1187 if (DiffTickCounts (lastcheck, GetTickCount()) > 500) {
Note:
See TracChangeset
for help on using the changeset viewer.