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