Fix partial download limit. Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40434 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
454e28d906
commit
3d2622c790
@ -410,6 +410,7 @@ FetchMessageCommand::Handle(const BString& response)
|
||||
if (uid >= 0)
|
||||
fIMAPMailbox.Listener().HeaderFetched(uid, data);
|
||||
|
||||
printf("fFetchBodyLimit %i\n", (int)fFetchBodyLimit);
|
||||
if (fFetchBodyLimit >= 0 && fFetchBodyLimit <= messageSize)
|
||||
return true;
|
||||
|
||||
@ -622,7 +623,8 @@ ExistsHandler::Handle(const BString& response)
|
||||
|
||||
fIMAPMailbox.Listener().NewMessagesToFetch(exists - nMessages);
|
||||
|
||||
command = new FetchMessageCommand(fIMAPMailbox, nMessages + 1, exists);
|
||||
command = new FetchMessageCommand(fIMAPMailbox, nMessages + 1, exists,
|
||||
fIMAPMailbox.FetchBodyLimit());
|
||||
fIMAPMailbox.AddAfterQuakeCommand(command);
|
||||
|
||||
TRACE("EXISTS %i\n", (int)exists);
|
||||
|
@ -54,6 +54,7 @@ public:
|
||||
BPositionIO* data);
|
||||
|
||||
void SetFetchBodyLimit(int32 limit);
|
||||
int32 FetchBodyLimit() { return fFetchBodyLimit; }
|
||||
status_t FetchMessage(int32 messageNumber);
|
||||
status_t FetchMessages(int32 firstMessage,
|
||||
int32 lastMessage);
|
||||
|
@ -62,13 +62,19 @@ BodyDownloadConfig::SetTo(MailAddonSettings& addonSettings)
|
||||
{
|
||||
const BMessage* settings = &addonSettings.Settings();
|
||||
|
||||
if (settings->HasInt32(kPartialDownloadLimit)) {
|
||||
BString kb;
|
||||
kb << int32(settings->FindInt32(kPartialDownloadLimit)/1024);
|
||||
fSizeBox->SetText(kb.String());
|
||||
int32 limit = 0;
|
||||
if (settings->HasInt32(kPartialDownloadLimit))
|
||||
limit = int32(settings->FindInt32(kPartialDownloadLimit) / 1024);
|
||||
if (limit < 0) {
|
||||
fPartialBox->SetValue(B_CONTROL_ON);
|
||||
fSizeBox->SetEnabled(false);
|
||||
} else {
|
||||
BString kb;
|
||||
kb << limit;
|
||||
fSizeBox->SetText(kb);
|
||||
fPartialBox->SetValue(B_CONTROL_ON);
|
||||
} else
|
||||
fSizeBox->SetEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -101,8 +107,11 @@ status_t
|
||||
BodyDownloadConfig::Archive(BMessage* into, bool) const
|
||||
{
|
||||
into->RemoveName(kPartialDownloadLimit);
|
||||
if (fPartialBox->Value())
|
||||
if (fPartialBox->Value() == B_CONTROL_ON)
|
||||
into->AddInt32(kPartialDownloadLimit, atoi(fSizeBox->Text()) * 1024);
|
||||
else
|
||||
into->AddInt32(kPartialDownloadLimit, -1);
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
@ -46,8 +46,8 @@ AutoConfigView::AutoConfigView(BRect rect, AutoConfig &config)
|
||||
// email view
|
||||
topLeft.y += stepSize;
|
||||
rightDown.y += stepSize;
|
||||
fEmailView = new BTextControl(BRect(topLeft, rightDown),
|
||||
"email", "E-mail address:", "", new BMessage(kEMailChangedMsg));
|
||||
fEmailView = new BTextControl(BRect(topLeft, rightDown), "email",
|
||||
"E-mail address:", "", new BMessage(kEMailChangedMsg));
|
||||
fEmailView->SetDivider(divider);
|
||||
AddChild(fEmailView);
|
||||
|
||||
@ -333,8 +333,8 @@ ServerSettingsView::ServerSettingsView(BRect rect, const account_info &info)
|
||||
fInboundEncryptionMenu->MoveTo(10, 80);
|
||||
}
|
||||
if (info.inboundType == IMAP) {
|
||||
item = fInboundEncryptionMenu->Menu()
|
||||
->ItemAt(info.providerInfo.ssl_imap);
|
||||
item = fInboundEncryptionMenu->Menu()->ItemAt(
|
||||
info.providerInfo.ssl_imap);
|
||||
if (item)
|
||||
item->SetMarked(true);
|
||||
fInboundEncryptionMenu->MoveTo(10, 50);
|
||||
@ -361,9 +361,8 @@ ServerSettingsView::ServerSettingsView(BRect rect, const account_info &info)
|
||||
|
||||
serverName = info.providerInfo.smtp_server;
|
||||
fOutboundNameView = new BTextControl(BRect(10, 20, rect.Width() - 20, 30),
|
||||
"outbound", B_TRANSLATE("Server name:"),
|
||||
serverName.String(),
|
||||
new BMessage(kServerChangedMsg));
|
||||
"outbound", B_TRANSLATE("Server name:"), serverName.String(),
|
||||
new BMessage(kServerChangedMsg));
|
||||
fOutboundNameView->SetDivider(divider);
|
||||
|
||||
box->AddChild(fOutboundNameView);
|
||||
@ -371,8 +370,8 @@ ServerSettingsView::ServerSettingsView(BRect rect, const account_info &info)
|
||||
GetAuthEncrMenu(info.outboundProtocol, &fOutboundAuthMenu,
|
||||
&fOutboundEncryptionMenu);
|
||||
if (fOutboundAuthMenu) {
|
||||
BMenuItem *item = fOutboundAuthMenu->Menu()
|
||||
->ItemAt(info.providerInfo.authentification_smtp);
|
||||
BMenuItem *item = fOutboundAuthMenu->Menu()->ItemAt(
|
||||
info.providerInfo.authentification_smtp);
|
||||
if (item)
|
||||
item->SetMarked(true);
|
||||
fOutboundAuthItemStart = item;
|
||||
@ -381,8 +380,8 @@ ServerSettingsView::ServerSettingsView(BRect rect, const account_info &info)
|
||||
fOutboundAuthMenu->MoveTo(10, 50);
|
||||
}
|
||||
if (fOutboundEncryptionMenu) {
|
||||
BMenuItem *item = fOutboundEncryptionMenu->Menu()
|
||||
->ItemAt(info.providerInfo.ssl_smtp);
|
||||
BMenuItem *item = fOutboundEncryptionMenu->Menu()->ItemAt(
|
||||
info.providerInfo.ssl_smtp);
|
||||
if (item)
|
||||
item->SetMarked(true);
|
||||
fOutboundEncrItemStart = item;
|
||||
|
Loading…
x
Reference in New Issue
Block a user