dsc 2 years ago
parent 1059537e24
commit 960db48ab1

@ -1,49 +1,2 @@
## Conversations ## Conversations
op Maemo:
```
sudo apt install -y ccache cmake build-essential libx11-dev zlib1g-dev libpng-dev qtbase5-dev libqt5svg5-dev libqt5svg5-dev libqt5maemo5-dev libqt5x11extras5-dev gdb libqt5quickcontrols2-5 qtquickcontrols2-5-dev qml-module-qtquick-controls2 qml-module-qtquick2 qml-module-qtquick-layouts qml-module-qtquick-controls qml-module-qtquick-extras qml-module-qtquick-dialogs libqt5x11extras5-dev qml-module-qtquick-controls qml-module-qtquick-layouts qtquickcontrols2-5-dev
```
As `user`:
```bash
cmake -Bbuild .
make -Cbuild -j2
./build/bin/conversations
# mem usage
/usr/bin/time -v ./build/bin/conversations
```
### remote debug (dev)
Since we run as root we need env. variables:
```
QTWEBENGINE_DISABLE_SANDBOX=1
DISPLAY=:0.0
```
# Stacked windows
https://github.com/maemo-leste-extras/dorian/commit/5e8f2e1b87c87ded67030d723c1c5fad3e967b78#diff-e12fae2282221bbdc52470acd3d3170f13683567557cca988671189c88ba7c45L43
# link
https://github.com/maemo-leste/rtcom-eventlogger
# rtcom-eventlogger-ui
```bash
sudo apt install -y dpkg-dev debhelper libglib2.0-dev libxml2-dev libosso-dev libhildon1-dev libebook1.2-dev libedataserver1.2-dev libgconf2-dev libtelepathy-glib-dev librtcom-eventlogger-dev maemo-launcher-dev libhildonfm2-dev libhildonmime-dev libcairo2-dev libgofono-dev mobile-broadband-provider-info libmodest-dbus-client-dev libglibutil-dev librtcom-eventlogger-plugins-dev libclockcore0-dev libcityinfo-dev libtime-dev
git clone https://github.com/maemo-leste/rtcom-eventlogger-ui.git
git clone https://github.com/maemo-leste/osso-abook.git
dpkg-buildpackage -b -uc
apt-get build-dep .
```
## bla
```
QTWEBENGINE_DISABLE_SANDBOX=1 QT_STYLE_OVERRIDE=maemo5 QT_QPA_PLATFORM=maemo DISPLAY=:0.0 /tmp/tmp.jESqXMl9IW/cmake-build-debug-remote/bin/conversations
```

