tn5250j/src/org/tn5250j/mailtools SendEMailDialog.java,1.15,1.16

[email protected]
Newsgroups gmane.comp.java.tn5250j.cvs
Message-ID <[email protected]>
Update of /cvsroot/tn5250j/tn5250j/src/org/tn5250j/mailtools
In directory sc8-pr-cvs1:/tmp/cvs-serv12950/src/org/tn5250j/mailtools

Modified Files:
	SendEMailDialog.java 
Log Message:
Update for SendEmail features

Index: SendEMailDialog.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/mailtools/SendEMailDialog.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** SendEMailDialog.java	1 Dec 2003 15:18:55 -0000	1.15
--- SendEMailDialog.java	2 Dec 2003 13:14:47 -0000	1.16
***************
*** 76,80 ****
  	JRadioButton screenshot;
  	JButton browse;
! 	
  
  	/**
--- 76,80 ----
  	JRadioButton screenshot;
  	JButton browse;
!    boolean sendScreen;
  
  	/**
***************
*** 83,88 ****
--- 83,99 ----
  	 * @param parent
  	 * @param session
+     * @param sendScreen
  	 */
  	public SendEMailDialog(Frame parent, Session session) {
+       this(parent,session,true);
+ 	}
+ 
+ 	/**
+ 	 * Constructor to send the screen information
+ 	 *
+ 	 * @param parent
+ 	 * @param session
+ 	 */
+ 	public SendEMailDialog(Frame parent, Session session, boolean sendScreen) {
  
  		if (!isEMailAvailable()) {
***************
*** 95,103 ****
  				null);
  
! 		} 
  		else {
  
  			this.session = session;
  			Screen5250 screen = session.getScreen();
  
  			Object[] message = new Object[1];
--- 106,115 ----
  				null);
  
! 		}
  		else {
  
  			this.session = session;
  			Screen5250 screen = session.getScreen();
+          this.sendScreen = sendScreen;
  
  			Object[] message = new Object[1];
***************
*** 115,119 ****
  					// the parent that the dialog blocks
  					message, // the dialog message array
! 					LangTool.getString("em.title"), 
  					// the title of the dialog window
  					JOptionPane.DEFAULT_OPTION, // option type
--- 127,131 ----
  					// the parent that the dialog blocks
  					message, // the dialog message array
! 					LangTool.getString("em.title"),
  					// the title of the dialog window
  					JOptionPane.DEFAULT_OPTION, // option type
***************
*** 153,157 ****
  
  							sem.setAttachment(sb.toString());
! 						} 
  						else if (graphic.isSelected()){
  
--- 165,169 ----
  
  							sem.setAttachment(sb.toString());
! 						}
  						else if (graphic.isSelected()){
  
***************
*** 177,185 ****
  									f);
  								sem.setFileName(f.getName());
! 							} 
  							catch (Exception ex) {
  								System.out.println(ex.getMessage());
  							}
! 														
  						}
  						else if (attachmentName.getText().length() > 0) {
--- 189,197 ----
  									f);
  								sem.setFileName(f.getName());
! 							}
  							catch (Exception ex) {
  								System.out.println(ex.getMessage());
  							}
! 
  						}
  						else if (attachmentName.getText().length() > 0) {
***************
*** 223,227 ****
  				+ "Please read e-mail.txt file for installation instructions.",
  				"Error", JOptionPane.ERROR_MESSAGE, null);
! 		} 
  		else {
  
--- 235,239 ----
  				+ "Please read e-mail.txt file for installation instructions.",
  				"Error", JOptionPane.ERROR_MESSAGE, null);
