Added reload configuration menu item to win32 task bar.

This commit is contained in:
crs 2004-02-29 21:31:24 +00:00
parent 8f083a2e65
commit 77dd4c81c4
4 changed files with 20 additions and 5 deletions

View File

@ -15,12 +15,15 @@
#include "CMSWindowsServerTaskBarReceiver.h"
#include "CServer.h"
#include "CMSWindowsClipboard.h"
#include "IEventQueue.h"
#include "LogOutputters.h"
#include "BasicTypes.h"
#include "CArch.h"
#include "CArchTaskBarWindows.h"
#include "resource.h"
extern CEvent::Type getReloadConfigEvent();
//
// CMSWindowsServerTaskBarReceiver
//
@ -171,6 +174,11 @@ CMSWindowsServerTaskBarReceiver::runMenu(int x, int y)
copyLog();
break;
case IDC_RELOAD_CONFIG:
EVENTQUEUE->addEvent(CEvent(getReloadConfigEvent(),
IEventQueue::getSystemTarget()));
break;
case IDC_TASKBAR_QUIT:
quit();
break;

View File

@ -17,13 +17,14 @@
#define IDC_TASKBAR_QUIT 40003
#define IDC_TASKBAR_STATUS 40004
#define IDC_TASKBAR_LOG 40005
#define IDC_RELOAD_CONFIG 40006
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 109
#define _APS_NEXT_COMMAND_VALUE 40006
#define _APS_NEXT_COMMAND_VALUE 40007
#define _APS_NEXT_CONTROL_VALUE 1003
#define _APS_NEXT_SYMED_VALUE 101
#endif

View File

@ -144,6 +144,12 @@ static CClientListener* s_listener = NULL;
static CServerTaskBarReceiver* s_taskBarReceiver = NULL;
static CEvent::Type s_reloadConfigEvent = CEvent::kUnknown;
CEvent::Type
getReloadConfigEvent()
{
return CEvent::registerTypeOnce(s_reloadConfigEvent, "reloadConfig");
}
static
void
updateStatus()
@ -395,7 +401,7 @@ static
void
reloadSignalHandler(CArch::ESignal, void*)
{
EVENTQUEUE->addEvent(CEvent(s_reloadConfigEvent,
EVENTQUEUE->addEvent(CEvent(getReloadConfigEvent(),
IEventQueue::getSystemTarget()));
}
@ -454,9 +460,8 @@ mainLoop()
}
// handle hangup signal by reloading the server's configuration
CEvent::registerTypeOnce(s_reloadConfigEvent, "reloadConfig");
ARCH->setSignalHandler(CArch::kHANGUP, &reloadSignalHandler, NULL);
EVENTQUEUE->adoptHandler(s_reloadConfigEvent,
EVENTQUEUE->adoptHandler(getReloadConfigEvent(),
IEventQueue::getSystemTarget(),
new CFunctionEventJob(&reloadConfig));
@ -475,7 +480,7 @@ mainLoop()
// close down
LOG((CLOG_DEBUG1 "stopping server"));
EVENTQUEUE->removeHandler(s_reloadConfigEvent,
EVENTQUEUE->removeHandler(getReloadConfigEvent(),
IEventQueue::getSystemTarget());
stopServer();
updateStatus();

View File

@ -71,6 +71,7 @@ BEGIN
BEGIN
MENUITEM "Show Status", IDC_TASKBAR_STATUS
MENUITEM "Copy Log To Clipboard", IDC_TASKBAR_LOG
MENUITEM "Reload Configuration", IDC_RELOAD_CONFIG
MENUITEM SEPARATOR
MENUITEM "Quit", IDC_TASKBAR_QUIT
END