Ignore:
Timestamp:
2010-08-18T21:13:11+12:00 (14 years ago)
Author:
ak19
Message:

More changes for making the collectdir movable (ticket 152): (1) Changes to GLI code so that llssite and glisite are updated to contain the COLLECTHOME property to tell server.exe where the new collect dir is. (2) server.exe must be told that it needs to restart (so it can read the new collecthome).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/runtime-src/src/w32server/fnord.cpp

    r20949 r22677  
    100100#define RESTARTBUTTONY (MAINWINDOWHEIGHT-RESTARTBUTTONHEIGHT-15)
    101101
     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
    102108const char versionstring[] = "version " GSDL_VERSION;
    103109
     
    10701076    while (!init_done) {
    10711077      if (PeekMessage(&Message, NULL, 0, 0, PM_REMOVE)) {
    1072     if (Message.message == WM_QUIT) return Message.wParam;
    1073     if (!IsDialogMessage (MainWindow, &Message)) {
    1074       TranslateMessage(&Message); /* translate keyboard messages */
    1075       DispatchMessage(&Message);  /* return control to Windows NT */
    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        }
    10771083      } else {
    1078     Sleep (1);
     1084        Sleep (1);
    10791085      }
    10801086    }
     
    11571163 
    11581164  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        } 
    11661186    } else {
    11671187      if (DiffTickCounts (lastcheck, GetTickCount()) > 500) {
Note: See TracChangeset for help on using the changeset viewer.