⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 faccountproperties.pas

📁 siMail, siMail, siMail, siMail
💻 PAS
📖 第 1 页 / 共 2 页
字号:
(*
# (C) Copyright 2003
# Miha Vrhovnik, miha.vrhovnik@cordia.si
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
# The Initial Developer of the Original Code is Miha Vrhovnik (Slovenia).
# Portions created by Miha Vrhovnik are Copyright (c)2003.
# All Rights Reserved.
#==============================================================================
# Contributor(s):
#==============================================================================
# History: see whats new.txt from distribution package
#==============================================================================
*)

unit fAccountProperties;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, ComCtrls, Buttons, account, OmniXMLConf,
  signatures, VirtualTrees, GPanel;

type
  TfrmAccountProperties = class(TForm)
    pc: TPageControl;
    TabSheet1: TTabSheet;
    TabSheet2: TTabSheet;
    TabSheet3: TTabSheet;
    Label8: TLabel;
    txtYourName: TEdit;
    Label24: TLabel;
    txtOrganization: TEdit;
    Label10: TLabel;
    txtEmail: TEdit;
    Label23: TLabel;
    txtReplyEmail: TEdit;
    Label12: TLabel;
    txtIncoming: TEdit;
    Label1: TLabel;
    txtPOP3Port: TEdit;
    txtPOP3Timeout: TEdit;
    Label2: TLabel;
    txtLoginUser1: TEdit;
    Label9: TLabel;
    txtLoginPwd1: TEdit;
    Label7: TLabel;
    cmboxServerType: TComboBox;
    Label3: TLabel;
    cmboxSmtpAuth: TComboBox;
    Label21: TLabel;
    txtOutgoing: TEdit;
    Label13: TLabel;
    txtLoginUser2: TEdit;
    Label26: TLabel;
    Label27: TLabel;
    txtLoginPwd2: TEdit;
    chkSamePwd: TCheckBox;
    TabSheet4: TTabSheet;
    gbLeave: TGroupBox;
    Label4: TLabel;
    Label5: TLabel;
    txtRemoveAfter: TEdit;
    chkboxLeave: TCheckBox;
    txtMaxSize: TEdit;
    Label11: TLabel;
    Label14: TLabel;
    txtSMTPPort: TEdit;
    Label15: TLabel;
    txtSMTPTimeout: TEdit;
    chkboxCheck: TCheckBox;
    txtCheckEvery: TEdit;
    cmboxCheckEvery: TComboBox;
    TabSheet5: TTabSheet;
    gbNotfy: TGroupBox;
    txtSound: TEdit;
    chkboxNotify: TCheckBox;
    chkboxPlay: TCheckBox;
    cmdSound: TBitBtn;
    cmboxNotificationDisplay: TComboBox;
    chkboxNotificationDisplay: TCheckBox;
    OpenDialog1: TOpenDialog;
    cmboxSecurePop: TComboBox;
    Label17: TLabel;
    cmboxDeleteTrash: TCheckBox;
    TabSheet6: TTabSheet;
    Label16: TLabel;
    cmboxSignature: TComboBox;
    Label18: TLabel;
    cmboxSecureSmtp: TComboBox;
    Label25: TLabel;
    chkHeaders2: TCheckBox;
    chkHeaders1: TCheckBox;
    chkboxEmptyTrash: TCheckBox;
    chkboxEmptyJunk: TCheckBox;
    txtAliases: TMemo;
    GPanel1: TGPanel;
    lblCaption: TLabel;
    lstSettings: TVirtualStringTree;
    cmdOK: TButton;
    cmdCancel: TButton;
    cmdHelp: TButton;
    Label6: TLabel;
    TabSheet7: TTabSheet;
    procedure FormShow(Sender: TObject);
    procedure FormShortCut(var Msg: TWMKey; var Handled: Boolean);
    procedure chkSamePwdClick(Sender: TObject);
    procedure cmboxSmtpAuthClick(Sender: TObject);
    procedure chkboxLeaveClick(Sender: TObject);
    procedure chkboxNotifyClick(Sender: TObject);
    procedure chkboxCheckClick(Sender: TObject);
    procedure chkboxPlayClick(Sender: TObject);
    procedure chkboxNotificationDisplayClick(Sender: TObject);
    procedure cmdSoundClick(Sender: TObject);
    procedure txtExit(Sender: TObject);
    procedure txtChange(Sender: TObject);
    procedure cmdCancelClick(Sender: TObject);
    procedure cmdOKClick(Sender: TObject);
    procedure FormHide(Sender: TObject);
    procedure chkHeaders1Click(Sender: TObject);
    procedure chkHeaders2Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure lstSettingsFocusChanged(Sender: TBaseVirtualTree;
      Node: PVirtualNode; Column: TColumnIndex);
    procedure lstSettingsGetNodeDataSize(Sender: TBaseVirtualTree;
      var NodeDataSize: Integer);
    procedure lstSettingsGetText(Sender: TBaseVirtualTree;
      Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
      var CellText: WideString);
  private
    { Private declarations }
    askForSave: Boolean;
    procedure LoadSettings;
    procedure SaveSettings;
    procedure loadTheme;
  public
    { Public declarations }
  end;

