Beispiel #1
0
WebPage::WebPage(WebPageManager *manager, QObject *parent) : QWebPage(parent) {
  m_loading = false;
  m_manager = manager;
  m_uuid = QUuid::createUuid().toString();
  m_lastStatus = 0;

  setForwardUnsupportedContent(true);
  loadJavascript();
  setUserStylesheet();

  this->setCustomNetworkAccessManager();

  connect(this, SIGNAL(loadStarted()), this, SLOT(loadStarted()));
  connect(this, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
  connect(this, SIGNAL(frameCreated(QWebFrame *)),
          this, SLOT(frameCreated(QWebFrame *)));
  connect(this, SIGNAL(unsupportedContent(QNetworkReply*)),
      this, SLOT(handleUnsupportedContent(QNetworkReply*)));
  connect(this, SIGNAL(pageFinished(bool)),
      m_manager, SLOT(emitPageFinished(bool)));
  connect(this, SIGNAL(loadStarted()),
      m_manager, SLOT(emitLoadStarted()));
  resetWindowSize();

  settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, true);
}
Beispiel #2
0
WebPage::WebPage(WebPageManager *manager, QObject *parent) : QWebPage(parent) {
  m_loading = false;
  m_failed = false;
  m_manager = manager;
  m_uuid = QUuid::createUuid().toString();
  m_confirmAction = true;
  m_promptAction = false;

  setForwardUnsupportedContent(true);
  loadJavascript();
  setUserStylesheet();

  this->setCustomNetworkAccessManager();

  connect(this, SIGNAL(loadStarted()), this, SLOT(loadStarted()));
  connect(this, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
  connect(this, SIGNAL(frameCreated(QWebFrame *)),
          this, SLOT(frameCreated(QWebFrame *)));
  connect(this, SIGNAL(unsupportedContent(QNetworkReply*)),
      this, SLOT(handleUnsupportedContent(QNetworkReply*)));
  connect(this, SIGNAL(windowCloseRequested()), this, SLOT(remove()));

  settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, true);
  settings()->setAttribute(QWebSettings::JavascriptCanCloseWindows, true);
  settings()->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, true);

  if(QFileInfo("tmp").isDir()) {
    settings()->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, true);
    settings()->setOfflineWebApplicationCachePath("tmp");
  }

  createWindow();
}
Beispiel #3
0
WebPage::WebPage(WebPageManager *manager, QObject *parent) : QWebPage(parent) {
  m_loading = false;
  m_failed = false;
  m_manager = manager;
  m_uuid = QUuid::createUuid().toString();

  setForwardUnsupportedContent(true);
  loadJavascript();
  setUserStylesheet();

  m_confirm = true;
  m_prompt = false;
  m_prompt_text = QString();
  this->setCustomNetworkAccessManager();

  connect(this, SIGNAL(loadStarted()), this, SLOT(loadStarted()));
  connect(this, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
  connect(this, SIGNAL(frameCreated(QWebFrame *)),
          this, SLOT(frameCreated(QWebFrame *)));
  connect(this, SIGNAL(unsupportedContent(QNetworkReply*)),
      this, SLOT(handleUnsupportedContent(QNetworkReply*)));
  resetWindowSize();

  settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, true);
  currentFrame()->setUrl(QUrl("about:blank"));
}
Beispiel #4
0
WebPage::WebPage(QObject *parent) : QWebPage(parent) {
  loadJavascript();
  setUserStylesheet();

  m_loading = false;
  this->setCustomNetworkAccessManager();

  connect(this, SIGNAL(loadStarted()), this, SLOT(loadStarted()));
  connect(this, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
  connect(this, SIGNAL(frameCreated(QWebFrame *)),
          this, SLOT(frameCreated(QWebFrame *)));
}
Beispiel #5
0
WebPage::WebPage(QObject *parent) : QWebPage(parent) {
  setForwardUnsupportedContent(true);
  loadJavascript();
  setUserStylesheet();

  m_loading = false;
  m_ignoreSslErrors = false;
  this->setCustomNetworkAccessManager();

  connect(this, SIGNAL(loadStarted()), this, SLOT(loadStarted()));
  connect(this, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
  connect(this, SIGNAL(frameCreated(QWebFrame *)),
          this, SLOT(frameCreated(QWebFrame *)));
  connect(this, SIGNAL(unsupportedContent(QNetworkReply*)),
      this, SLOT(handleUnsupportedContent(QNetworkReply*)));
  resetWindowSize();
}