IMAP: close folder config window on error, show message.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011, Haiku, Inc. All rights reserved.
|
* Copyright 2011-2013, Haiku, Inc. All rights reserved.
|
||||||
* Copyright 2011, Clemens Zeidler <[email protected]>
|
* Copyright 2011, Clemens Zeidler <[email protected]>
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include "FolderConfigWindow.h"
|
#include "FolderConfigWindow.h"
|
||||||
|
|
||||||
|
#include <Alert.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
#include <ControlLook.h>
|
#include <ControlLook.h>
|
||||||
@@ -202,7 +203,6 @@ EditListView::EditListView(const char* name, list_view_type type, uint32 flags)
|
|||||||
BListView(name, type, flags),
|
BListView(name, type, flags),
|
||||||
fLastMouseDown(NULL)
|
fLastMouseDown(NULL)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -315,7 +315,19 @@ FolderConfigWindow::_LoadFolders()
|
|||||||
status_t status = fProtocol.Connect(fSettings.ServerAddress(),
|
status_t status = fProtocol.Connect(fSettings.ServerAddress(),
|
||||||
fSettings.Username(), fSettings.Password(), fSettings.UseSSL());
|
fSettings.Username(), fSettings.Password(), fSettings.UseSSL());
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
// TODO: show error message
|
statusWindow->PostMessage(B_QUIT_REQUESTED);
|
||||||
|
|
||||||
|
// Show error message on screen
|
||||||
|
BString message = B_TRANSLATE("Could not connect to server "
|
||||||
|
"\"%server%\":\n%error%");
|
||||||
|
message.ReplaceFirst("%server%", fSettings.Server());
|
||||||
|
message.ReplaceFirst("%error%", strerror(status));
|
||||||
|
BAlert* alert = new BAlert("IMAP error", message.String(),
|
||||||
|
B_TRANSLATE("Ok"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
|
||||||
|
alert->Go();
|
||||||
|
|
||||||
|
PostMessage(B_QUIT_REQUESTED);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: don't get all of them at once, but retrieve them level by level
|
// TODO: don't get all of them at once, but retrieve them level by level
|
||||||
|
|||||||
Reference in New Issue
Block a user