@ -22,7 +22,6 @@ endif()
qt5_add_resources(RESOURCES qt5_add_resources(RESOURCES
assets.qrc assets.qrc
assets/images/flags/flags.qrc
qml/components/qml_components.qrc qml/components/qml_components.qrc
qml/chat/chatty/chatty.qrc qml/chat/chatty/chatty.qrc
qml/chat/whatsthat/whatsthat.qrc qml/chat/whatsthat/whatsthat.qrc

@ -1,7 +1,6 @@
<!DOCTYPE RCC><RCC version="1.0"> <!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/"> <qresource prefix="/">
<file>assets/appicon.icns</file> <file>assets/appicon.icns</file>
<file>assets/country-codes.csv</file>
<file>assets/images/video_tab_icon.svg</file> <file>assets/images/video_tab_icon.svg</file>
<file alias="overview.qml">qml/overview.qml</file> <file alias="overview.qml">qml/overview.qml</file>

@ -11,7 +11,6 @@
#include "chatwindow.h" #include "chatwindow.h"
#include "config-conversations.h" #include "config-conversations.h"
#include "lib/globals.h" #include "lib/globals.h"
#include "wsclient.h"
#include "ui_chatwindow.h" #include "ui_chatwindow.h"

@ -16,16 +16,13 @@ Conversations::Conversations(QCommandLineParser *cmdargs) {
// Paths // Paths
pathGenericData = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); pathGenericData = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
configRoot = QDir::homePath(); configRoot = QDir::homePath();
accountName = Utils::getUnixAccountName(); accountName = qgetenv("USER");
homeDir = QDir::homePath(); homeDir = QDir::homePath();
configDirectory = QString("%1/.config/%2/").arg(configRoot, QCoreApplication::applicationName()); configDirectory = QString("%1/.config/%2/").arg(configRoot, QCoreApplication::applicationName());
// Create some directories // Create some directories
createConfigDirectory(configDirectory); createConfigDirectory(configDirectory);
// flags, iso codes, etc
countries = new Countries();
m_textScaling = config()->get(ConfigKeys::TextScaling).toFloat(); m_textScaling = config()->get(ConfigKeys::TextScaling).toFloat();
if(this->isDebug) { if(this->isDebug) {

@ -7,10 +7,8 @@
#include <QTimer> #include <QTimer>
#include "lib/http.h" #include "lib/http.h"
#include "lib/countries.h"
#include "lib/config.h" #include "lib/config.h"
#include "models/ChatModel.h" #include "models/ChatModel.h"
#include "wsclient.h"
class Conversations : public QObject { class Conversations : public QObject {
Q_OBJECT Q_OBJECT
@ -36,12 +34,10 @@ public:
QString pathGenericData; QString pathGenericData;
QString homeDir; QString homeDir;
QString accountName; QString accountName;
QHash<QString, CountryISO> countries_iso_3166_1;
QString applicationPath; QString applicationPath;
static void createConfigDirectory(const QString &dir) ; static void createConfigDirectory(const QString &dir) ;
Countries *countries;
ChatModel *chatOverviewModel; ChatModel *chatOverviewModel;
void setWindowTitle(const QString &title); void setWindowTitle(const QString &title);

@ -17,7 +17,6 @@
#include "conversations.h" #include "conversations.h"
#include "chatwindow.h" #include "chatwindow.h"
#include "settings.h" #include "settings.h"
#include "wsclient.h"
#include "lib/config.h" #include "lib/config.h"
namespace Ui { namespace Ui {

@ -126,7 +126,11 @@ Components.ChatRoot {
// if we dont the list scrolling bugs out by "jumping" // if we dont the list scrolling bugs out by "jumping"
chatListView.visible = false; chatListView.visible = false;
var count_results = chatModel.getPage(); var count_results = chatModel.getPage();
chatListView.positionViewAtIndex(count_results, ListView.Visible) if(!chatListView.atBottom) {
var jump_to = count_results <= 1 ? 0 : count_results + 1
chatListView.positionViewAtIndex(jump_to, ListView.Beginning)
}
chatListView.visible = true; chatListView.visible = true;
} }
} }

@ -9,7 +9,7 @@ ListView {
signal scrollToBottom() signal scrollToBottom()
boundsBehavior: Flickable.StopAtBounds //boundsBehavior: Flickable.StopAtBounds
property var chatScroll: chatScroll property var chatScroll: chatScroll
property bool scrollable: root.childrenRect.height > parent.height property bool scrollable: root.childrenRect.height > parent.height
property bool atBottom: (chatScroll.position + chatScroll.size) == 1 property bool atBottom: (chatScroll.position + chatScroll.size) == 1

@ -10,6 +10,8 @@ Rectangle {
color: "grey" color: "grey"
property var chatList property var chatList
property string historyPopupBackgroundColor: "#b2b2b2"
property string historyPopupTextColor: "black"
signal scrollToBottom() signal scrollToBottom()
signal fetchHistory() signal fetchHistory()
@ -25,11 +27,33 @@ Rectangle {
onClicked: scrollBottomTimer.start(); onClicked: scrollBottomTimer.start();
} }
Item { Rectangle {
visible: chatList.atTop && !chatModel.exhausted // detect requesting history - endless scroll
onVisibleChanged: { visible: chatList.chatScroll.position < 0.0
if(!chatModel.exhausted && chatList.atTop && visible && chatListView.count >= chatModel.limit) opacity: Math.abs(chatList.chatScroll.position * 10)
fetchHistory(); z: parent.z + 2
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: 20
width: parent.width / 2
height: 32
color: "grey"
radius: 6
Text {
font.pointSize: 16
text: !chatModel.exhausted ? "Load history" : "No more history"
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
Item {
visible: chatList.chatScroll.position <= -0.1
onVisibleChanged: {
if(visible && !chatModel.exhausted && chatListView.count >= chatModel.limit)
fetchHistory();
}
} }
} }
@ -85,6 +109,12 @@ Rectangle {
font.pointSize: parent.pointSize font.pointSize: parent.pointSize
} }
Text {
color: "lime"
text: "scrollable: " + chatList.scrollable
font.pointSize: parent.pointSize
}
Text { Text {
color: "lime" color: "lime"
text: "scaling: " + ctx.scaleFactor text: "scaling: " + ctx.scaleFactor
@ -97,6 +127,9 @@ Rectangle {
interval: 10 interval: 10
repeat: false repeat: false
running: false running: false
onTriggered: chatList.positionViewAtEnd(); onTriggered: {
console.log("scrolling to bottom");
chatList.positionViewAtEnd();
}
} }
} }
Loading…
Cancel
Save