Popup windows stuff for QGeckoEmbed

This commit is contained in:
Anton Rogaynis 2008-04-23 17:08:31 -04:00
parent 0eb81df954
commit 9ad7f07e13
5 changed files with 16 additions and 4 deletions

View File

@ -75,7 +75,7 @@ EmbedWindowCreator::CreateChromeWindow(nsIWebBrowserChrome *aParent,
if (!qecko)
return NS_ERROR_FAILURE;
newEmbed = qecko;
emit newEmbed->newWindow(newEmbed, aChromeFlags);
emit newEmbed->newWindow(&newEmbed, aChromeFlags);
}
// check to make sure that we made a new window

View File

@ -139,7 +139,7 @@ signals:
void netStart();
void netStop();
void newWindow(QGeckoEmbed *newWindow, int chromeMask);
void newWindow(QGeckoEmbed **newWindow, int chromeMask);
void visibilityChanged(bool visible);
void destroyBrowser();
void openURI(const QString &url);

View File

@ -81,7 +81,8 @@ MyMainWindow::MyMainWindow()
SLOT(slotProgress(int, int)));
connect(qecko, SIGNAL(progressAll(const QString&, int, int)),
SLOT(slotProgress(const QString&, int, int)));
connect(qecko, SIGNAL(newWindow(QGeckoEmbed**, int)),
SLOT(slotNewWindow(QGeckoEmbed**, int)));
connect( location, SIGNAL(returnPressed()), SLOT(changeLocation()));
@ -147,3 +148,13 @@ void MyMainWindow::slotProgress(int current, int max)
{
qDebug("progress %d / %d ", current, max);
}
void MyMainWindow::slotNewWindow(QGeckoEmbed **newWindow, int chromeMask)
{
MyMainWindow *mainWindow = new MyMainWindow();
if(!mainWindow) return;
mainWindow->resize(400, 600);
mainWindow->show();
*newWindow = mainWindow->qecko;
}

View File

@ -29,6 +29,7 @@ public:
private slots:
void slotProgress(int, int);
void slotProgress(const QString &, int, int);
void slotNewWindow(QGeckoEmbed**, int);
private:
QLineEdit *location;