diff --git a/bootstrap.sh b/bootstrap.sh index 6990a37fd..09916d0b9 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash WINDOWS_VERSION=$(cmd.exe /c ver 2>/dev/null | grep "Microsoft Windows") if [ ! -z "$WINDOWS_VERSION" ]; then diff --git a/simple_make.sh b/simple_make.sh index 555aae1f8..f43bd91fa 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/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 diff --git a/src/widget/form/chatform.cpp b/src/widget/form/chatform.cpp index c6177b6bb..48208c808 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(); diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index 0ee2fac2f..1c3a073db 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -59,6 +59,7 @@ #include #include #include +#include #include #ifdef Q_OS_ANDROID @@ -218,7 +219,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); 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"