Commit Graph

2254 Commits

Author SHA1 Message Date
miruka
9fa2816d4b Require a space after # for markdown titles
Lets us types stuff like #room-aliases without having to escape the # or
get a bad surprise
2021-07-26 04:39:57 -04:00
miruka
c948c75d36 Fix ~/qrc: folder created on start in release mode 2021-07-26 04:39:57 -04:00
miruka
2b91fc048c Update mypy dev requirement to 0.812+
Noticable improvement: no longer throws errors when using
aiofiles 0.6+ functions.
2021-07-26 04:39:57 -04:00
miruka
688fdec9d7 Remove callback for nio.UnknownBadEvent
Should this type of event appear, our function to register events won't
find the attributes required to process it that are present on normal
events.
2021-07-26 04:39:57 -04:00
miruka
03349ae33f Add "Add another account" entry to settings menu
To do: replace the bottom-left "add account" button by something else,
move the corresponding keybind code away
2021-07-26 04:39:57 -04:00
miruka
b07dfa1c01 Update changelog and version for 0.7.1 2021-03-04 22:20:05 -04:00
miruka
7848a2014a Fix custom theme not found when compiled with QRC
If the application was compiled with QRC (i.e. CONFIG+=dev), a theme
setting that wasn't one of the default theme would fail to be read.

Originally commit cf463f24786566c5ec04a6823e9917975ba2b265,
accidentally thrown out before release
2021-03-04 16:41:48 -04:00
miruka
3daeae324b Fix homeserver list for aiohttp <3.7.0 2021-03-04 13:42:00 -04:00
miruka
a4f94b6de0 settings.py: comment typo fixes and improvements 2021-03-04 11:24:22 -04:00
miruka
35442389c7 settings.py: fix Notifications.flash_time comment 2021-03-04 11:01:31 -04:00
miruka
6febaeeb1b Support the http_proxy environment variable
Overrides General.proxy setting if set
2021-03-03 17:14:57 -04:00
miruka
f6f0a0c1ee Add General.proxy setting, supports HTTP & SOCKS5 2021-03-03 17:14:57 -04:00
miruka
b0d31af3c0 fetch_homeservers: use nio to make aiohttp session
Use a throwaway nio client to make ourself an aiohttp session with proxy
support, that way we don't have to depend on aiohttp and aiohttp-socks
libraries
2021-03-03 17:14:57 -04:00
miruka
bbe6415336 Have radius only on text fields/areas with borders
Fixes the appearance of the filter room/members fields
2021-03-03 17:14:57 -04:00
miruka
d828312a24 Fix focus problems for submenues in context menues 2021-03-03 17:14:57 -04:00
miruka
902f13ab68 Lock position of the room that's focused in GUI
When the currently shown page is the chat of a certain room,
prevent that room from moving around in the left pane due to new
messages/activity or unread/highlight counters change.

When the user switches to another page/room, the previously held lock is
released and that room completes all the moves it would have done if it
wasn't locked.

This makes navigating a room list with lots of activity easier, and
prevent annoyances like clicking on a room with unread messages and
having it immediatly fly down the list (possibly out of scroll view).
2021-03-03 17:14:57 -04:00
miruka
3f88a2204e errors.py: remove duplicate MatrixBadGateway class 2021-03-03 17:14:56 -04:00
miruka
4bff58c828 model.py: remove leftover debugger call 2021-03-03 17:14:56 -04:00
miruka
a3206501de Fix mypy complaint in MatrixClient.edit_pushrule 2021-03-03 17:14:56 -04:00
miruka
5476cf1e6d Don't pass ModelItem fields starting with _ to QML 2021-03-03 17:14:56 -04:00
miruka
045bce5f9c Remove model item __lt__ docstrings
Duplicate efforts and get outdated when the code better explains
how items are sorted
2021-03-03 17:14:56 -04:00
miruka
d31ee9cd67 Shorten lexical vs by activity room sorting code 2021-03-03 17:14:56 -04:00
miruka
81c460cbaf Revert "Fix the one-line events combining"
This reverts commit 39f159f0a3.

