Properly set the download listener on new tabs. This fixes the Downloads window
not popping up for subsequent tabs. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@192 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
@@ -94,6 +94,7 @@ LauncherWindow::LauncherWindow(BRect frame, const BMessenger& downloadListener,
|
||||
: WebViewWindow(frame, "HaikuLauncher",
|
||||
B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
|
||||
B_AUTO_UPDATE_SIZE_LIMITS | B_ASYNCHRONOUS_CONTROLS)
|
||||
, m_downloadListener(downloadListener)
|
||||
{
|
||||
m_tabView = new WebTabView("tabview", BMessenger(this));
|
||||
m_tabView->setTarget(BMessenger(this));
|
||||
@@ -228,7 +229,6 @@ LauncherWindow::LauncherWindow(BRect frame, const BMessenger& downloadListener,
|
||||
}
|
||||
|
||||
newTab("", true);
|
||||
currentWebView()->WebPage()->SetDownloadListener(downloadListener);
|
||||
|
||||
m_findGroup->SetVisible(false);
|
||||
|
||||
@@ -410,6 +410,8 @@ void LauncherWindow::newTab(const BString& url, bool select)
|
||||
{
|
||||
// Executed in app thread (new BWebPage needs to be created in app thread).
|
||||
BWebView* webView = new BWebView("web_view");
|
||||
webView->WebPage()->SetDownloadListener(m_downloadListener);
|
||||
|
||||
m_tabView->AddTab(webView);
|
||||
m_tabView->TabAt(m_tabView->CountTabs() - 1)->SetLabel("New tab");
|
||||
// TODO: Remove when BTabView is fixed...
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define LauncherWindow_h
|
||||
|
||||
#include "WebViewWindow.h"
|
||||
#include <Messenger.h>
|
||||
#include <String.h>
|
||||
|
||||
class BButton;
|
||||
@@ -92,6 +93,7 @@ private:
|
||||
void updateTitle(const BString &title);
|
||||
|
||||
private:
|
||||
BMessenger m_downloadListener;
|
||||
BMenuBar* m_menuBar;
|
||||
BMenu* m_goMenu;
|
||||
IconButton* m_BackButton;
|
||||
|
||||
Reference in New Issue
Block a user