! 		}
  		else {
  
***************
*** 353,357 ****
  		text = new JRadioButton(LangTool.getString("em.text"));
  		graphic = new JRadioButton(LangTool.getString("em.graphic"));
! 		normal = new JRadioButton(LangTool.getString("em.normalmail"));
  		screenshot = new JRadioButton(LangTool.getString("em.screenshot"));
  
--- 365,369 ----
  		text = new JRadioButton(LangTool.getString("em.text"));
  		graphic = new JRadioButton(LangTool.getString("em.graphic"));
! 		normal = new JRadioButton(LangTool.getString("em.normalmail"),true);
  		screenshot = new JRadioButton(LangTool.getString("em.screenshot"));
  
***************
*** 364,368 ****
  		mGroup.add(screenshot);
  
- 		normal.setSelected(true);
  		text.setSelected(false);
  		text.setEnabled(false);
--- 376,379 ----
***************
*** 375,378 ****
--- 386,396 ----
  		JLabel fnl = new JLabel(LangTool.getString("em.fileName"));
  		JLabel tom = new JLabel(LangTool.getString("em.typeofmail"));
+ 		
+ 		browse = new JButton(LangTool.getString("em.choosefile"));
+ 		browse.addActionListener(new java.awt.event.ActionListener() {
+ 			public void actionPerformed(ActionEvent e) {
+ 				browse_actionPerformed(e);
+ 			}
+ 		});
  
  		toAddress = new JComboBox();
***************
*** 401,404 ****
--- 419,429 ----
  		});
  
+       if (sendScreen) {
+          screenshot.setSelected(true);
+       }
+       else {
+    		normal.setSelected(true);
+       }
+ 
  		config = null;
  
***************
*** 410,421 ****
  			}
  		}
! 		
! 		browse = new JButton(LangTool.getString("em.choosefile"));
! 		browse.addActionListener(new java.awt.event.ActionListener() {
! 			public void actionPerformed(ActionEvent e) {
! 				browse_actionPerformed(e);
! 			}
! 		});
! 		
  		semp.setBorder(BorderFactory.createEtchedBorder());
  		gbc = new GridBagConstraints();
--- 435,439 ----
  			}
  		}
! 
  		semp.setBorder(BorderFactory.createEtchedBorder());
  		gbc = new GridBagConstraints();
***************
*** 452,456 ****
  		gbc.gridx = 0; gbc.gridy = 2;
  		gbc.anchor = GridBagConstraints.WEST;
! 		gbc.insets = new Insets(5, 10, 5, 5);						
  		semp.add(tol, gbc);
  		gbc = new GridBagConstraints();
--- 470,474 ----
  		gbc.gridx = 0; gbc.gridy = 2;
  		gbc.anchor = GridBagConstraints.WEST;
! 		gbc.insets = new Insets(5, 10, 5, 5);
  		semp.add(tol, gbc);
  		gbc = new GridBagConstraints();
***************
*** 459,468 ****
  		gbc.fill = GridBagConstraints.HORIZONTAL;
  		gbc.anchor = GridBagConstraints.WEST;
! 		gbc.insets = new Insets(5, 5, 5, 10);		
  		semp.add(toAddress, gbc);
  		gbc = new GridBagConstraints();
  		gbc.gridx = 0; gbc.gridy = 3;
  		gbc.anchor = GridBagConstraints.WEST;
! 		gbc.insets = new Insets(5, 10, 5, 5);		
  		semp.add(subl, gbc);
  		gbc = new GridBagConstraints();
--- 477,486 ----
  		gbc.fill = GridBagConstraints.HORIZONTAL;
  		gbc.anchor = GridBagConstraints.WEST;
! 		gbc.insets = new Insets(5, 5, 5, 10);
  		semp.add(toAddress, gbc);
  		gbc = new GridBagConstraints();
  		gbc.gridx = 0; gbc.gridy = 3;
  		gbc.anchor = GridBagConstraints.WEST;
! 		gbc.insets = new Insets(5, 10, 5, 5);
  		semp.add(subl, gbc);
  		gbc = new GridBagConstraints();
***************
*** 470,474 ****
  		gbc.gridwidth = 2;
  		gbc.anchor = GridBagConstraints.WEST;
! 		gbc.insets = new Insets(5, 5, 5, 10);		
  		semp.add(subject, gbc);
  		gbc = new GridBagConstraints();
--- 488,492 ----
  		gbc.gridwidth = 2;
  		gbc.anchor = GridBagConstraints.WEST;
