Commit Graph

107 Commits

Author SHA1 Message Date
miruka
c841a7a841 Add keybind to toggle collapsing account 2019-08-19 14:28:12 -04:00
miruka
314b2c30ad Add keybind to clear room filter 2019-08-19 14:05:59 -04:00
miruka
af14038909 Rename filterRooms keybind to FocusSidePane 2019-08-19 13:58:31 -04:00
miruka
36dd6457ea Change focus filter rooms keybind to (Alt/Ctrl)+S 2019-08-19 13:18:45 -04:00
miruka
5e5a658173 Add keybinds to go to previous/next room 2019-08-19 13:09:05 -04:00
miruka
6ec193d554 obj.__dict__ calls → obj.serialized or vars(obj) 2019-08-19 11:52:52 -04:00
miruka
4349643345 filter_string is now a class property
- Support serializing class properties instead of just dataclass fields
- filter_string is now a property that's always up-to-date
- Account display names matching the current SidePane filter are shown
2019-08-19 11:34:51 -04:00
miruka
d1eec2ee6b Set client max timeout retry wait time to 10s 2019-08-19 10:31:53 -04:00
miruka
165c1b797e Repair room filter, performance improvements
Chnaging delegate heights is a terrible idea that leads to graphic bugs.
Handle filtering (both room and accounts) and collapsing from a function
that sets the JsonListModel source.
2019-08-19 10:28:49 -04:00
miruka
2865d86d19 Refactor SidePane ListView in a flat way
Also adjust some colors (accentBackground)

TODO: Repair Filter rooms field
2019-08-18 03:35:28 -04:00
miruka
4067d8c4ab Get flat SidePane data on Account/Room models sync
QML: Get the data from Python and print it (for now)

Also:
- Remove useless Model.sortable field, all models/items are sortable
- Change SyncId type hint for less mypy complaints
- Remove ModelItem.main_key class attributes, useless since last big
  refactor
2019-08-17 22:46:54 -04:00
miruka
4e14828004 Fix Room inviter_avatar getting set to None 2019-08-17 18:17:14 -04:00
miruka
2e89dcae9e Add shortcut to focus filter rooms field 2019-08-17 15:58:32 -04:00
miruka
ec17e36911 Better plain text to html conversion
Replace \n and space characters instead of just wrapping the whole text
in pre and having to set a css style
2019-08-17 15:05:05 -04:00
miruka
d98b215c0f Fix plain text messages newlines being ignored 2019-08-17 14:51:04 -04:00
miruka
c7adb5b02f Show error messages on login screen 2019-08-16 16:30:18 -04:00
miruka
e920299db4 Update JSON config file if it lacks keys 2019-08-16 15:12:14 -04:00
miruka
be18a5db41 Make alert show for time set in cfg (default 4s) 2019-08-16 15:07:30 -04:00
miruka
1061498160 Alert (set urgency hint) on new messages 2019-08-16 14:27:25 -04:00
miruka
656dbbdf4a Make room filter field consider room's last event 2019-08-16 13:31:53 -04:00
miruka
cf8ae13eae Set local echoes as room last events 2019-08-16 12:23:34 -04:00
miruka
9ca66b6044 Sort rooms by last event date again 2019-08-16 12:19:43 -04:00
miruka
c76ebe4fe2 Improve some texts 2019-08-16 09:47:44 -04:00
miruka
564ad4fa8f Fix invited/left rooms sorting 2019-08-16 03:01:40 -04:00
miruka
653934be71 Fix declining invitation being ignored 2019-08-16 02:12:37 -04:00
miruka
8baf336cf9 Room subtitle: show member but not profile events
Instead of not showing any kind of RoomMemberEvent.
2019-08-16 01:51:42 -04:00
miruka
6a7376d498 Update LeftBanner, fix forget button crash 2019-08-15 13:00:15 -04:00
miruka
3270c6dd19 Have inviter display name and avatar for rooms 2019-08-15 12:13:41 -04:00
miruka
2ac484b8f5 Remove now broken "don't read user theme if debug" 2019-08-15 12:08:43 -04:00
miruka
34edf923d0 Fix past events loading error for invited room 2019-08-15 11:46:40 -04:00
miruka
710a5c0914 Keep filter bars from different sidePanes in sync 2019-08-15 11:30:22 -04:00
miruka
24ea8fa673 Register invited rooms 2019-08-15 10:51:37 -04:00
miruka
e027c56047 Add/improve ModelStore and Model __str__ 2019-08-15 09:57:58 -04:00
miruka
3c35616eaa Remove copyright headers in code 2019-08-11 08:34:36 -04:00
miruka
67dde68126 Big performance refactoring & various improvements
Instead of passing all sorts of events for the JS to handle and manually
add to different data models, we now handle everything we can in Python.

