1 package SnowMailClient.view.accounts; 2 3 import SnowMailClient.SnowMailClientApp; 4 import SnowMailClient.model.accounts.*; 5 import SnowMailClient.view.actions.*; 6 import SnowMailClient.utils.storage.*; 7 import snow.utils.gui.*; 8 import SnowMailClient.view.dialogs.*; 9 import SnowMailClient.Language.Language; 10 import snow.lookandfeel.*; 11 import java.util.*; 12 import java.awt.*; 13 import javax.swing.*; 14 import javax.swing.border.*; 15 import javax.swing.event.*; 16 17 24 public class SnowraverAccountDialog extends JDialog 25 { 26 private static String TITLE = Language.translate("Snowraver Account Functions"); 27 28 public SnowraverAccountDialog(AccountsEditor accountsEditor, MailAccount account) 29 { 30 super(accountsEditor, TITLE, true); 31 this.getContentPane().setLayout(new BorderLayout()); 32 33 boolean admin = false; 34 try 35 { 36 admin = account.getCheckedPopConnection().hasAdminPrivileges(); 37 } 38 catch(Exception e) {} 39 40 41 CloseControlPanel ccp = new CloseControlPanel(this, false, false, Language.translate("Close")); 43 this.getContentPane().add(ccp, BorderLayout.SOUTH); 44 45 JPanel functionsPanel_ = new JPanel(); GridLayout3 grid = new GridLayout3(2,functionsPanel_); 48 functionsPanel_.setBorder(new EmptyBorder(5,5,5,5)); 49 this.getContentPane().add(functionsPanel_, BorderLayout.CENTER); 50 51 JButton chu = new JButton(new ChangeAccountPassword(account, this)); 52 chu.setFont(ThemesManager.getInstance().getSmallFont()); 53 grid.add(chu, true); 54 grid.add(new JLabel(Language.translate("Change the password for %",account.getAddress())), false); 55 56 if(admin) 57 { 58 setTitle(TITLE+Language.translate(" [Admin Mode]")); 59 JButton anu = new JButton(new AddNewUser(this, account)); 60 anu.setFont(ThemesManager.getInstance().getSmallFont()); 61 grid.add(anu, true); 62 grid.add(new JLabel(Language.translate("Add a new user@%", account.getPop())), false); 63 64 JButton sup = new JButton(new SetUserPass(this, account)); 65 sup.setFont(ThemesManager.getInstance().getSmallFont()); 66 grid.add(sup, true); 67 grid.add(new JLabel(Language.translate("Set a user password")), false); 68 69 JButton vsl = new JButton(new ViewServerLog(this, account)); 70 vsl.setFont(ThemesManager.getInstance().getSmallFont()); 71 grid.add(vsl, true); 72 grid.add(new JLabel(Language.translate("View the server log from %",account.getPop())), false); 73 } 74 pack(); 75 SnowMailClientApp.centerComponentOnMainFrame(this); 76 setVisible(true); 77 } 78 79 } | Popular Tags |