mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-25 14:17:03 +00:00
[client] add switch to disable alert messages, fixes #83
This commit is contained in:
parent
d839026ade
commit
1f90010cbd
@ -104,6 +104,7 @@ struct AppParams
|
|||||||
bool allowScreensaver;
|
bool allowScreensaver;
|
||||||
bool grabKeyboard;
|
bool grabKeyboard;
|
||||||
SDL_Scancode captureKey;
|
SDL_Scancode captureKey;
|
||||||
|
bool disableAlerts;
|
||||||
|
|
||||||
bool forceRenderer;
|
bool forceRenderer;
|
||||||
unsigned int forceRendererIndex;
|
unsigned int forceRendererIndex;
|
||||||
@ -135,8 +136,9 @@ struct AppParams params =
|
|||||||
.hideMouse = true,
|
.hideMouse = true,
|
||||||
.ignoreQuit = false,
|
.ignoreQuit = false,
|
||||||
.allowScreensaver = true,
|
.allowScreensaver = true,
|
||||||
.captureKey = SDL_SCANCODE_SCROLLLOCK,
|
|
||||||
.grabKeyboard = true,
|
.grabKeyboard = true,
|
||||||
|
.captureKey = SDL_SCANCODE_SCROLLLOCK,
|
||||||
|
.disableAlerts = false,
|
||||||
.forceRenderer = false
|
.forceRenderer = false
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -534,7 +536,7 @@ int eventFilter(void * userdata, SDL_Event * event)
|
|||||||
SDL_SetWindowGrab(state.window, serverMode);
|
SDL_SetWindowGrab(state.window, serverMode);
|
||||||
DEBUG_INFO("Server Mode: %s", serverMode ? "on" : "off");
|
DEBUG_INFO("Server Mode: %s", serverMode ? "on" : "off");
|
||||||
|
|
||||||
if (state.lgr)
|
if (state.lgr && !params.disableAlerts)
|
||||||
state.lgr->on_alert(
|
state.lgr->on_alert(
|
||||||
state.lgrData,
|
state.lgrData,
|
||||||
serverMode ? LG_ALERT_SUCCESS : LG_ALERT_WARNING,
|
serverMode ? LG_ALERT_SUCCESS : LG_ALERT_WARNING,
|
||||||
@ -1079,6 +1081,7 @@ void doHelp(char * app)
|
|||||||
" -G Don't capture the keyboard in capture mode\n"
|
" -G Don't capture the keyboard in capture mode\n"
|
||||||
" -m CODE Specify the capture key [current: %u (%s)]\n"
|
" -m CODE Specify the capture key [current: %u (%s)]\n"
|
||||||
" See https://wiki.libsdl.org/SDLScancodeLookup for valid values\n"
|
" See https://wiki.libsdl.org/SDLScancodeLookup for valid values\n"
|
||||||
|
" -q Disable alert messages [current: %s]\n"
|
||||||
"\n"
|
"\n"
|
||||||
" -l License information\n"
|
" -l License information\n"
|
||||||
"\n",
|
"\n",
|
||||||
@ -1094,6 +1097,7 @@ void doHelp(char * app)
|
|||||||
params.w,
|
params.w,
|
||||||
params.h,
|
params.h,
|
||||||
params.captureKey,
|
params.captureKey,
|
||||||
|
params.disableAlerts ? "disabled" : "enabled",
|
||||||
SDL_GetScancodeName(params.captureKey)
|
SDL_GetScancodeName(params.captureKey)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1181,6 +1185,7 @@ static bool load_config(const char * configFile)
|
|||||||
if (config_setting_lookup_bool(global, "fullScreen" , &itmp)) params.fullscreen = (itmp != 0);
|
if (config_setting_lookup_bool(global, "fullScreen" , &itmp)) params.fullscreen = (itmp != 0);
|
||||||
if (config_setting_lookup_bool(global, "ignoreQuit" , &itmp)) params.ignoreQuit = (itmp != 0);
|
if (config_setting_lookup_bool(global, "ignoreQuit" , &itmp)) params.ignoreQuit = (itmp != 0);
|
||||||
if (config_setting_lookup_bool(global, "allowScreensaver", &itmp)) params.allowScreensaver = (itmp != 0);
|
if (config_setting_lookup_bool(global, "allowScreensaver", &itmp)) params.allowScreensaver = (itmp != 0);
|
||||||
|
if (config_setting_lookup_bool(global, "disableAlerts" , &itmp)) params.disableAlerts = (itmp != 0);
|
||||||
|
|
||||||
if (config_setting_lookup_int(global, "x", ¶ms.x)) params.center = false;
|
if (config_setting_lookup_int(global, "x", ¶ms.x)) params.center = false;
|
||||||
if (config_setting_lookup_int(global, "y", ¶ms.y)) params.center = false;
|
if (config_setting_lookup_int(global, "y", ¶ms.y)) params.center = false;
|
||||||
@ -1321,7 +1326,7 @@ int main(int argc, char * argv[])
|
|||||||
|
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
switch(getopt(argc, argv, "hC:f:L:sc:p:jMvK:kg:o:anrdFx:y:w:b:QSGm:l"))
|
switch(getopt(argc, argv, "hC:f:L:sc:p:jMvK:kg:o:anrdFx:y:w:b:QSGm:lq"))
|
||||||
{
|
{
|
||||||
case '?':
|
case '?':
|
||||||
case 'h':
|
case 'h':
|
||||||
@ -1554,6 +1559,10 @@ int main(int argc, char * argv[])
|
|||||||
params.captureKey = atoi(optarg);
|
params.captureKey = atoi(optarg);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
case 'q':
|
||||||
|
params.disableAlerts = true;
|
||||||
|
continue;
|
||||||
|
|
||||||
case 'l':
|
case 'l':
|
||||||
doLicense();
|
doLicense();
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user