For any change, the python models send a sync event with their
contents (no more than 4 times per second) to JS, and the QSyncable
library's JsonListModel takes care of converting it to a QML ListModel
and sending the appropriate signals.

The SortFilterProxyModel library is not used anymore, the only case
where we need to filter/sort something now is when the user interacts
with the "Filter rooms" or "Filter members" fields. These cases are
handled by a simple JS function.

We now keep separated room and timeline models for different accounts,
the previous approach of sharing all the data we could between accounts
created a lot of complications (local echoes, decrypted messages
replacing others, etc).

The users's own account profile changes are now hidden in the timeline.
On startup, if all events for a room were only own profile changes, more
events will be loaded.

Any kind of image format supported by Qt is now handled by the
pyotherside image provider, instead of just PNG/JPG.
SVGs which previously caused errors are supported as well.

The typing members bar paddings/margins are fixed.

The behavior of the avatar/"upload a profile picture" overlay is fixed.

Config files read from disk are now cached (TODO: make them reloadable
again).

Pylint is not used anymore because of all its annoying false warnings
and lack of understanding for dataclasses, it is replaced by flake8 with
a custom config and various plugins.

Debug mode is now considered on if the program was compiled with
the right option, instead of taking an argument from CLI.
When on, C++ will set a flag in the Window QML component.

The loading screen is now unloaded after the UI is ready, where
previously it just stayed in the background invisible and wasted CPU.

The overall refactoring and improvements make us now able to handle
rooms with thousand of members and no lazy-loading, where previously
everything would freeze and simply scrolling up to load past events
in any room would block the UI for a few seconds.
2019-08-11 08:27:53 -04:00
miruka
f5aa2c194a "ui-settings.json", "ui-state.json": no ui- prefix 2019-07-24 20:02:31 -04:00
miruka
99c3cc7d9f Put nio encryption files in an encryption subdir 2019-07-24 20:00:01 -04:00
miruka
504644e641 Fix JSONConfigFile read() when no file exists 2019-07-24 19:56:23 -04:00
miruka
a2469bd994 Don't use user theme in debug mode 2019-07-24 18:46:13 -04:00
miruka
de11b53c4e Copy default theme to user data dir if not exist 2019-07-24 18:14:43 -04:00
miruka
eb97f08d6a Add keybind to reload config file (default Alt+R) 2019-07-24 17:26:40 -04:00
miruka
cf5d76dd10 Recursively merge default and user config 2019-07-24 17:20:21 -04:00
miruka
efa4ad0ae0 Add keybinds to config file 2019-07-24 17:05:27 -04:00
miruka
ec27ecf498 Initial themes implementation, new default theme 2019-07-24 02:14:34 -04:00
miruka
345b17b21f Catch ErrorResponse json.dumps error 2019-07-23 14:48:37 -04:00
miruka
9397687122 Parse theme from a custom simpler format 2019-07-23 03:14:02 -04:00
miruka
ab2a73dbfc Set html style for code 2019-07-21 18:17:51 -04:00
miruka
843d40ca26 Fix > parsing and local echo 2019-07-21 17:41:43 -04:00
miruka
459880903d Message stylesheet; turn "> ..." into greentext 2019-07-21 16:53:34 -04:00
miruka
6e65376612 markdown: don't parse "> ..." as blockquote 2019-07-21 16:08:40 -04:00