diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index b6f56ea8b0..ec18a764e5 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -155,7 +155,6 @@ #include "ui/AddressBarDialog.h" #include "ui/AvatarInputs.h" #include "ui/AssetUploadDialogFactory.h" -#include "ui/DataWebDialog.h" #include "ui/DialogsManager.h" #include "ui/LoginDialog.h" #include "ui/overlays/Cube3DOverlay.h" diff --git a/interface/src/ui/ChatInputArea.cpp b/interface/src/ui/ChatInputArea.cpp deleted file mode 100644 index 3e8fc84fe2..0000000000 --- a/interface/src/ui/ChatInputArea.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// -// ChatInputArea.cpp -// interface/src/ui -// -// Created by Ryan Huffman on 4/24/14. -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -#include "ChatInputArea.h" - -ChatInputArea::ChatInputArea(QWidget* parent) : QTextEdit(parent) { -}; - -void ChatInputArea::insertFromMimeData(const QMimeData* source) { - insertPlainText(source->text()); -}; diff --git a/interface/src/ui/ChatInputArea.h b/interface/src/ui/ChatInputArea.h deleted file mode 100644 index 31d1584df7..0000000000 --- a/interface/src/ui/ChatInputArea.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// ChatInputArea.h -// interface/src/ui -// -// Created by Ryan Huffman on 4/11/14. -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -#ifndef hifi_ChatInputArea_h -#define hifi_ChatInputArea_h - -#include -#include - -class ChatInputArea : public QTextEdit { - Q_OBJECT -public: - ChatInputArea(QWidget* parent); - -protected: - void insertFromMimeData(const QMimeData* source); -}; - -#endif // hifi_ChatInputArea_h diff --git a/interface/src/ui/ChatMessageArea.cpp b/interface/src/ui/ChatMessageArea.cpp deleted file mode 100644 index bef22b9fed..0000000000 --- a/interface/src/ui/ChatMessageArea.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// -// ChatMessageArea.cpp -// interface/src/ui -// -// Created by Ryan Huffman on 4/11/14. -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -#include "Application.h" -#include "ChatMessageArea.h" -#include -#include - -ChatMessageArea::ChatMessageArea(bool useFixedHeight) : QTextBrowser(), _useFixedHeight(useFixedHeight) { - setOpenLinks(false); - - connect(document()->documentLayout(), &QAbstractTextDocumentLayout::documentSizeChanged, - this, &ChatMessageArea::updateLayout); - - connect(this, &QTextBrowser::anchorClicked, qApp, &Application::openUrl); -} - -void ChatMessageArea::setHtml(const QString& html) { - // Create format with updated line height - QTextBlockFormat format; - format.setLineHeight(CHAT_MESSAGE_LINE_HEIGHT, QTextBlockFormat::ProportionalHeight); - - // Possibly a bug in QT, the format won't take effect if `insertHtml` is used first. Inserting a space and deleting - // it after ensures the format is applied. - QTextCursor cursor = textCursor(); - cursor.setBlockFormat(format); - cursor.insertText(" "); - cursor.insertHtml(html); - cursor.setPosition(0); - cursor.deleteChar(); -} - -void ChatMessageArea::updateLayout() { - if (_useFixedHeight) { - setFixedHeight(document()->size().height()); - updateGeometry(); - emit sizeChanged(size()); - } -} - -void ChatMessageArea::setSize(const QSize& size) { - setFixedHeight(size.height()); - updateGeometry(); -} - -void ChatMessageArea::wheelEvent(QWheelEvent* event) { - // Capture wheel events to stop Ctrl-WheelUp/Down zooming - event->ignore(); -} diff --git a/interface/src/ui/ChatMessageArea.h b/interface/src/ui/ChatMessageArea.h deleted file mode 100644 index 57199538fd..0000000000 --- a/interface/src/ui/ChatMessageArea.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// ChatMessageArea.h -// interface/src/ui -// -// Created by Ryan Huffman on 4/11/14. -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -#ifndef hifi_ChatMessageArea_h -#define hifi_ChatMessageArea_h - -#include - -const int CHAT_MESSAGE_LINE_HEIGHT = 130; - -class ChatMessageArea : public QTextBrowser { - Q_OBJECT -public: - ChatMessageArea(bool useFixedHeight = true); - virtual void setHtml(const QString& html); - -public slots: - void updateLayout(); - void setSize(const QSize& size); - -signals: - void sizeChanged(QSize newSize); - -protected: - virtual void wheelEvent(QWheelEvent* event); - bool _useFixedHeight; -}; - -#endif // hifi_ChatMessageArea_h diff --git a/interface/src/ui/DataWebDialog.cpp b/interface/src/ui/DataWebDialog.cpp deleted file mode 100644 index a92e0ac214..0000000000 --- a/interface/src/ui/DataWebDialog.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// -// DataWebDialog.cpp -// interface/src/ui -// -// Created by Stephen Birarda on 2014-09-17. -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -#include -#include - -#include -#include - -#include "Application.h" -#include "DataWebPage.h" - -#include "DataWebDialog.h" - -DataWebDialog::DataWebDialog() { - // make sure the dialog deletes itself when it closes - setAttribute(Qt::WA_DeleteOnClose); - - // set our page to a DataWebPage - setPage(new DataWebPage(this)); - - // have the Application handle external links - connect(this, &QWebView::linkClicked, qApp, &Application::openUrl); -} - -DataWebDialog* DataWebDialog::dialogForPath(const QString& path, - const JavascriptObjectMap& javascriptObjects) { - DataWebDialog* dialogWebView = new DataWebDialog(); - - dialogWebView->_javascriptObjects = javascriptObjects; - connect(dialogWebView->page()->mainFrame(), &QWebFrame::javaScriptWindowObjectCleared, - dialogWebView, &DataWebDialog::addJavascriptObjectsToWindow); - - QUrl dataWebUrl(NetworkingConstants::METAVERSE_SERVER_URL); - dataWebUrl.setPath(path); - - qDebug() << "Opening a data web dialog for" << dataWebUrl.toString(); - - dialogWebView->load(dataWebUrl); - - return dialogWebView; -} - -void DataWebDialog::addJavascriptObjectsToWindow() { - foreach(const QString& name, _javascriptObjects.keys()) { - page()->mainFrame()->addToJavaScriptWindowObject(name, _javascriptObjects[name]); - } -} \ No newline at end of file diff --git a/interface/src/ui/DataWebDialog.h b/interface/src/ui/DataWebDialog.h deleted file mode 100644 index 219e674620..0000000000 --- a/interface/src/ui/DataWebDialog.h +++ /dev/null @@ -1,32 +0,0 @@ -// -// DataWebDialog.h -// interface/src/ui -// -// Created by Stephen Birarda on 2014-09-17. -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -#ifndef hifi_DataWebDialog_h -#define hifi_DataWebDialog_h - -#include -#include - -typedef QMap JavascriptObjectMap; - -class DataWebDialog : public QWebView { - Q_OBJECT -public: - DataWebDialog(); - static DataWebDialog* dialogForPath(const QString& path, - const JavascriptObjectMap& javascriptObjects = JavascriptObjectMap()); -private slots: - void addJavascriptObjectsToWindow(); -private: - JavascriptObjectMap _javascriptObjects; -}; - -#endif // hifi_WebkitDialog_h \ No newline at end of file