You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.1 KiB

#include <QPixmap>
#include <QMessageBox>
#include <QDesktopServices>
#include <QCoreApplication>
#include <QSystemTrayIcon>
#include <QMessageBox>
#include <QWebEnginePage>
#include <QGroupBox>
#include <QFileDialog>
#include "chatwindow.h"
#include "config-conversations.h"
#include "lib/globals.h"
#include "ui_chatwindow.h"
ChatWindow * ChatWindow::pChatWindow = nullptr;
ChatWindow::ChatWindow(Conversations *ctx, QWidget *parent) :
QMainWindow(parent),
ui(new Ui::ChatWindow),
m_webChannel(new QWebChannel(this)),
m_ctx(ctx) {
pChatWindow = this;
ui->setupUi(this);
#ifdef Q_WS_MAEMO_5
window->setProperty("X-Maemo-Orientation", 2); // XXX: 2 = auto orientation
#endif
ui->webWidget->load(QUrl("qrc:/chat/conversation.html"));
ui->webWidget->page()->setWebChannel(m_webChannel);
m_webChannel->registerObject(QString("ChatWindow"), this);
}
Conversations *ChatWindow::getContext(){
return pChatWindow->m_ctx;
}
void ChatWindow::closeEvent(QCloseEvent *event) {
QWidget::closeEvent(event);
}
ChatWindow::~ChatWindow() {
delete ui;
}