Causes problems when message delegates are reordered, with the
transition animations randomly stopping in the middle and leaving
delegates at odd positions.
2021-03-03 17:14:56 -04:00
miruka
f0d7757f0c Catch simpleaudio playback errors
Because of course sound isn't just gonna work on linux and
especially flatpak. Make sure to not spawn an error popup every time
we try to play a notification. Maybe use mpv in the future for
SFX playback (when we'll have a media player implemented),
since it has support for all these backends out of the box.
2021-03-03 17:14:56 -04:00
miruka
cfce4e1ddc Pre070SettingsDetectedPopup: point to master docs 2021-03-03 17:14:56 -04:00
miruka
c420360602 settings.py: support ~ expansion for sound path 2021-03-03 17:14:56 -04:00
miruka
92c49140e7 Play sound from python/ALSA instead QtMultimedia
GStreamer sucks
2021-03-03 17:14:56 -04:00
miruka
31f6e5320a Improve default notification sound
Quieter by default, shorter and without the annoying clicky noise
2021-03-03 17:14:56 -04:00
miruka
ffcccd38d2 Add documentation link to settings menu
And make mirage x.y.z label no longer open the github page
2021-03-03 17:14:56 -04:00
miruka
f49282ff36 Bump version strings to v0.7.0 2021-03-03 17:14:56 -04:00
miruka
1db8c66759 Hide image event name/time bubbles when kb-focused 2021-03-03 17:14:56 -04:00
miruka
376364afad PushRuleSettingsPopup: add some missing padding 2021-03-03 17:14:56 -04:00
miruka
9de4252924 PushRuleSettingsPopup: remove unused action + btn 2021-03-03 17:14:56 -04:00
miruka
c46e1eb897 PushRuleSettingsPopup: add custom sound field 2021-03-03 17:14:56 -04:00
miruka
8b53b4ae11 When replacing disabled rule, disable new rule too 2021-03-03 17:14:56 -04:00
miruka
ef1f6edf31 PushRuleSettingsPopup: handle enter to save 2021-03-03 17:14:56 -04:00
miruka
156f89aca1 Change global notif. keybinds to avoid conflicts
Change the account next/prev binds back to Alt+(Shift+)M,
make mute notif Ctrl+Alt+N, mute except higlights Ctrl+Alt+H
2021-03-03 17:14:56 -04:00
miruka
e9af47e1c7 Fix popups not being flickable by keyboard 2021-03-03 17:14:56 -04:00
miruka
e45055f48c Indicate when combo box accepts custom input 2021-03-03 17:14:56 -04:00
miruka
768a343412 Fix spinbox glitch on min/max numbers 2021-03-03 17:14:56 -04:00
miruka
41bc082044 PushRuleSettingsPopup: disable save if no rule ID 2021-03-03 17:14:56 -04:00
miruka
e0b7974904 Mention event content rule can use a glob pattern 2021-03-03 17:14:56 -04:00
miruka
d5f6459e54 AccountSettings: fix second tab being default 2021-03-03 17:14:56 -04:00
miruka
c18ea2704b PushRuleSettingsPopup: spinner while saving/rming 2021-03-03 17:14:56 -04:00
miruka
656092cec4 Add bottom margin to notifications page spinner 2021-03-03 17:14:56 -04:00
miruka
bc0646ef90 Better indicate when a pushrule is disabled 2021-03-03 17:14:56 -04:00
miruka
db24ebc082 Increase pushrules auto-save timer: 10 → 30s
10s is too short and can bother user setting their rules
with the save's visible effects
2021-03-03 17:14:56 -04:00
miruka
99325fde86 Add support for notification sound effects 2021-03-03 17:14:56 -04:00
miruka
1b0bec3470 Add options to disable HTML in notifications 2021-03-03 17:14:56 -04:00
miruka
fe92ce6730 Fix avatar/display name missing from notifications
This happened when we got a message from an account-room pair
where the full member list hadn't been loaded yet, i.e. the user had
never focused the room since starting the client
2021-03-03 17:14:56 -04:00
miruka
26a68acefd Rename Notification... components for consistency 2021-03-03 17:14:56 -04:00
miruka
e5e78dcefa Rename notification bell icons for consistency 2021-03-03 17:14:56 -04:00
miruka
80c7b07d10 Add bell icons back to global notification menu 2021-03-03 17:14:56 -04:00
miruka
0f2023b924 Customize check mark for checkable menu items 2021-03-03 17:14:56 -04:00
miruka
7604b0f96a Customize submenu arrow for HMenuItem 2021-03-03 17:14:56 -04:00
miruka
6fc0b6725c Remove unused combo-box-menu icon 2021-03-03 17:14:56 -04:00
miruka
d7fbe8c222 Add keybinds to control global notifications
Alt+M: toggle "mute all notifications except highlights"
Alt+Shift+M: toggle "mute all notifications"

The Keys.Rooms.(previous/next)_highlight keybinds, previously bound to
Alt+(Shift+)M (stood for "mention") now defaults to Alt+(Shift+)H.

The NotificationLevel enum and notificationLevel property had to be
moved from Window to UI due to QML having a global "Window" object that
causes conflicts when trying to access the enum as
"Window.NotificationLevel" from UI.qml.
2021-03-03 17:14:56 -04:00
miruka
93ced92cda Add Notifications.start_level setting 2021-03-03 17:14:56 -04:00
miruka
9c56e78164 PushRuleSettingsPopup: highlight action precision 2021-03-03 17:14:56 -04:00
miruka
027454c6e0 Improve global notifications menu
- More descriptive menu entries
- Indicate the current setting in the menu with a checkmark
- Remove menu button tooltip that gets in the way
- Remove unused icon
2021-03-03 17:14:56 -04:00
miruka
0017a1562c Room context menu: notification setting checkmark
Indicate which notification override setting is currently active
2021-03-03 17:14:56 -04:00
miruka
af321d8eae Add notification options to room context menu 2021-03-03 17:14:56 -04:00
miruka
716b480550 Add "Sending message..." tooltip on hourglass
Previously, hovering the hourglass shown for locally echoed messages
would show an empty tooltip.
2021-03-03 17:14:56 -04:00
miruka
8a6f7c262f Change room bookmark terminology to pin/unpin
Pin/unpin is more representative of what the function actually does
for rooms in the left pane. Also change the corresponding icons and
renames the config file section: RoomList.Bookmarks → RoomList.Pinned
2021-03-03 17:14:56 -04:00
miruka
13558fd61c Popups: make key words colored instead of italic
The room name in room forget/leave/invite popups, the exception type in
the unexpected exception popup
2021-03-03 17:14:56 -04:00
miruka
bd91b4ca26 Terminology fix: "invite members" → "invite users"
What we're inviting to a room is users that aren't members yet
2021-03-03 17:14:56 -04:00
miruka
41bce03b92 Push rule popup: respect custom sound action SFX 2021-03-03 17:14:56 -04:00
miruka
84567f1ffd Auto-save push rule tab action changes 2021-03-03 17:14:56 -04:00
miruka
4306098692 Add actions to push rule settings popup 2021-03-03 17:14:56 -04:00
miruka
f466fe9f08 Implement adding new custom push rules 2021-03-03 17:14:56 -04:00
miruka
5b296ed6be Implement adding/removing general rule conditions 2021-03-03 17:14:56 -04:00
miruka
64b8ee03e3 Add some missing copyright/license headers 2021-03-03 17:14:56 -04:00
miruka
e8b8509d22 Open settings popup on pushrule delegate click 2021-03-03 17:14:56 -04:00
miruka
8c4e5deb66 Implement removing push rules 2021-03-03 17:14:56 -04:00
miruka
765ce46aeb Add popup to edit push rules 2021-03-03 17:14:56 -04:00
miruka
71cd509a9d Fix text wrapping for HRadioButton 2021-03-03 17:14:56 -04:00
miruka
44051f706d Prevent horizontal flick in HFlickableColumnPage
These pages and popups using them were always horizontally scrollable,
even though their inner content didn't exceed the page width. Qt bug?
2021-03-03 17:14:56 -04:00
miruka
977be541aa Require notify button on for other push actions
In the notification push rules UI:

- When the notify button for a rule (blue +1) is toggled off, show
  all other action buttons as toggled off too

- When clicking on another action while notify is off, enable notify and
  that action
2021-03-03 17:14:56 -04:00
miruka
a06ce3352e Make local unread markers optional, off by default
Add RoomList.local_unread_markers option to settings.py,
which is False by default.
Before, this way always enabled and conflicts with push rules by marking
anything as unread without any logic.
2021-03-03 17:14:56 -04:00
miruka
4f4bc90faa Don't focus 1st room when clicking on account bar
When clicking on an account in the top account bar or using the
Keys.Account.(previous/next) keybinds, go to the corresponding
account settings instead of trying to focus the first room of that
account if there is one: user might not want to clear the read marker of
any random room that is out of view and happens to be the first in the
list.
2021-03-03 17:14:56 -04:00
miruka
a33902e382 Rename Keys.Room.(previous/next)_urgent setting
to (previous/next)_highlight, to match the new terminology used from the
previous notification settings commit.
2021-03-03 17:14:56 -04:00
miruka
1017d02a83 Change window alert setting names and defaults
- Notifications.alert_time → Notifications.flash_time,
  more evocative of what these "alerts" actually do

- Change default for the above from 0 to 5, since now push rules already
  control precisely what to enable or disable these alerts for

- Notifications.urgent_alert_time → Notifications.highlight_flash_time,
  "highlight" is the term used in the matrix doc
2021-03-03 17:14:56 -04:00
miruka
0ca8d46eae Fix and rename "Sessions" keybinds
Fix refresh and sign out keybinds that were broken, and rename
these in settings.py:

- Keys.Sessions.refresh → Keys.Security.refresh
- Keys.Sessions.sign_out_checked_or_all → Keys.Security.sign_out
2021-03-03 17:14:56 -04:00
miruka
c7d4f719b6 Security.qml: fix first DeviceSection padding 2021-03-03 17:14:56 -04:00
miruka
df979ec5fa Show spinner while push rule list is loading 2021-03-03 17:14:56 -04:00
miruka
6aec20b4d8 Account settings: rename Account tab to General 2021-03-03 17:14:56 -04:00
miruka
8d1d6be701 Notifications.qml: improve paddings consistency 2021-03-03 17:14:56 -04:00
miruka
de34e25f4f Urgency hint enabled by default depending on sound
Make the urgency hint tweak for push rules actions enabled by default if
the rule also has the sound tweak enabled, instead of highlight tweak.
2021-03-03 17:14:56 -04:00
miruka
3dd12691b8 Make desktop notifications follow push rules 2021-03-03 17:14:56 -04:00
miruka
2ef1edb3dc Remove pointless local_highlights
An event can only be considered a highlight if a push rule make it so,
thus an event can never be locally highlighted only.
2021-03-03 17:14:56 -04:00
miruka
35a8c0aec4 Use nio.PushRuleKind instead of own enum 2021-03-03 17:14:56 -04:00
miruka
8748c6445f Push rules sound: be a string, not just on/off 2021-03-03 17:14:56 -04:00
miruka
d2fc003617 Ignore changes for now deleted push rules on save 2021-03-03 17:14:56 -04:00
miruka
9473e97c61 Don't reset model on account data pushrules event 2021-03-03 17:14:56 -04:00
miruka
99c5346dba Store pushrules in model with (kind, rule_id) keys
Two rules of different kinds can have the same rule ID
2021-03-03 17:14:56 -04:00
miruka
d5bcaca874 Add saving of pushrules action changes 2021-03-03 17:14:55 -04:00
miruka
2480603ee2 Improve unread counters theming & default look 2021-03-03 17:14:55 -04:00
miruka
bb8f394b78 Implement a non-functional push rule control UI 2021-03-03 17:14:55 -04:00
miruka
97f6acbb0d Security.qml: loginFuture → loginFutureId 2021-03-03 17:14:55 -04:00
miruka
0d8d07e352 Use refreshButton.loading, not separate spinner 2021-03-03 17:14:55 -04:00
miruka
38da930a99 Fix/improve Security page offline account handling 2021-03-03 17:14:55 -04:00
miruka
755d954948 Merge account settings Encryption & Sessions page 2021-03-03 17:14:55 -04:00
miruka
bb74221e3e Add HRadioButton base component 2021-03-03 17:14:55 -04:00
miruka
e0cb040fd1 Add HComboBox base control 2021-03-03 17:14:55 -04:00
miruka
9967638694 Apply theme radius on context menus 2021-03-03 17:14:55 -04:00
miruka
7af1456c1d Add visible indicator when downloading files
Downloading file messages will now show a transfer control above the
composer, similar to uploads. Measuring the progress or pausing the
operation is not possible yet.
2021-03-03 17:14:55 -04:00
miruka
86f0a8a6a0 Add warning popup when old settings.json detected 2021-03-03 17:14:55 -04:00
miruka
5dfe700880 Fix toggle compact keybind not working immediatly 2021-03-03 17:14:55 -04:00
miruka
fd2d9d2c31 Fix image events read counter being underlined
caused by 2ca01c69d8e56e903e346b604842cf0664583f0d
2021-03-03 17:14:55 -04:00
miruka
2d3553531d Better explain XDG vs default locations in docs 2021-03-03 17:14:55 -04:00
miruka
4070b75544 RoomHeader: add message selection info and actions
When messages are selected in the timeline, change the chat header's
mode to show how many messages are selected and offer copy, remove and
deselect buttons.
2021-03-03 17:14:55 -04:00
miruka
426faa2673 Improve RedactPopup multi-sender warning
Give reason why we can't delete all the selected messages when
selection contains a mix of own and other user messages and we don't
permission to remove them.
2021-03-03 17:14:55 -04:00
miruka
c59d54877a Add Keys.Messages.seen_tooltips keybind
Toggle display of the focused message's seen counter tooltip,
which shows which user have this message as their last seen
and when did they send that information.
When this mode is active, you can move the focus
to other messages  and the tooltip will update itself.
If a message doesn't have a counter, it won't have a tooltip.
2021-03-03 17:14:55 -04:00
miruka
f22758ea89 Add tooltips to the message "read by" indicator
Hovered the read by counter on timeline events now shows who read said
event and when.
2021-03-03 17:14:55 -04:00
miruka
6184f1cfa5 Add utils.commaAndJoin() for "a, b and c" strings 2021-03-03 17:14:55 -04:00
miruka
661ca47430 Fix Keys.Messages.debug keybind 2021-03-03 17:14:55 -04:00
miruka
626a43b7b0 Replace pprintpp usage by devtools.debug 2021-03-03 17:14:55 -04:00
miruka
0dadf7de97 Have split python_(remote_)debugger keybinds
python_debugger (shift+F1) will now always start pdb, and
python_remote_debugger will always start remote_pdb.
Since the new autoreload.py script doesn't break stdin like entr with
live-reload.sh did, we can now use pdb if the app is connected to a
terminal.
2021-03-03 17:14:55 -04:00
miruka
e4959f503c Reimplement swipe to exit sidepane via DragHandler 2021-03-03 17:14:55 -04:00
miruka
7029148c87 Fix some chat right pane issues
- Remove the default Qt dragMargin: when the right pane was
  hidden/collapsed in the interface, accidentally clicking on this
  invisible 10 pixel-wide zone to the right edge of the window
  would interfere with any button under it, e.g. the button to
  expand the pane

- Fix expand pane button failing to bring back pane (due to dragMargin)
  and turning the chat page header invisible

- Disable swiping to exit panes, interferes with buttons and tiles
2021-03-03 17:14:55 -04:00
miruka
01adc71646 Catch error when sending dbus notification fails 2021-03-03 17:14:55 -04:00
miruka
98b6a7b74e Add detail tooltips in server browser stability %
When hovering on stability percentages in the server browser, a tooltip
now shows the total downtime in the past 30 days, number of incidents,
their average length and the longest's duration.
2021-03-03 17:14:55 -04:00
miruka
ae4bcffa06 settings.py: add Chat.Composer.TypingNotifications 2021-03-03 17:14:55 -04:00
miruka
fda5bc0039 Add CLI arguments parsing + --start-in-tray
- Loading a QML file in place of src/gui/UI.qml is now possible via
  -l / --load-qml instead of taking the first positional argument

- New option to start application in tray without showing a window

- --help and --version
2021-03-03 17:14:55 -04:00
miruka
50d4aae188 Remove unused ExitRequested pyotherside event 2021-03-03 17:14:55 -04:00
miruka
ddc5b8b933 Replace live-reload.sh by autoreload.py
entr is a glitchy mess that keeps restarting for no reason and prevents
pdb usage due to stdin takeover, use a python script instead that
doesn't need external utilities.
2021-03-03 17:14:55 -04:00
miruka
8175bbde0e Fix keyboard scrolling when kinetic is disabled 2021-03-03 17:14:55 -04:00
miruka
69a338f610 Fix handling errors in config files on startup 2021-03-03 17:14:55 -04:00
miruka
199ec7646b Watch files included from PCN files (auto-reload) 2021-03-03 17:14:55 -04:00
miruka
1a101d9888 Disable new theme test code for now 2021-03-03 17:14:55 -04:00
miruka
8db275ab37 Fix DebugConsole up/down with word-wrapped lines
Fix these issues:

- When the cursor was on the last soft-line of a word-wrapped line,
  pressing down wouldn't go to the next history entry

- When the cursor was after the first soft-line of a word-wrapped line
  and that line was the first of the text area, pressing up would
  go to the previous history entry instead of moving the cursor to the
  first soft-line
2021-03-03 17:14:55 -04:00
miruka
8d4e67d6a4 Fix EventList stuff depending on scroll position
Add visibleStart/End properties to HListView that take into account the
ListView's originX/Y, and not just contentX/Y which can be largely
offset.

Use those new properties in EventList for message focusing (fix
ctrl+up/down sometimes incorrectly focusing the message at the middle of
the screen even when we're scrolled at the bottom), and detection of
when we can update the read marker (fix cases when we're scrolled at the
bottom but the read marker never updates).
2021-03-03 17:14:55 -04:00
miruka
509b35a633 Make flickToTop/Bottom faster and more accurate 2021-03-03 17:14:55 -04:00
miruka
42f04b013e Add PCN theme system
Coexist with the old theme system for now. QML components have to be
updated to use the new system.
2021-03-03 17:14:55 -04:00
miruka
1af1d30c48 Make color module objects available to PCN 2021-03-03 17:14:55 -04:00
miruka
64c0998a68 Merge color.py and svg_colors.py
The SVG colors are now an enum of Color objects, instead of hex strings.
The "transparent" color was also added, which isn't in the standards but
works in QML.
2021-03-03 17:14:55 -04:00
miruka
97cfe7049d Add color.py module for theming 2021-03-03 17:14:55 -04:00
miruka
a53aec0ff9 Fix handling of config file deleted at runtime 2021-03-03 17:14:55 -04:00
miruka
c1dc9a80b2 Fix default data when no .gui.json file exists 2021-03-03 17:14:55 -04:00
miruka
9a813ecaa8 Fix PCN include_builtin() when running under QRC 2021-03-03 17:14:55 -04:00
miruka
1e002eb4a5 Fix flake8/mypy/isort code errors from new setup 2021-03-03 17:14:55 -04:00
miruka
eed2cc4818 Remove double blank lines from QML files 2021-03-03 17:14:55 -04:00
miruka
93eba7ce92 Fix incorrect account switching keybind order
The keybinds to switch to the first room in account number X did not
behave properly when the accounts weren't ordered lexically.
2021-03-03 17:13:51 -04:00
miruka
3564e7a571 Turn bookmarks/aliases/at_index into Sections 2021-03-03 17:13:51 -04:00
miruka
fbd3f6f4a2 PCN: allow adding new properties at run-time 2021-03-03 17:13:51 -04:00
miruka
9348df32f7 PCN: support quoted strings as property names 2021-03-03 17:13:51 -04:00
miruka
db12036372 Use new PCN format for settings config file 2021-03-03 17:12:09 -04:00
miruka
6ce3059322 Raise error if loading a JSON fails
Don't use the default config if there's an error in a JSON config file,
a single typo could lead to an entire user settings file getting
overwritten by default data.
2021-03-03 17:12:09 -04:00
miruka
75fbf23b21 Refactor user_files module & add live reloading
- Cleaner design for the backend user_files classes and simplified
  interaction with QML
- Config and theme files will now automatically reload when changed on
  disk
- Removed manual reload keybind and button
2021-03-03 17:12:09 -04:00
miruka
00c468384a Delay increasing timeline cache buffer, reduce lag
When switching rooms, first load only the delegates in the user's view
and wait a second before expanding the cacheBuffer and loading more
delegates outside the view. This reduces the amount of delegates to load
all at once by 3x.
2021-03-03 17:12:09 -04:00