Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeshkova committed Dec 3, 2013
1 parent 537534d commit b98c76e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
6 changes: 2 additions & 4 deletions declarative/WindowCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ MozWindowCreator::MozWindowCreator(const QString& aQmlstring, const bool& aGlwid
}

quint32
MozWindowCreator::newWindowRequested(const QString& url, const unsigned& aParentID, QNewWindowResponse* response)
MozWindowCreator::createView(const QString &url, const quint32 &aParentID)
{
QUrl newUrl;
if (!url.contains(QString("://")) && !url.startsWith(QString("about:"))) {
Expand Down Expand Up @@ -68,9 +68,7 @@ MozWindowCreator::newWindowRequested(const QString& url, const unsigned& aParent
view->showFullScreen();
else
view->show();
if (response) {
response->setNewWindowID(uniqueID);
}
return uniqueID;
}

void
Expand Down
8 changes: 3 additions & 5 deletions declarative/WindowCreator.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#include <QDeclarativeView>
#include "qmozviewcreator.h"

class QNewWindowResponse;
class MozWindowCreator : public QObject
class MozWindowCreator : public QMozViewCreator
{
Q_OBJECT
public:
MozWindowCreator(const QString& aQmlstring, const bool& aGlwidget, const bool& aIsFullScreen);
QDeclarativeView* CreateNewWindow(const QString& url = QString("about:blank"), quint32* aUniqueID = 0, quint32 aParentID = 0);
public Q_SLOTS:
quint32 newWindowRequested(const QString& url, const unsigned& aParentID, QNewWindowResponse* response);
virtual quint32 createView(const QString &url, const quint32 &parentId);
void bringToFront();

public:
Expand Down
4 changes: 1 addition & 3 deletions declarative/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,7 @@ int main(int argc, char *argv[])

qDebug() << "Starting Application!!!";

QObject::connect(QMozContext::GetInstance(),
SIGNAL(newWindowRequested(const QString&, const unsigned&, QNewWindowResponse*)),
&winCreator, SLOT(newWindowRequested(const QString&, const unsigned&, QNewWindowResponse*)));
QMozContext::GetInstance()->setViewCreator(&winCreator);

QString componentPath(DEFAULT_COMPONENTS_PATH);
qDebug() << "Load components from:" << componentPath + QString("/components") + QString("/EmbedLiteBinComponents.manifest");
Expand Down
2 changes: 1 addition & 1 deletion declarative/qml/OverlayRightMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Rectangle {
iconSource: "../icons/plus.png"

onClicked: {
MozContext.newWindow("about:blank", 0)
MozContext.createView("about:blank", 0)
root.toggle()
}
}
Expand Down

0 comments on commit b98c76e

Please sign in to comment.