From ce3033a0cfb833eb839f4354f72049ad6ad78fc5 Mon Sep 17 00:00:00 2001 From: Yuri Date: Wed, 25 Mar 2015 22:16:22 -0700 Subject: [PATCH 1/4] Fixed bash shebangs to use /usr/bin/env for better compatibility --- bootstrap.sh | 2 +- simple_make.sh | 2 +- tools/buildPackages.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 95a11febe..1c827ef5e 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash ################ parameters ################ # directory where the script is located diff --git a/simple_make.sh b/simple_make.sh index cf2b0234c..933a76aba 100755 --- a/simple_make.sh +++ b/simple_make.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash if which apt-get; then sudo apt-get install build-essential qt5-qmake qt5-default libopenal-dev libopencv-dev \ diff --git a/tools/buildPackages.sh b/tools/buildPackages.sh index fb33d2abb..1322f2f78 100755 --- a/tools/buildPackages.sh +++ b/tools/buildPackages.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Config (Update me if needed !) VERSION_UPSTREAM="1.0" From b2481fc1d8e2bcee9715df7203f1a1c3ccd2b6b1 Mon Sep 17 00:00:00 2001 From: kushagra Date: Tue, 24 Mar 2015 22:41:10 +0530 Subject: [PATCH 2/4] proper splitting in friends chat,fixes #1375 what happened was- When message exceeded TOX_MESSAGE_LENGTH, the whole message was inserted in sender's chatlog X times. if length of message is N, X = (N/TOX_MESSAGE_LENGTH) + 1 There is no bug in recieving end. Receving end gets X messages (splitted). In the sample case provided, the message had whitespaces in the end, so the reciever thought the message is empty. --- src/widget/form/chatform.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/widget/form/chatform.cpp b/src/widget/form/chatform.cpp index 14388f735..dc9cb2832 100644 --- a/src/widget/form/chatform.cpp +++ b/src/widget/form/chatform.cpp @@ -123,6 +123,10 @@ void ChatForm::onSendTriggered() QList splittedMsg = Core::splitMessage(msg, TOX_MAX_MESSAGE_LENGTH); QDateTime timestamp = QDateTime::currentDateTime(); + msgEdit->setLastMessage(msg); //set last message only when sending it + + bool status = !Settings::getInstance().getFauxOfflineMessaging(); + for (CString& c_msg : splittedMsg) { QString qt_msg = CString::toString(c_msg.data(), c_msg.size()); @@ -130,12 +134,10 @@ void ChatForm::onSendTriggered() if (isAction) qt_msg_hist = "/me " + qt_msg; - bool status = !Settings::getInstance().getFauxOfflineMessaging(); - int id = HistoryKeeper::getInstance()->addChatEntry(f->getToxID().publicKey, qt_msg_hist, Core::getInstance()->getSelfId().publicKey, timestamp, status); - ChatMessage::Ptr ma = addSelfMessage(msg, isAction, timestamp, false); + ChatMessage::Ptr ma = addSelfMessage(qt_msg, isAction, timestamp, false); int rec; if (isAction) @@ -144,8 +146,6 @@ void ChatForm::onSendTriggered() rec = Core::getInstance()->sendMessage(f->getFriendID(), qt_msg); getOfflineMsgEngine()->registerReceipt(rec, id, ma); - - msgEdit->setLastMessage(msg); //set last message only when sending it } msgEdit->clear(); From 5a4443b7bbf282eebbb346670438a07f3a608340 Mon Sep 17 00:00:00 2001 From: Rohil Surana Date: Thu, 26 Mar 2015 16:50:55 +0530 Subject: [PATCH 3/4] Set focus to toxId Line edit on add friend window --- src/widget/form/addfriendform.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widget/form/addfriendform.cpp b/src/widget/form/addfriendform.cpp index 245fc8b3d..2e3bd0883 100644 --- a/src/widget/form/addfriendform.cpp +++ b/src/widget/form/addfriendform.cpp @@ -67,6 +67,7 @@ void AddFriendForm::show(Ui::MainWindow &ui) ui.mainHead->layout()->addWidget(head); main->show(); head->show(); + toxId.setFocus(); } QString AddFriendForm::getMessage() const From 4f650b3177447fa1e72f512471511854a8ac9782 Mon Sep 17 00:00:00 2001 From: PKEv Date: Thu, 26 Mar 2015 23:02:08 +0300 Subject: [PATCH 4/4] System menu translation --- src/widget/widget.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index 2bc828c42..5550c3c64 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -59,6 +59,7 @@ #include #include #include +#include #include #ifdef Q_OS_ANDROID @@ -217,7 +218,20 @@ void Widget::setTranslation() return; if (translator->load(locale, ":translations/")) + { qDebug() << "Loaded translation" << locale; + + // system menu translation + QTranslator *qtTranslator = new QTranslator(); + QString s_locale = "qt_"+locale; + if ( qtTranslator->load(s_locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath)) ) + { + QApplication::installTranslator(qtTranslator); + qDebug() << "System translation loaded" << locale; + } + else + qDebug() << "System translation not loaded" << locale; + } else qDebug() << "Error loading translation" << locale; QCoreApplication::installTranslator(translator);