From 442ca145da90a46620eb3495afc541b2aff382e8 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Thu, 13 Mar 2014 14:07:21 +0200 Subject: [PATCH 1/2] Hid the chat window rather than close it in order to preserve sent messages. --- interface/interface_en.ts | 8 ++++---- interface/src/Menu.cpp | 2 ++ interface/src/ui/ChatWindow.cpp | 7 +++++++ interface/src/ui/ChatWindow.h | 2 ++ interface/ui/chatWindow.ui | 4 ++-- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/interface/interface_en.ts b/interface/interface_en.ts index 72e5ee3d3e..1d962393d7 100644 --- a/interface/interface_en.ts +++ b/interface/interface_en.ts @@ -45,7 +45,7 @@ - + day %n day @@ -53,7 +53,7 @@ - + hour %n hour @@ -61,7 +61,7 @@ - + minute %n minute @@ -76,7 +76,7 @@ - + %1 online now: diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 95b94bdcbf..00ae0a3772 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -1043,6 +1043,8 @@ void Menu::showChat() { mainWindow->geometry().y(), _chatWindow->width(), mainWindow->height()); + } + if (!_chatWindow->isVisible()) { _chatWindow->show(); } _chatWindow->raise(); diff --git a/interface/src/ui/ChatWindow.cpp b/interface/src/ui/ChatWindow.cpp index 3a1c26ee35..d4f257c0f7 100644 --- a/interface/src/ui/ChatWindow.cpp +++ b/interface/src/ui/ChatWindow.cpp @@ -50,6 +50,7 @@ ChatWindow::ChatWindow() : startTimerForTimeStamps(); } else { ui->numOnlineLabel->hide(); + ui->closeButton->hide(); ui->usersWidget->hide(); ui->messagesScrollArea->hide(); ui->messagePlainTextEdit->hide(); @@ -71,6 +72,10 @@ ChatWindow::~ChatWindow() { delete ui; } +void ChatWindow::reject() { + hide(); +} + bool ChatWindow::eventFilter(QObject* sender, QEvent* event) { Q_UNUSED(sender); @@ -136,9 +141,11 @@ void ChatWindow::startTimerForTimeStamps() { void ChatWindow::connected() { ui->connectingToXMPPLabel->hide(); ui->numOnlineLabel->show(); + ui->closeButton->show(); ui->usersWidget->show(); ui->messagesScrollArea->show(); ui->messagePlainTextEdit->show(); + ui->messagePlainTextEdit->setFocus(); #ifdef HAVE_QXMPP const QXmppMucRoom* publicChatRoom = XmppClient::getInstance().getPublicChatRoom(); connect(publicChatRoom, SIGNAL(participantsChanged()), this, SLOT(participantsChanged())); diff --git a/interface/src/ui/ChatWindow.h b/interface/src/ui/ChatWindow.h index 9250da8933..57da4da45d 100644 --- a/interface/src/ui/ChatWindow.h +++ b/interface/src/ui/ChatWindow.h @@ -33,6 +33,8 @@ public: ChatWindow(); ~ChatWindow(); + virtual void reject(); + protected: bool eventFilter(QObject* sender, QEvent* event); diff --git a/interface/ui/chatWindow.ui b/interface/ui/chatWindow.ui index 9959c638b2..ecb4d79c41 100644 --- a/interface/ui/chatWindow.ui +++ b/interface/ui/chatWindow.ui @@ -185,10 +185,10 @@ closeButton clicked() ChatWindow - accept() + hide() - 342 + 390 42 From b2a29cb84f282b6eae3b3f4d6ce81509b43c7dec Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 13 Mar 2014 10:56:19 -0700 Subject: [PATCH 2/2] Fixes for Linux build. --- interface/CMakeLists.txt | 6 +----- interface/interface_en.ts | 8 ++++---- interface/src/Application.cpp | 2 -- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 1cb0344f86..f39e7d7e50 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -230,11 +230,7 @@ if (APPLE) RUNTIME DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/install" COMPONENT Runtime ) else (APPLE) - # remove and then copy the resources files beside the executable - add_custom_command(TARGET ${TARGET_NAME} POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E remove_directory - $/resources - ) + # copy the resources files beside the executable add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy_directory "${PROJECT_SOURCE_DIR}/resources" diff --git a/interface/interface_en.ts b/interface/interface_en.ts index 1d962393d7..80433032dc 100644 --- a/interface/interface_en.ts +++ b/interface/interface_en.ts @@ -4,22 +4,22 @@ Application - + Export Voxels - + Sparse Voxel Octree Files (*.svo) - + Open Script - + JavaScript Files (*.js) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 8091e58545..96129e0161 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -121,8 +121,6 @@ void messageHandler(QtMsgType type, const QMessageLogContext& context, const QSt QString& Application::resourcesPath() { #ifdef Q_OS_MAC static QString staticResourcePath = QCoreApplication::applicationDirPath() + "/../Resources/"; -#elif defined Q_OS_LINUX - static QString staticResourcePath = "resources/"; #else static QString staticResourcePath = QCoreApplication::applicationDirPath() + "/resources/"; #endif