We use kdeconnect-version.h in several places and therefore it needs to be in the include path. We currently do this by setting target_include_path in a few places. Replace this with an interface library that we can link against that sets up the correct include path. IMO it is cleaner this way.
Turn smshelper into a static library, which makes sense given it's only used internally at this point. This allows to get rid of some stuff.
Also cleanup other things.
While mostly theoretical it makes for a more expressive API since it communicates that it is a list instead of a single value. It also allows to get rid of some conversion code.
This is also preparation work for potentially using the custom type capabilities that QtDBus offers.
The current implementation seems to have an issue with an undetected binding loop that causes lockup. During investigation I figured that the code was way to complex and brittle for what we need.
This is a cleaner reimplementation. It also replaces the custom Avatar component with the one from Kirigami.
The looks are subject to tweaking of course
Launching smsapp prints:
qrc:/qml/main.qml:36: ReferenceError: _initialMessage is not defined
This patch applies the changes made to the property from C++ in
c17972881b to QML.
This automatizes the generation of logging categories so a
kdeconnect-kde.categories is generated and installed to
/usr/share/qlogging-categories5/ so kdebugsettings can use it.
Also, sets the default logging level to Warning. So now the logs
of users won't be filled with debug messages but they can
modify the configuration easily with kdebugsettings.
## Summary
This patch makes SMS message field scrollable and limits its height to ⅓
of window height (or ⅔ for smaller windows) so messages in conversation
are shown even when writing very long messages.
## Test Plan (and screenshots)
<small>These screenshots are in APNG and WEBP formats. Download them if
your browser does not support this format.</small>
### Before:
Message field height was not limited. Message field could be even higher
than window. That makes first lines of this field and messages in
conversation inaccessible.
![grab-noscroll.apng](/uploads/70a44ec3abd0e0707cf69f53ee832542/grab-noscroll.apng)
### After:
Message field height is limited to ⅓ or ⅔ of window height. When text
content reaches this threshold, scroll bars will show up.
![grab-scroll.webp](/uploads/489b9bb197a092f715bc2160acc7fd42/grab-scroll.webp)
SMS character counter was changing its width (both growing and
shrinking) so it also resized message field (and that caused text
reflow). This patch makes counter width only grow.
Type SMS that is long enough to make SMS character counter wider than
“Send” button. Remove the text (leave there 150 or 60 chars to keep it
visible). Character counter should keep its width.
Creating a QRegularExpression is quite expensive and we use the same expression for each run. Sharing it between the runs leads to a significant performance improvement.
## Summary
Currently `OurSortFilterProxyModel` class is implemented in the same file with `ConversationListModel` class, which would likely grow in the future.
This MR separates `OurSortFilterProxyModel` class into its own separate file renaming it to `ConversationsSortFilterProxyModel`
https://invent.kde.org/kde/kdeconnect-kde/-/merge_requests/229
## Summary
This adds character counter below the “Send” button in SMS conversation. It
uses format XXX/Y where XXX is number of characters that can be added
without splitting the SMS into multiple messages (see article
Concatenated SMS on Wikipedia). Y is number of messages in in current
concatenated SMS. The counter is not visible when insertion of 10 7-bit
or 16-bit (depends on SMS encoding) does not create concatenated SMS.
SMS encoding is automatically guessed. 8-bit encodings are not
supported. If the message contains characters that are not supported by GSM 7-bit
encoding, counter automatically switches to UCS-2.
## Test Plan
Try entering some text that is longer than 150 characters in [GSM 03.38 encoding][1] or 60 characters in UCS-2. Number of remaining characters should be visible below the “Send” button. The character counter should show `0` at exactly 160 or 70 characters. Inserting one character should switch the counter to [Concatenated SMS][2] mode when number of messages is shown.
It should show exactly same number as SMS app in Android.
## Screenshots
These images are in APNG.
![grab.apng](/uploads/21ae23f2fa75c7aca487e61ddce94644/grab.apng)
![grab-cz.apng](/uploads/785e670a8598c5a65a4209f17e75f578/grab-cz.apng)
[1]: https://en.wikipedia.org/w/index.php?oldid=932080074#GSM_7-bit_default_alphabet_and_extension_table_of_3GPP_TS_23.038_/_GSM_03.38
[2]: https://en.wikipedia.org/w/index.php?oldid=943185255#Message_size
## Summary
Start a conversation with contacts having no previous conversation with.
It is currently only possible to use the messaging app to send a message to a conversation which already exists.
This patch implements this feature by integrating all contacts having no prior conversation with the recent conversations in the recent conversation list and at the bottom in a sorted manner, something like this,
The contacts are stored in the recent conversation list model as a conversation but with INVALID conversation ID and INVALID conversation DATE.
## Testing
Testing just needs kdeconnect daemon to be recompiled and executed.
This may need to be reworked at some point for more advanced usecases (multiple apps listening to SMS, variable-length message requests, etc.) but it's fine for now
BUG 410095
## Summary
Upgrade the SMS App to handle multitarget addresses in the "addresses" field of a message and drop usage of the "address" field
Also note that this has all the commits from https://invent.kde.org/kde/kdeconnect-kde/merge_requests/97, but I will rebase those away once that patch is landed
Bonus: Image composition for multitarget conversations
## Test Plan
- Apply Android-side patch https://invent.kde.org/kde/kdeconnect-android/merge_requests/80
- Launch SMS App
- Notice that you can see all the recipients of multitarget messages. (Replying still not supported, but might get implemented as part of fixing replying to single-target messages)
## Summary
Desktop companion to https://invent.kde.org/kde/kdeconnect-android/merge_requests/78
Give desktop SMS app a basic understanding of the MMSes coming from Android:
- Show a fake body if we get an attachment we can't display (for now, any attachment)
- Display a fake contact header for multi-target messages since Android does not yet export multi-target address information
- Disable attempting to reply to multi-target messages
BUG: 398889
## Test Plan
### Before:
MMS messages were silently dropped, meaning:
- Group MMS conversations were not visible
- Single-target conversations with the most-recent message an MMS were not visible
### After:
- Install https://invent.kde.org/kde/kdeconnect-android/merge_requests/78
- Multi-target conversations are displayed (kind of ugly, since they have no contact information
- Single-target conversations which end with an MMS are displayed
- Plain-text MMS is displayed nicely
- MMS attachments don't show
- MMS which are only an attachment with no body are displayed with a dummy body
Summary:
Make "No devices available" warning more obvious, add explaination
New warning:
{F6479206}
With mouseover explanation:
{F6479207}
Test Plan:
- Open app with remote device connected, everything behaves as normal
- Disconnect remote device, observe warning at top of dialogue
- Mouse over warning, be told what the situation means for your use of the app
- Note that, due to [[https://bugs.kde.org/show_bug.cgi?id=401587|bug 401587]], it is not actually possible to view cached content. That will be fixed eventually.
Reviewers: #kde_connect, apol
Reviewed By: #kde_connect, apol
Subscribers: apol, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D17616
Summary:
Add --message option to kdeconnect-sms to pass a message. The user only needs to choose a recepient and the message will be sent. Useful for integration with 3rd party
apps, e.g. via Purpose
Test Plan:
kdeconnect-sms --message "Hello World", choose chat, message is sent
Click another chat, no message sent
kdeconnect-sms without args, no message sent
Reviewers: #kde_connect, sredman
Reviewed By: #kde_connect, sredman
Subscribers: andyholmes, sredman, apol, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D17292
Summary: Let the ListView use its default highlighting (did I not notice before?) and keep the currently-selected chat highlighted at all times
Test Plan:
- Launch app
- Use mouse or arrow keys to select a conversation. The highlight should follow the selected conversation
Reviewers: #kde_connect, apol
Reviewed By: #kde_connect, apol
Subscribers: apol, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D17612
Summary:
Resolves Bug 401255
Bonus: Disable some very noisy debugging from the SMS app
Test Plan:
- Build KDE Connect with or without Kirigami
- Verify successful build with no complaints about Kirigami
- Build KDE Connect's Messenger:
- Without Kirigami: Verify that CMake warns that Kirigami is not found
- With Kirigami: Verify that app launches successfully
Reviewers: #kde_connect, nicolasfella
Reviewed By: #kde_connect, nicolasfella
Subscribers: apol, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D17572
Summary: This patch fixes T10184 and stops the SMS app from crashing when a conversation is selected but no devices are connected. It also allows the SMS app to access the cached messages in the ConversationsDbusInterface so the app is still slightly useful even when the device is disconnected.
Test Plan:
- Open sms app
- Open a few conversations
- Disconnect phone (Force close app?)
- Re-open a conversation which was previously opened
- Verify that the messages appear. It is possible to scroll up to view any older cached messages too!
- Open a conversation which was not opened previously
- Verify that a single messages is shown (since this was the only one in cache, from populating the list of all conversations)
- Verify that attempting to scroll this conversation does nothing, but also does not crash the app
Note: Opening the app with no phone connected will cause it to lose its handle on the deviceId, so it can't spawn a new Dbus interface, so it will remain blank and empty. Solving that is a project for another day.
Reviewers: #kde_connect
Reviewed By: #kde_connect
Subscribers: apol, nicolasfella, kdeconnect
Tags: #kde_connect
Maniphest Tasks: T10184
Differential Revision: https://phabricator.kde.org/D17634
Summary:
- Allow filter box to handle keystrokes passed to the ListView
- This is a little cheesy, but fixes T8341
- Pin filter box to always be visible
- Clear filter on Esc
Test Plan:
- Try typing a contact you would like to search for
- Before: Every time you type a new letter, the filter box would lose focus and you would have to click it to give it focus again
- Now: You can type smoothly
- Try scrolling the list
- Before: The filter box disappeared off the top of the screen
- Now: The filter box is always visible
- Try pressing escape
- Before: Nothing
- Now: Filter clears
- Bonus: When using the arrow keys to navigate, before the filter was manually handling those and the view would not loop. Now, the view loops if you try to select an item past the beginning or end (Easiest to see with highlighting from D17612)
Reviewers: #kde_connect, apol
Reviewed By: #kde_connect, apol
Subscribers: kdeconnect
Tags: #kde_connect
Maniphest Tasks: T8341
Differential Revision: https://phabricator.kde.org/D17614
Summary:
Scroll up to show older messages
Newly received messages will not force the view to the bottom unless the new message is being added "very close" to the visible area
Test Plan:
Message History:
- Open conversation
- Scroll/Drag up to load older messages
New Message:
- Open conversation
- Scroll to bottom
- Verify that a newly-received or newly-sent message is added to the GUI
- Scroll up
- Verify that sending/receiving a message does not disturb the view
- Scroll back to verify that the new message was indeed added to the list
Reviewers: #kde_connect, apol
Reviewed By: #kde_connect, apol
Subscribers: apol, nicolasfella, kdeconnect
Tags: #kde_connect
Maniphest Tasks: T9556
Differential Revision: https://phabricator.kde.org/D15979
Summary:
The most serious change from this patch is to move the asynchronous replying to a request from the app for more messages to a newly-spawned, self-destructing thread. Within that thread, we block until the remote device replies with the requested messages.
All gotten messages are cached in the ConversationDbusInterface, so all future requests are fast and don't hit the remote device.
Test Plan: After applying this diff, the messaging app should show 10 messages every time it is opened
Reviewers: #kde_connect, nicolasfella, albertvaka
Reviewed By: #kde_connect, albertvaka
Subscribers: albertvaka, apol, nicolasfella, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D16475
Summary:
A scrollbar will show if the entered text fills more than 1/3rd
of the screen, pressing enter will send the message and shift +
enter will add a new line.
Reviewers: #kde_connect, sredman
Reviewed By: #kde_connect, sredman
Subscribers: sredman, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D17224
Summary:
Whenever a ConversationMessage was constructed, a warning was printed saying "Both point size and pixel size set. Using pixel size." Stop double-setting the font size and the warnings stop
This may be system-specific because I don't see where we are setting the font's point size. I will test this on a few different systems (I haven't yet) and I hope others will test it on their system!
Note that this is easiest to test when applied on top of D15979 so you can scroll up to cause more messages to be constructed
Test Plan:
Before patch: Experience many warnings when using the SMS app
After patch: Experience fewer (0?) warnings when using the SMS app
Reviewers: #kde_connect, apol
Reviewed By: #kde_connect, apol
Subscribers: kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D16769
Summary: Move ColumnLayout containing text elements inside of the graphical bounding rectangle
Test Plan:
Pre patch:
- Launch messaging app
- Open conversation
- Notice huge spew of warnings like: "qrc:/qml/ChatMessage.qml:84:5: QML ColumnLayout: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead."
Post patch:
- Launch messaging app
- Open conversation
- No warnings about undefined behavior
Reviewers: apol
Reviewed By: apol
Subscribers: kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D16534
Summary:
Move the "No devices available" text in smsapp from combobox to the ConversationList.
P.S.
It's a GCI task.
Test Plan:
* Build and run smsapp
* Try pairing and unpairing the device
* See the difference
Reviewers: #kde_connect, sredman
Reviewed By: #kde_connect, sredman
Subscribers: sredman, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D16467