mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
Cleaning up unused code
This commit is contained in:
parent
b345df8002
commit
eb7988e4ef
7 changed files with 0 additions and 229 deletions
|
@ -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"
|
||||
|
|
|
@ -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());
|
||||
};
|
|
@ -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 <QTextBrowser>
|
||||
#include <QMimeData>
|
||||
|
||||
class ChatInputArea : public QTextEdit {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ChatInputArea(QWidget* parent);
|
||||
|
||||
protected:
|
||||
void insertFromMimeData(const QMimeData* source);
|
||||
};
|
||||
|
||||
#endif // hifi_ChatInputArea_h
|
|
@ -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 <QAbstractTextDocumentLayout>
|
||||
#include <QWheelEvent>
|
||||
|
||||
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();
|
||||
}
|
|
@ -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 <QTextBrowser>
|
||||
|
||||
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
|
|
@ -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 <qwebframe.h>
|
||||
#include <qwebview.h>
|
||||
|
||||
#include <AccountManager.h>
|
||||
#include <NetworkingConstants.h>
|
||||
|
||||
#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]);
|
||||
}
|
||||
}
|
|
@ -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 <qobject.h>
|
||||
#include <qwebview.h>
|
||||
|
||||
typedef QMap<QString, QObject*> 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
|
Loading…
Reference in a new issue