diff --git a/src/apps/webpositive/LauncherWindow.cpp b/src/apps/webpositive/LauncherWindow.cpp index 872da78b7f..7310925007 100644 --- a/src/apps/webpositive/LauncherWindow.cpp +++ b/src/apps/webpositive/LauncherWindow.cpp @@ -39,11 +39,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -230,6 +232,32 @@ void LauncherWindow::MessageReceived(BMessage* message) webView()->goForward(); break; + case B_SIMPLE_DATA: { + // User possibly dropped files on this window. + // If there is more than one entry_ref, let the app handle it (open one + // new page per ref). If there is one ref, open it in this window. + type_code type; + int32 countFound; + if (message->GetInfo("refs", &type, &countFound) != B_OK + || type != B_REF_TYPE) { + break; + } + if (countFound > 1) { + message->what = B_REFS_RECEIVED; + be_app->PostMessage(message); + break; + } + entry_ref ref; + if (message->FindRef("refs", &ref) != B_OK) + break; + BEntry entry(&ref, true); + BPath path; + if (!entry.Exists() || entry.GetPath(&path) != B_OK) + break; + webView()->loadRequest(path.Path()); + break; + } + case TEXT_SIZE_INCREASE: webView()->increaseTextSize(); break;