var
  frmAccountProperties: TfrmAccountProperties;

implementation

uses
  mailBox, fMain, gnugettext, defFldrs, dImages;

{$R *.dfm}

type TTreeSettings = record
    Caption: String;
    TabNo: Integer;
end;
type PTreeSettings = ^TTreeSettings;

procedure TfrmAccountProperties.FormShow(Sender: TObject);
var nodeIncoming: PVirtualNode;
var nodeOutgoing: PVirtualNode;
begin
  //translate me
  TranslateComponent(Self);

  LoadSettings;

  lblCaption.Caption := '';
  lstSettings.Clear;
  pc.ActivePageIndex := 0;

  with PTreeSettings(lstSettings.GetNodeData(lstSettings.AddChild(nil)))^ do begin
    Caption := _('Personal info');
    TabNo := 1;
  end;

  //fill up settings tree
  nodeIncoming := lstSettings.AddChild(nil);
  with PTreeSettings(lstSettings.GetNodeData(nodeIncoming))^ do begin
    Caption := _('Incoming messages');
    TabNo := -1;
  end;

  with PTreeSettings(lstSettings.GetNodeData(lstSettings.AddChild(nodeIncoming)))^ do
  begin
    Caption := _('Server');
    TabNo := 2;
  end;

  with PTreeSettings(lstSettings.GetNodeData(lstSettings.AddChild(nodeIncoming)))^ do
  begin
    Caption := _('Settings');
    TabNo := 3;
  end;

  nodeOutgoing:=lstSettings.AddChild(nil);
  with PTreeSettings(lstSettings.GetNodeData(nodeOutgoing))^ do begin
    Caption := _('Outgoing messages');
    TabNo := -1;
  end;

   with PTreeSettings(lstSettings.GetNodeData(lstSettings.AddChild(nodeOutgoing)))^ do begin
    Caption := _('Server');
    TabNo := 4;
  end;

  with PTreeSettings(lstSettings.GetNodeData(lstSettings.AddChild(nodeOutgoing)))^ do begin
    Caption := _('Settings');
    TabNo := 5;
  end;

   with PTreeSettings(lstSettings.GetNodeData(lstSettings.AddChild(nil)))^ do begin
    Caption := _('Other');
    TabNo := 6;
  end;

  lstSettings.FullExpand;
  loadTheme;

  //read self position & size
  frmMailbox.Profile.Config.ReadControlSettings(Self);
end;

procedure TfrmAccountProperties.FormShortCut(var Msg: TWMKey; var Handled: Boolean);
begin
  if msg.CharCode = 27 then begin
    Self.Close;
    Handled := True;
  end;
end;

procedure TfrmAccountProperties.LoadSettings;
var i: Integer;
begin
  with frmMailbox.Profile.Accounts[frmMailbox.SelectedAccount] do begin
    //personal info
    txtYourName.Text := YourName;
    txtOrganization.Text := Organization;
    txtEmail.Text := EMail;
    txtReplyEmail.Text := ReplyEMail;
    txtAliases.Lines.Text := Aliases;

    cmboxSignature.Clear;
    cmboxSignature.Items.AddObject(_('<none>'), Pointer( -1));
    for i := 0 to frmMailbox.Profile.Signatures.Count - 1 do begin
      cmboxSignature.Items.AddObject(
        frmMailbox.Profile.Signatures.Signature[i].name, Pointer(i));
    end;

    if DefaultSignature = '' then
      cmboxSignature.ItemIndex := 0
    else
      cmboxSignature.ItemIndex := cmboxSignature.Items.IndexOf(DefaultSignature);

    //incoming (server)
    cmboxServerType.ItemIndex := Integer(AccountType);
    case AccountType of
      accPOP: begin
        txtLoginPwd1.Text := POP3Password;
        txtPOP3Port.Text := IntToStr(POP3Port);
        txtIncoming.Text := POP3Server;
        txtPOP3Timeout.Text := IntToStr(POP3Timeout);
        txtLoginUser1.Text := POP3UserName;

        cmboxSecurePop.ItemIndex := Integer(POP3SecureConnection);

        txtLoginPwd2.Text := SMTPPassword;
        txtSMTPPort.Text := IntToStr(SMTPPort);
        txtOutGoing.Text := SMTPServer;
        txtSMTPTimeout.Text := IntToStr(SMTPTimeout);
        txtLoginUser2.Text := SMTPUserName;
        cmboxSmtpAuth.ItemIndex := Integer(SMTPAuthType);
        chkSamePwd.Checked := SMTPSamePwdAsForIncoming;
        cmboxSecureSmtp.ItemIndex := Integer(SMTPSecureConnection);
      end
    end;

    //incoming (settings)
    chkboxLeave.Checked := IncomingLeaveMail;
    txtRemoveAfter.Text := IntToStr(IncomingLeaveMailDays);
    chkHeaders1.Checked := IncomingShowHeaders;
    chkHeaders2.Checked := IncomingShowHeadersLarger;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -