diff --git a/hw/xwin/XWinrc.man.pre b/hw/xwin/XWinrc.man.pre index 4fb436ddd..5c1fb979b 100755 --- a/hw/xwin/XWinrc.man.pre +++ b/hw/xwin/XWinrc.man.pre @@ -65,8 +65,13 @@ system tray area. .TP 8 .B SILENTEXIT The \fBSILENTEXIT\fP keyword, which takes no parameters, disables the -exit confirmation dialog. +exit confirmation dialog if no clients are connected. +.TP 8 +.B FORCEEXIT +The \fBFORCEEXIT\fP keyword, which takes no parameters, disables the +exit confirmation dialog always. Unsaved client work may be lost but +this may be useful if you want no dialogs. .SH Menu instructions .TP 8 diff --git a/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc b/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc index d9c2d4210..1de6e2ab0 100644 --- a/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc +++ b/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc @@ -119,7 +119,7 @@ SysMenu { # "xterm" "uninstall.ico" # } -# SilentExit +SilentExit DEBUG "Done parsing the configuration file..." diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c index 31a3766a6..582b865f5 100755 --- a/hw/xwin/windialogs.c +++ b/hw/xwin/windialogs.c @@ -282,8 +282,9 @@ winDisplayExitDialog (winPrivScreenPtr pScreenPriv) if (liveClients < 0) liveClients = 0; - /* Don't show the exit confirmation dialog if SilentExit is enabled */ - if (pref.fSilentExit && liveClients <= 0) + /* Don't show the exit confirmation dialog if SilentExit & no clients, + or ForceExit, is enabled */ + if ((pref.fSilentExit && liveClients <= 0) || pref.fForceExit) { if (g_hDlgExit != NULL) { @@ -326,7 +327,7 @@ winDisplayExitDialog (winPrivScreenPtr pScreenPriv) GetDlgItem (g_hDlgExit, IDCANCEL), TRUE); } -#define CONNECTED_CLIENTS_FORMAT "There are currently %d clients connected." +#define CONNECTED_CLIENTS_FORMAT "There %s currently %d client%s connected." /* @@ -353,7 +354,9 @@ winExitDlgProc (HWND hDialog, UINT message, /* Format the connected clients string */ pszConnectedClients = Xprintf (CONNECTED_CLIENTS_FORMAT, - s_pScreenPriv->iConnectedClients); + (s_pScreenPriv->iConnectedClients == 1) ? "is" : "are", + s_pScreenPriv->iConnectedClients, + (s_pScreenPriv->iConnectedClients == 1) ? "" : "s"); if (!pszConnectedClients) return TRUE; diff --git a/hw/xwin/winprefs.h b/hw/xwin/winprefs.h index 6d641da6a..4daf47401 100644 --- a/hw/xwin/winprefs.h +++ b/hw/xwin/winprefs.h @@ -143,6 +143,9 @@ typedef struct WINPREFS STYLEITEM *style; int styleItems; + /* Force exit flag */ + Bool fForceExit; + /* Silent exit flag */ Bool fSilentExit; diff --git a/hw/xwin/winprefsyacc.y b/hw/xwin/winprefsyacc.y index 0c2775192..73f165915 100644 --- a/hw/xwin/winprefsyacc.y +++ b/hw/xwin/winprefsyacc.y @@ -92,10 +92,34 @@ extern int yylex(void); int iVal; } -%token NEWLINE MENU LB RB ICONDIRECTORY DEFAULTICON ICONS STYLES -%token TOPMOST MAXIMIZE MINIMIZE BOTTOM NOTITLE OUTLINE NOFRAME DEFAULTSYSMENU -%token SYSMENU ROOTMENU SEPARATOR ATSTART ATEND EXEC ALWAYSONTOP DEBUG -%token RELOAD TRAYICON SILENTEXIT +%token NEWLINE +%token MENU +%token LB +%token RB +%token ICONDIRECTORY +%token DEFAULTICON +%token ICONS +%token STYLES +%token TOPMOST +%token MAXIMIZE +%token MINIMIZE +%token BOTTOM +%token NOTITLE +%token OUTLINE +%token NOFRAME +%token DEFAULTSYSMENU +%token SYSMENU +%token ROOTMENU +%token SEPARATOR +%token ATSTART +%token ATEND +%token EXEC +%token ALWAYSONTOP +%token DEBUG +%token RELOAD +%token TRAYICON +%token FORCEEXIT +%token SILENTEXIT %token STRING %type group1 @@ -128,6 +152,7 @@ command: defaulticon | defaultsysmenu | debug | trayicon + | forceexit | silentexit ; @@ -212,6 +237,9 @@ sysmenulist: sysmenuline sysmenu: SYSMENU LB NEWLINE {OpenSysMenu();} newline_or_nada sysmenulist RB {CloseSysMenu();} ; +forceexit: FORCEEXIT NEWLINE { pref.fForceExit = TRUE; } + ; + silentexit: SILENTEXIT NEWLINE { pref.fSilentExit = TRUE; } ;