Added reload configuration menu item to win32 task bar.
This commit is contained in:
parent
8f083a2e65
commit
77dd4c81c4
|
@ -15,12 +15,15 @@
|
||||||
#include "CMSWindowsServerTaskBarReceiver.h"
|
#include "CMSWindowsServerTaskBarReceiver.h"
|
||||||
#include "CServer.h"
|
#include "CServer.h"
|
||||||
#include "CMSWindowsClipboard.h"
|
#include "CMSWindowsClipboard.h"
|
||||||
|
#include "IEventQueue.h"
|
||||||
#include "LogOutputters.h"
|
#include "LogOutputters.h"
|
||||||
#include "BasicTypes.h"
|
#include "BasicTypes.h"
|
||||||
#include "CArch.h"
|
#include "CArch.h"
|
||||||
#include "CArchTaskBarWindows.h"
|
#include "CArchTaskBarWindows.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
||||||
|
extern CEvent::Type getReloadConfigEvent();
|
||||||
|
|
||||||
//
|
//
|
||||||
// CMSWindowsServerTaskBarReceiver
|
// CMSWindowsServerTaskBarReceiver
|
||||||
//
|
//
|
||||||
|
@ -171,6 +174,11 @@ CMSWindowsServerTaskBarReceiver::runMenu(int x, int y)
|
||||||
copyLog();
|
copyLog();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case IDC_RELOAD_CONFIG:
|
||||||
|
EVENTQUEUE->addEvent(CEvent(getReloadConfigEvent(),
|
||||||
|
IEventQueue::getSystemTarget()));
|
||||||
|
break;
|
||||||
|
|
||||||
case IDC_TASKBAR_QUIT:
|
case IDC_TASKBAR_QUIT:
|
||||||
quit();
|
quit();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -17,13 +17,14 @@
|
||||||
#define IDC_TASKBAR_QUIT 40003
|
#define IDC_TASKBAR_QUIT 40003
|
||||||
#define IDC_TASKBAR_STATUS 40004
|
#define IDC_TASKBAR_STATUS 40004
|
||||||
#define IDC_TASKBAR_LOG 40005
|
#define IDC_TASKBAR_LOG 40005
|
||||||
|
#define IDC_RELOAD_CONFIG 40006
|
||||||
|
|
||||||
// Next default values for new objects
|
// Next default values for new objects
|
||||||
//
|
//
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 109
|
#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_CONTROL_VALUE 1003
|
||||||
#define _APS_NEXT_SYMED_VALUE 101
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -144,6 +144,12 @@ static CClientListener* s_listener = NULL;
|
||||||
static CServerTaskBarReceiver* s_taskBarReceiver = NULL;
|
static CServerTaskBarReceiver* s_taskBarReceiver = NULL;
|
||||||
static CEvent::Type s_reloadConfigEvent = CEvent::kUnknown;
|
static CEvent::Type s_reloadConfigEvent = CEvent::kUnknown;
|
||||||
|
|
||||||
|
CEvent::Type
|
||||||
|
getReloadConfigEvent()
|
||||||
|
{
|
||||||
|
return CEvent::registerTypeOnce(s_reloadConfigEvent, "reloadConfig");
|
||||||
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
void
|
void
|
||||||
updateStatus()
|
updateStatus()
|
||||||
|
@ -395,7 +401,7 @@ static
|
||||||
void
|
void
|
||||||
reloadSignalHandler(CArch::ESignal, void*)
|
reloadSignalHandler(CArch::ESignal, void*)
|
||||||
{
|
{
|
||||||
EVENTQUEUE->addEvent(CEvent(s_reloadConfigEvent,
|
EVENTQUEUE->addEvent(CEvent(getReloadConfigEvent(),
|
||||||
IEventQueue::getSystemTarget()));
|
IEventQueue::getSystemTarget()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -454,9 +460,8 @@ mainLoop()
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle hangup signal by reloading the server's configuration
|
// handle hangup signal by reloading the server's configuration
|
||||||
CEvent::registerTypeOnce(s_reloadConfigEvent, "reloadConfig");
|
|
||||||
ARCH->setSignalHandler(CArch::kHANGUP, &reloadSignalHandler, NULL);
|
ARCH->setSignalHandler(CArch::kHANGUP, &reloadSignalHandler, NULL);
|
||||||
EVENTQUEUE->adoptHandler(s_reloadConfigEvent,
|
EVENTQUEUE->adoptHandler(getReloadConfigEvent(),
|
||||||
IEventQueue::getSystemTarget(),
|
IEventQueue::getSystemTarget(),
|
||||||
new CFunctionEventJob(&reloadConfig));
|
new CFunctionEventJob(&reloadConfig));
|
||||||
|
|
||||||
|
@ -475,7 +480,7 @@ mainLoop()
|
||||||
|
|
||||||
// close down
|
// close down
|
||||||
LOG((CLOG_DEBUG1 "stopping server"));
|
LOG((CLOG_DEBUG1 "stopping server"));
|
||||||
EVENTQUEUE->removeHandler(s_reloadConfigEvent,
|
EVENTQUEUE->removeHandler(getReloadConfigEvent(),
|
||||||
IEventQueue::getSystemTarget());
|
IEventQueue::getSystemTarget());
|
||||||
stopServer();
|
stopServer();
|
||||||
updateStatus();
|
updateStatus();
|
||||||
|
|
|
@ -71,6 +71,7 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "Show Status", IDC_TASKBAR_STATUS
|
MENUITEM "Show Status", IDC_TASKBAR_STATUS
|
||||||
MENUITEM "Copy Log To Clipboard", IDC_TASKBAR_LOG
|
MENUITEM "Copy Log To Clipboard", IDC_TASKBAR_LOG
|
||||||
|
MENUITEM "Reload Configuration", IDC_RELOAD_CONFIG
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Quit", IDC_TASKBAR_QUIT
|
MENUITEM "Quit", IDC_TASKBAR_QUIT
|
||||||
END
|
END
|
||||||
|
|
Loading…
Reference in New Issue