Commit 838572f7 authored by Ulrich Sibiller's avatar Ulrich Sibiller

Dialog.c: save some lines

parent 5067b169
...@@ -198,7 +198,6 @@ void nxagentLaunchDialog(DialogType dialogType) ...@@ -198,7 +198,6 @@ void nxagentLaunchDialog(DialogType dialogType)
type = DIALOG_KILL_SESSION_TYPE; type = DIALOG_KILL_SESSION_TYPE;
local = DIALOG_KILL_SESSION_LOCAL; local = DIALOG_KILL_SESSION_LOCAL;
pid = &nxagentKillDialogPid; pid = &nxagentKillDialogPid;
break; break;
} }
case DIALOG_SUSPEND_SESSION: case DIALOG_SUSPEND_SESSION:
...@@ -207,7 +206,6 @@ void nxagentLaunchDialog(DialogType dialogType) ...@@ -207,7 +206,6 @@ void nxagentLaunchDialog(DialogType dialogType)
type = DIALOG_SUSPEND_SESSION_TYPE; type = DIALOG_SUSPEND_SESSION_TYPE;
local = DIALOG_SUSPEND_SESSION_LOCAL; local = DIALOG_SUSPEND_SESSION_LOCAL;
pid = &nxagentSuspendDialogPid; pid = &nxagentSuspendDialogPid;
break; break;
} }
case DIALOG_ROOTLESS: case DIALOG_ROOTLESS:
...@@ -216,7 +214,6 @@ void nxagentLaunchDialog(DialogType dialogType) ...@@ -216,7 +214,6 @@ void nxagentLaunchDialog(DialogType dialogType)
type = DIALOG_ROOTLESS_TYPE; type = DIALOG_ROOTLESS_TYPE;
local = DIALOG_ROOTLESS_LOCAL; local = DIALOG_ROOTLESS_LOCAL;
pid = &nxagentRootlessDialogPid; pid = &nxagentRootlessDialogPid;
break; break;
} }
case DIALOG_PULLDOWN: case DIALOG_PULLDOWN:
...@@ -226,7 +223,6 @@ void nxagentLaunchDialog(DialogType dialogType) ...@@ -226,7 +223,6 @@ void nxagentLaunchDialog(DialogType dialogType)
local = DIALOG_PULLDOWN_LOCAL; local = DIALOG_PULLDOWN_LOCAL;
pid = &nxagentPulldownDialogPid; pid = &nxagentPulldownDialogPid;
window = nxagentPulldownWindow; window = nxagentPulldownWindow;
break; break;
} }
case DIALOG_FONT_REPLACEMENT: case DIALOG_FONT_REPLACEMENT:
...@@ -235,7 +231,6 @@ void nxagentLaunchDialog(DialogType dialogType) ...@@ -235,7 +231,6 @@ void nxagentLaunchDialog(DialogType dialogType)
type = DIALOG_FONT_REPLACEMENT_TYPE; type = DIALOG_FONT_REPLACEMENT_TYPE;
local = DIALOG_FONT_REPLACEMENT_LOCAL; local = DIALOG_FONT_REPLACEMENT_LOCAL;
pid = &nxagentFontsReplacementDialogPid; pid = &nxagentFontsReplacementDialogPid;
break; break;
} }
case DIALOG_FAILED_RECONNECTION: case DIALOG_FAILED_RECONNECTION:
...@@ -244,7 +239,6 @@ void nxagentLaunchDialog(DialogType dialogType) ...@@ -244,7 +239,6 @@ void nxagentLaunchDialog(DialogType dialogType)
type = DIALOG_FAILED_RECONNECTION_TYPE; type = DIALOG_FAILED_RECONNECTION_TYPE;
local = DIALOG_FAILED_RECONNECTION_LOCAL; local = DIALOG_FAILED_RECONNECTION_LOCAL;
pid = &nxagentFailedReconnectionDialogPid; pid = &nxagentFailedReconnectionDialogPid;
break; break;
} }
case DIALOG_ENABLE_DESKTOP_RESIZE_MODE: case DIALOG_ENABLE_DESKTOP_RESIZE_MODE:
...@@ -253,7 +247,6 @@ void nxagentLaunchDialog(DialogType dialogType) ...@@ -253,7 +247,6 @@ void nxagentLaunchDialog(DialogType dialogType)
type = DIALOG_ENABLE_DESKTOP_RESIZE_MODE_TYPE; type = DIALOG_ENABLE_DESKTOP_RESIZE_MODE_TYPE;
local = DIALOG_ENABLE_DESKTOP_RESIZE_MODE_LOCAL; local = DIALOG_ENABLE_DESKTOP_RESIZE_MODE_LOCAL;
pid = &nxagentEnableRandRModeDialogPid; pid = &nxagentEnableRandRModeDialogPid;
break; break;
} }
case DIALOG_DISABLE_DESKTOP_RESIZE_MODE: case DIALOG_DISABLE_DESKTOP_RESIZE_MODE:
...@@ -262,7 +255,6 @@ void nxagentLaunchDialog(DialogType dialogType) ...@@ -262,7 +255,6 @@ void nxagentLaunchDialog(DialogType dialogType)
type = DIALOG_DISABLE_DESKTOP_RESIZE_MODE_TYPE; type = DIALOG_DISABLE_DESKTOP_RESIZE_MODE_TYPE;
local = DIALOG_DISABLE_DESKTOP_RESIZE_MODE_LOCAL; local = DIALOG_DISABLE_DESKTOP_RESIZE_MODE_LOCAL;
pid = &nxagentDisableRandRModeDialogPid; pid = &nxagentDisableRandRModeDialogPid;
break; break;
} }
case DIALOG_ENABLE_DEFER_MODE: case DIALOG_ENABLE_DEFER_MODE:
...@@ -271,7 +263,6 @@ void nxagentLaunchDialog(DialogType dialogType) ...@@ -271,7 +263,6 @@ void nxagentLaunchDialog(DialogType dialogType)
type = DIALOG_ENABLE_DEFER_MODE_TYPE; type = DIALOG_ENABLE_DEFER_MODE_TYPE;
local = DIALOG_ENABLE_DEFER_MODE_LOCAL; local = DIALOG_ENABLE_DEFER_MODE_LOCAL;
pid = &nxagentEnableDeferModePid; pid = &nxagentEnableDeferModePid;
break; break;
} }
case DIALOG_DISABLE_DEFER_MODE: case DIALOG_DISABLE_DEFER_MODE:
...@@ -280,7 +271,6 @@ void nxagentLaunchDialog(DialogType dialogType) ...@@ -280,7 +271,6 @@ void nxagentLaunchDialog(DialogType dialogType)
type = DIALOG_DISABLE_DEFER_MODE_TYPE; type = DIALOG_DISABLE_DEFER_MODE_TYPE;
local = DIALOG_DISABLE_DEFER_MODE_LOCAL; local = DIALOG_DISABLE_DEFER_MODE_LOCAL;
pid = &nxagentDisableDeferModePid; pid = &nxagentDisableDeferModePid;
break; break;
} }
case DIALOG_ENABLE_AUTOGRAB_MODE: case DIALOG_ENABLE_AUTOGRAB_MODE:
...@@ -289,7 +279,6 @@ void nxagentLaunchDialog(DialogType dialogType) ...@@ -289,7 +279,6 @@ void nxagentLaunchDialog(DialogType dialogType)
type = DIALOG_ENABLE_AUTOGRAB_MODE_TYPE; type = DIALOG_ENABLE_AUTOGRAB_MODE_TYPE;
local = DIALOG_ENABLE_AUTOGRAB_MODE_LOCAL; local = DIALOG_ENABLE_AUTOGRAB_MODE_LOCAL;
pid = &nxagentEnableAutograbModePid; pid = &nxagentEnableAutograbModePid;
break; break;
} }
case DIALOG_DISABLE_AUTOGRAB_MODE: case DIALOG_DISABLE_AUTOGRAB_MODE:
...@@ -298,7 +287,6 @@ void nxagentLaunchDialog(DialogType dialogType) ...@@ -298,7 +287,6 @@ void nxagentLaunchDialog(DialogType dialogType)
type = DIALOG_DISABLE_AUTOGRAB_MODE_TYPE; type = DIALOG_DISABLE_AUTOGRAB_MODE_TYPE;
local = DIALOG_DISABLE_AUTOGRAB_MODE_LOCAL; local = DIALOG_DISABLE_AUTOGRAB_MODE_LOCAL;
pid = &nxagentDisableAutograbModePid; pid = &nxagentDisableAutograbModePid;
break; break;
} }
default: default:
...@@ -325,8 +313,7 @@ void nxagentLaunchDialog(DialogType dialogType) ...@@ -325,8 +313,7 @@ void nxagentLaunchDialog(DialogType dialogType)
} }
/* /*
* We don't want to receive SIGCHLD * We don't want to receive SIGCHLD before we store the child pid.
* before we store the child pid.
*/ */
sigemptyset(&set); sigemptyset(&set);
...@@ -346,8 +333,7 @@ void nxagentLaunchDialog(DialogType dialogType) ...@@ -346,8 +333,7 @@ void nxagentLaunchDialog(DialogType dialogType)
dialogDisplay[0] = '\0'; dialogDisplay[0] = '\0';
/* /*
* Restore the previous set of * Restore the previous set of blocked signal.
* blocked signal.
*/ */
sigprocmask(SIG_SETMASK, &oldSet, NULL); sigprocmask(SIG_SETMASK, &oldSet, NULL);
...@@ -385,8 +371,7 @@ void nxagentFailedReconnectionDialog(int alert, char *error) ...@@ -385,8 +371,7 @@ void nxagentFailedReconnectionDialog(int alert, char *error)
NXTransAlert(alert, NX_ALERT_REMOTE); NXTransAlert(alert, NX_ALERT_REMOTE);
/* /*
* Make it possible to interrupt the * Make it possible to interrupt the loop with a signal.
* loop with a signal.
*/ */
while (NXDisplayError(nxagentDisplay) == 0 && while (NXDisplayError(nxagentDisplay) == 0 &&
...@@ -477,73 +462,61 @@ void nxagentTerminateDialog(DialogType type) ...@@ -477,73 +462,61 @@ void nxagentTerminateDialog(DialogType type)
case DIALOG_KILL_SESSION: case DIALOG_KILL_SESSION:
{ {
pid = nxagentKillDialogPid; pid = nxagentKillDialogPid;
break; break;
} }
case DIALOG_SUSPEND_SESSION: case DIALOG_SUSPEND_SESSION:
{ {
pid = nxagentSuspendDialogPid; pid = nxagentSuspendDialogPid;
break; break;
} }
case DIALOG_ROOTLESS: case DIALOG_ROOTLESS:
{ {
pid = nxagentRootlessDialogPid; pid = nxagentRootlessDialogPid;
break; break;
} }
case DIALOG_PULLDOWN: case DIALOG_PULLDOWN:
{ {
pid = nxagentPulldownDialogPid; pid = nxagentPulldownDialogPid;
break; break;
} }
case DIALOG_FONT_REPLACEMENT: case DIALOG_FONT_REPLACEMENT:
{ {
pid = nxagentFontsReplacementDialogPid; pid = nxagentFontsReplacementDialogPid;
break; break;
} }
case DIALOG_FAILED_RECONNECTION: case DIALOG_FAILED_RECONNECTION:
{ {
pid = nxagentFailedReconnectionDialogPid; pid = nxagentFailedReconnectionDialogPid;
break; break;
} }
case DIALOG_ENABLE_DESKTOP_RESIZE_MODE: case DIALOG_ENABLE_DESKTOP_RESIZE_MODE:
{ {
pid = nxagentEnableRandRModeDialogPid; pid = nxagentEnableRandRModeDialogPid;
break; break;
} }
case DIALOG_DISABLE_DESKTOP_RESIZE_MODE: case DIALOG_DISABLE_DESKTOP_RESIZE_MODE:
{ {
pid = nxagentDisableRandRModeDialogPid; pid = nxagentDisableRandRModeDialogPid;
break; break;
} }
case DIALOG_ENABLE_DEFER_MODE: case DIALOG_ENABLE_DEFER_MODE:
{ {
pid = nxagentEnableDeferModePid; pid = nxagentEnableDeferModePid;
break; break;
} }
case DIALOG_DISABLE_DEFER_MODE: case DIALOG_DISABLE_DEFER_MODE:
{ {
pid = nxagentDisableDeferModePid; pid = nxagentDisableDeferModePid;
break; break;
} }
case DIALOG_ENABLE_AUTOGRAB_MODE: case DIALOG_ENABLE_AUTOGRAB_MODE:
{ {
pid = nxagentEnableAutograbModePid; pid = nxagentEnableAutograbModePid;
break; break;
} }
case DIALOG_DISABLE_AUTOGRAB_MODE: case DIALOG_DISABLE_AUTOGRAB_MODE:
{ {
pid = nxagentDisableAutograbModePid; pid = nxagentDisableAutograbModePid;
break; break;
} }
default: default:
...@@ -577,13 +550,11 @@ void nxagentTerminateDialog(DialogType type) ...@@ -577,13 +550,11 @@ void nxagentTerminateDialog(DialogType type)
void nxagentTerminateDialogs(void) void nxagentTerminateDialogs(void)
{ {
DialogType type;
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentTerminateDialogs: Terminating all the running dialogs.\n"); fprintf(stderr, "nxagentTerminateDialogs: Terminating all the running dialogs.\n");
#endif #endif
for (type = DIALOG_FIRST_TAG; type < DIALOG_LAST_TAG; type++) for (DialogType type = DIALOG_FIRST_TAG; type < DIALOG_LAST_TAG; type++)
{ {
nxagentTerminateDialog(type); nxagentTerminateDialog(type);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment