From: <oms...@us...> - 2006-03-31 21:19:18
|
Revision: 77 Author: omschaub Date: 2006-03-31 13:19:13 -0800 (Fri, 31 Mar 2006) ViewCVS: http://svn.sourceforge.net/azsmrc/?rev=77&view=rev Log Message: ----------- Added Option to allow the user to NOT show the exit confirm dialog from the main window.. works on File->Exit as well as the X for the shell Modified Paths: -------------- trunk/azsmrc/lbms/azsmrc/remote/client/swtgui/DownloadManagerShell.java trunk/azsmrc/lbms/azsmrc/remote/client/swtgui/tabs/PreferencesTab.java Modified: trunk/azsmrc/lbms/azsmrc/remote/client/swtgui/DownloadManagerShell.java =================================================================== --- trunk/azsmrc/lbms/azsmrc/remote/client/swtgui/DownloadManagerShell.java 2006-03-31 20:59:33 UTC (rev 76) +++ trunk/azsmrc/lbms/azsmrc/remote/client/swtgui/DownloadManagerShell.java 2006-03-31 21:19:13 UTC (rev 77) @@ -274,17 +274,22 @@ exitItem.setAccelerator (SWT.CTRL + 'Q'); exitItem.addListener (SWT.Selection, new Listener () { public void handleEvent (Event e) { - MessageBox messageBox = new MessageBox(DOWNLOAD_MANAGER_SHELL, SWT.ICON_QUESTION | SWT.OK | SWT.CANCEL); - messageBox.setText("Confirm Exit"); - messageBox.setMessage("Are you sure you wish to exit AzSMRC entirely?"); - int response = messageBox.open(); - switch (response){ - case SWT.OK: - RCMain.getRCMain().close(); - break; - case SWT.CANCEL: - break; - } + if(Boolean.parseBoolean(RCMain.getRCMain().getProperties().getProperty("confirm.exit","true"))){ + MessageBox messageBox = new MessageBox(DOWNLOAD_MANAGER_SHELL, SWT.ICON_QUESTION | SWT.OK | SWT.CANCEL); + messageBox.setText("Confirm Exit"); + messageBox.setMessage("Are you sure you wish to exit AzSMRC entirely?"); + int response = messageBox.open(); + switch (response){ + case SWT.OK: + RCMain.getRCMain().close(); + break; + case SWT.CANCEL: + break; + } + }else{ + RCMain.getRCMain().close(); + } + } }); @@ -1500,20 +1505,34 @@ //Save Everything! RCMain.getRCMain().saveConfig(); - DOWNLOAD_MANAGER_SHELL = null; + if(!Boolean.parseBoolean(RCMain.getRCMain().getProperties().getProperty("tray.exit","true"))){ - RCMain.getRCMain().close(); + if(Boolean.parseBoolean(RCMain.getRCMain().getProperties().getProperty("confirm.exit","true"))){ + MessageBox messageBox = new MessageBox(DOWNLOAD_MANAGER_SHELL, SWT.ICON_QUESTION | SWT.OK | SWT.CANCEL); + messageBox.setText("Confirm Exit"); + messageBox.setMessage("Are you sure you wish to exit AzSMRC entirely?"); + int response = messageBox.open(); + switch (response){ + case SWT.OK: + RCMain.getRCMain().close(); + break; + case SWT.CANCEL: + DOWNLOAD_MANAGER_SHELL = null; + RCMain.getRCMain().openMainWindow(); + break; + } + }else{ + RCMain.getRCMain().close(); + } } - + DOWNLOAD_MANAGER_SHELL = null; } public void shellDeactivated(ShellEvent arg0) { - // TODO Auto-generated method stub } public void shellDeiconified(ShellEvent arg0) { - // TODO Auto-generated method stub } Modified: trunk/azsmrc/lbms/azsmrc/remote/client/swtgui/tabs/PreferencesTab.java =================================================================== --- trunk/azsmrc/lbms/azsmrc/remote/client/swtgui/tabs/PreferencesTab.java 2006-03-31 20:59:33 UTC (rev 76) +++ trunk/azsmrc/lbms/azsmrc/remote/client/swtgui/tabs/PreferencesTab.java 2006-03-31 21:19:13 UTC (rev 77) @@ -44,7 +44,8 @@ private Text updateIntervalOpen_Text, updateIntervalClosed_Text; private Button autoOpen, autoConnect, autoUpdateCheck, autoUpdate; - private Button trayMinimize, trayExit, showSplash, popupsEnabled, autoClipboard, autoConsole; + private Button trayMinimize, trayExit, showSplash, popupsEnabled; + private Button autoClipboard, autoConsole, exitConfirm; private Button updateBeta; private Composite cOptions; @@ -348,6 +349,14 @@ trayExit.setSelection(Boolean.parseBoolean(properties.getProperty("tray.exit","true"))?true:false); addModListener(trayExit,SWT.Selection); + //Exit Confirmation + exitConfirm = new Button(composite,SWT.CHECK); + gridData = new GridData(GridData.GRAB_HORIZONTAL); + gridData.horizontalSpan = 2; + exitConfirm.setLayoutData(gridData); + exitConfirm.setText("Show confirmation dialog on exit"); + exitConfirm.setSelection(Boolean.parseBoolean(properties.getProperty("confirm.exit","true"))?true:false); + addModListener(exitConfirm,SWT.Selection); //auto console open autoConsole = new Button(composite,SWT.CHECK); @@ -632,6 +641,15 @@ properties.setProperty("tray.exit","false"); } + + //Store Confirm exit + if(exitConfirm != null && !exitConfirm.isDisposed()){ + if(exitConfirm.getSelection()) + properties.setProperty("confirm.exit", "true"); + else + properties.setProperty("confirm.exit", "false"); + } + //Store popupsEnabled if(popupsEnabled != null && !popupsEnabled.isDisposed()){ if(popupsEnabled.getSelection()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |