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

📄 faccountproperties.pas

📁 siMail, siMail, siMail, siMail
💻 PAS
📖 第 1 页 / 共 2 页
字号:
    txtMaxSize.Text := IntToStr(IncomingMaxMailSize);
    chkboxCheck.Checked := IncomingCheck;
    txtCheckEvery.Text := IntToStr(IncomingTime);
    cmboxCheckEvery.ItemIndex := Integer(IncomingTimeUnit);

    //other settings
    //notfy
    chkboxNotify.Checked := NotificationNotify;
    chkboxPlay.Checked := NotificationPlaySound;
    txtSound.Text := NotificationSoundFile;
    chkboxNotificationDisplay.Checked := NotificationDisplay;
    cmboxNotificationDisplay.ItemIndex := Integer(NotificationType);
    //empty xx on exit
    chkboxEmptyTrash.Checked := EmptyTrashOnExit;
    chkboxEmptyJunk.Checked := EmptyJunkMailOnExit;
  end;
  askForSave := False;
end;

procedure TfrmAccountProperties.chkSamePwdClick(Sender: TObject);
begin
  Label26.Enabled := chkSamePwd.Checked;
  Label27.Enabled := chkSamePwd.Checked;
  txtLoginUser2.Enabled := chkSamePwd.Checked;
  txtLoginPwd2.Enabled := chkSamePwd.Checked;
  askForSave := True;
end;

procedure TfrmAccountProperties.cmboxSmtpAuthClick(Sender: TObject);
begin
  if cmboxSmtpAuth.ItemIndex = 0 then
    chkSamePwd.Enabled := False
  else
    chkSamePwd.Enabled := True;
end;

procedure TfrmAccountProperties.chkboxLeaveClick(Sender: TObject);
begin
  gbLeave.Enabled := chkboxLeave.Checked;
  askForSave := True;
end;

procedure TfrmAccountProperties.chkboxNotifyClick(Sender: TObject);
begin
  gbNotfy.Enabled := chkboxNotify.Checked;
  askForSave := True;
end;

procedure TfrmAccountProperties.chkboxCheckClick(Sender: TObject);
begin
  txtCheckEvery.Enabled := chkboxCheck.Checked;
  cmboxCheckEvery.Enabled := chkboxCheck.Checked;
  askForSave := True;
end;

procedure TfrmAccountProperties.chkboxPlayClick(Sender: TObject);
begin
  txtSound.Enabled := chkboxPlay.Checked;
  cmdSound.Enabled := chkboxPlay.Checked;
  askForSave := True;
end;

procedure TfrmAccountProperties.chkboxNotificationDisplayClick(Sender: TObject);
begin
  cmboxNotificationDisplay.Enabled := chkboxNotificationDisplay.Checked;
  askForSave := True;
end;

procedure TfrmAccountProperties.cmdSoundClick(Sender: TObject);
begin
  with OpenDialog1 do begin
    Filter := _('*.wav (Music File)| *.wav');
    if Execute then txtSound.Text := FileName;
  end;
end;

procedure TfrmAccountProperties.txtExit(Sender: TObject);
begin
  try
    StrToInt((Sender as TEdit).Text);
  except
    on EConvertError do begin
      ShowMessage(_('Please enter the number!'));
      (Sender as TEdit).SetFocus;
      Exit;
    end;
  end;
end;

procedure TfrmAccountProperties.SaveSettings;
begin
  with frmMailbox.Profile.Accounts[frmMailbox.SelectedAccount] do begin
    //personal info
    YourName := txtYourName.Text;
    Organization := txtOrganization.Text;
    EMail := txtEmail.Text;
    ReplyEMail := txtReplyEmail.Text;
    if cmboxSignature.ItemIndex = 0 then
      DefaultSignature := ''
    else
      DefaultSignature := cmboxSignature.Items[cmboxSignature.ItemIndex];
    Aliases := txtAliases.Lines.Text;

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

        POP3SecureConnection := TSecureConnection(cmboxSecurePop.ItemIndex);

        if chkSamePwd.Checked and not chkSamePwd.Checked then begin
          SMTPUserName := '';
          SMTPPassword := '';
        end
        else begin
          SMTPUserName := txtLoginUser2.Text;
          SMTPPassword := txtLoginPwd2.Text;
        end;

        SMTPPort := StrToInt(txtSMTPPort.Text);
        SMTPServer := txtOutGoing.Text;
        SMTPTimeout := StrToInt(txtSMTPTimeout.Text);
        SMTPAuthType := TSMTPAuthType(cmboxSmtpAuth.ItemIndex);
        SMTPSamePwdAsForIncoming := chkSamePwd.Checked;
        SMTPSecureConnection := TSecureConnection(cmboxSecureSmtp.ItemIndex);
      end
    end;

    //incoming (settings)
    IncomingLeaveMail := chkboxLeave.Checked;
    IncomingLeaveMailDays := StrToInt(txtRemoveAfter.Text);
    IncomingShowHeaders := chkHeaders1.Checked;
    IncomingShowHeadersLarger := chkHeaders2.Checked;
    IncomingMaxMailSize := StrToInt(txtMaxSize.Text);
    IncomingCheck := chkboxCheck.Checked;
    IncomingTime := StrToInt(txtCheckEvery.Text);
    IncomingTimeUnit := TIncomingTimeUnit(cmboxCheckEvery.ItemIndex);

    //other
    //notfy settings
    NotificationNotify := chkboxNotify.Checked;
    NotificationPlaySound := chkboxPlay.Checked;
    NotificationSoundFile := txtSound.Text;
    NotificationDisplay := chkboxNotificationDisplay.Checked;
    NotificationType := TNotificationType(cmboxNotificationDisplay.ItemIndex);
    //empty xx on exit
    EmptyTrashOnExit := chkboxEmptyTrash.Checked;
    EmptyJunkMailOnExit := chkboxEmptyJunk.Checked;
  end;
  askForSave := False;
end;

procedure TfrmAccountProperties.txtChange(Sender: TObject);
begin
  askForSave := True;
end;

procedure TfrmAccountProperties.cmdCancelClick(Sender: TObject);
var i: Integer;
begin
  if askForSave then begin
    //if the answer is yes then we save changes
    i := MessageDlg(_('Do you want to save changes?'), mtConfirmation, [mbYes, mbNo], 0);
    if i = mrYes then SaveSettings;
  end;
  Self.Close;
end;

procedure TfrmAccountProperties.cmdOKClick(Sender: TObject);
begin
  SaveSettings;
  //update mail check intervals
  frmMailbox.UpdateCheckTimer(frmMailbox.SelectedAccount);
  Self.Close;
end;

procedure TfrmAccountProperties.FormHide(Sender: TObject);
begin
  //write self position & size
  frmMailbox.Profile.Config.WriteControlSettings(Self);
end;

procedure TfrmAccountProperties.chkHeaders1Click(Sender: TObject);
begin
  if chkHeaders1.Checked then begin
    chkHeaders2.Enabled := True;
    if chkHeaders2.Checked then txtMaxSize.Enabled := True;
  end
  else begin
    chkHeaders2.Enabled := False;
    txtMaxSize.Enabled := False;
  end;
end;

procedure TfrmAccountProperties.chkHeaders2Click(Sender: TObject);
begin
  if chkHeaders2.Checked then
    txtMaxSize.Enabled := True
  else
    txtMaxSize.Enabled := False;
end;

procedure TfrmAccountProperties.FormCreate(Sender: TObject);
begin
  pc.Top := 0;
  pc.Style := tsFlatButtons;

  //controls are filled at runtime because it is easier for translator
  //to find out where and how to translate items.

  //form: Account properties, control: incoming(server) - Server &Type:
  cmboxServerType.Items.Text := _('POP3' + #13#10 +
                            'IMAP - doesn''t work yet' + #13#10 +
                            'HTTP - doesn''t work yet');

  //form: Account properties, control: incoming(server) - Se&cure connection:
  cmboxSecurePop.Items.Text := _('None' + #13#10 +
                           'Auto TSL' + #13#10 +
                           'Use SSL');

  //form: Account properties, control: incoming(settings) - &Check for new mail every
  cmboxCheckEvery.Items.Text := _('seconds' + #13#10 +
                            'minutes' + #13#10 +
                            'hours');

  //form: Account properties, control: Outgoing (Server) - &Authentication type:
  cmboxSmtpAuth.Items.Text := _('None' + #13#10 +
                          'Automatic');

  //form: Account properties, control: Outgoing (Server) - Se&cure connection:
  cmboxSecureSmtp.Items.Text := _('None' + #13#10 +
                           'Auto TSL' + #13#10 +
                           'Use SSL');

  //form: Account properties, control: Notification - &Display notification
  cmboxNotificationDisplay.Items.Text := ('Show balloon message (Windows XP/ME/2000)' + #13#10 +
                                    'Show notfy window' + #13#10 +
                                    'Show animated character - doesn''t work yet');
end;

procedure TfrmAccountProperties.lstSettingsFocusChanged(
  Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex);
begin
  if lstSettings.GetFirstSelected <> nil then begin
    if PTreeSettings(lstSettings.GetNodeData(Node)).TabNo <> -1 then begin
      if Sender.RootNode <> Node.Parent then
        lblCaption.Caption := PTreeSettings(Sender.GetNodeData(Node.Parent)).Caption + '/' +
          PTreeSettings(Sender.GetNodeData(Node)).Caption
      else
        lblCaption.Caption := PTreeSettings(Sender.GetNodeData(Node)).Caption;
      pc.ActivePageIndex := PTreeSettings(Sender.GetNodeData(Node)).TabNo;
    end
    else begin
      lblCaption.Caption := '';
      pc.ActivePageIndex := 0;
    end;
  end;
end;

procedure TfrmAccountProperties.lstSettingsGetNodeDataSize(
  Sender: TBaseVirtualTree; var NodeDataSize: Integer);
begin
  NodeDataSize := SizeOf(TTreeSettings);
end;

procedure TfrmAccountProperties.lstSettingsGetText(
  Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
  TextType: TVSTTextType; var CellText: WideString);
begin
    CellText := PTreeSettings(Sender.GetNodeData(Node)).Caption;
end;

procedure TfrmAccountProperties.loadTheme;
var f: TFont;
begin
  if frmMailbox.SelectedTheme < 0 then Exit;
  f := TFont.Create;
  lstThemes[frmmailbox.SelectedTheme].Settings.Font.GetFont(f);
  lblCaption.Font.Assign(f);
  FreeAndNil(f);
  GPanel1.Color_1 := lstThemes[frmmailbox.SelectedTheme].Settings.Color.GetStartColor;
  GPanel1.Color_2 := lstThemes[frmmailbox.SelectedTheme].Settings.Color.GetEndColor;
  GPanel1.Color_3 := lstThemes[frmmailbox.SelectedTheme].Settings.Color.GetEndColor;
end;

end.

⌨️ 快捷键说明

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