! 		gbc.insets = new Insets(5, 5, 5, 10);
  		semp.add(subject, gbc);
  		gbc = new GridBagConstraints();
***************
*** 476,480 ****
  		gbc.gridheight = 3;
  		gbc.anchor = GridBagConstraints.WEST;
! 		gbc.insets = new Insets(5, 10, 5, 5);		
  		semp.add(bodyl, gbc);
  		gbc = new GridBagConstraints();
--- 494,498 ----
  		gbc.gridheight = 3;
  		gbc.anchor = GridBagConstraints.WEST;
! 		gbc.insets = new Insets(5, 10, 5, 5);
  		semp.add(bodyl, gbc);
  		gbc = new GridBagConstraints();
***************
*** 482,491 ****
  		gbc.gridwidth = 2; gbc.gridheight = 3;
  		gbc.anchor = GridBagConstraints.WEST;
! 		gbc.insets = new Insets(5, 5, 5, 10);		
  		semp.add(bodyScrollPane, gbc);
  		gbc = new GridBagConstraints();
  		gbc.gridx = 0; gbc.gridy = 7;
  		gbc.anchor = GridBagConstraints.WEST;
! 		gbc.insets = new Insets(5, 10, 5, 5);		
  		semp.add(fnl, gbc);
  		gbc = new GridBagConstraints();
--- 500,509 ----
  		gbc.gridwidth = 2; gbc.gridheight = 3;
  		gbc.anchor = GridBagConstraints.WEST;
! 		gbc.insets = new Insets(5, 5, 5, 10);
  		semp.add(bodyScrollPane, gbc);
  		gbc = new GridBagConstraints();
  		gbc.gridx = 0; gbc.gridy = 7;
  		gbc.anchor = GridBagConstraints.WEST;
! 		gbc.insets = new Insets(5, 10, 5, 5);
  		semp.add(fnl, gbc);
  		gbc = new GridBagConstraints();
***************
*** 493,497 ****
  		gbc.gridwidth = 2;
  		gbc.anchor = GridBagConstraints.WEST;
! 		gbc.insets = new Insets(5, 5, 5, 5);		
  		semp.add(attachmentName, gbc);
  		gbc = new GridBagConstraints();
--- 511,515 ----
  		gbc.gridwidth = 2;
  		gbc.anchor = GridBagConstraints.WEST;
! 		gbc.insets = new Insets(5, 5, 5, 5);
  		semp.add(attachmentName, gbc);
  		gbc = new GridBagConstraints();
***************
*** 499,509 ****
  		gbc.gridwidth = 2;
  		gbc.anchor = GridBagConstraints.CENTER;
! 		gbc.insets = new Insets(5, 5, 10, 10);		
! 		semp.add(browse, gbc);		
! 
  		return semp;
  
  	}
! 	
  	private void browse_actionPerformed(ActionEvent e) {
  		String workingDir = System.getProperty("user.dir");
--- 517,527 ----
  		gbc.gridwidth = 2;
  		gbc.anchor = GridBagConstraints.CENTER;
! 		gbc.insets = new Insets(5, 5, 10, 10);
! 		semp.add(browse, gbc);
! 		
  		return semp;
  
  	}
! 
  	private void browse_actionPerformed(ActionEvent e) {
  		String workingDir = System.getProperty("user.dir");
***************
*** 524,535 ****
  		if (text.isSelected()) {
  			attachmentName.setText("tn5250j.txt");
! 		} 
  		else {
  			attachmentName.setText("tn5250j.png");
  		}
- 		browse.setEnabled(false);
  	}
! 	
  	private void setTypeOfMail() {
  		if (normal.isSelected()) {
  			text.setEnabled(false);
--- 542,557 ----
  		if (text.isSelected()) {
  			attachmentName.setText("tn5250j.txt");
! 
! 		}
! 		else if (normal.isSelected()) {
! 			attachmentName.setText("tn5250j.png");
! 		}
  		else {
  			attachmentName.setText("tn5250j.png");
  		}
  	}
! 
  	private void setTypeOfMail() {
+ 
  		if (normal.isSelected()) {
  			text.setEnabled(false);




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.