Commit Graph

8 Commits

Author SHA1 Message Date
miruka
8f35e60801 Capitalization, list model and room header work
- Standardized capitalization for variables and file names everywhere in
  QML and JS, get rid of mixed camelCase/snakeCase,
  use camelCase like everywhere in Qt

- ListModel items are now stored and returned as real QObjects with
  PyQt properties and signals.
  This makes dynamic property binding a lot easier and eliminates the need
  for many hacks.

- New update(), updateOrAppendWhere() methods and roles property
  for ListModel

- RoomHeader now properly updates when the room title or topic changes

- Add Backend.pdb(), to make it easier to start the debugger from QML
2019-04-20 17:43:57 -04:00
miruka
9e5e2c6718 Use a Deque for roomEvents's ListModel
- Take a custom container callable for ListModel __init__ (defaults to
  list, must be a MutableSequence)

- Use a Deque for roomEvents, which is much faster for inserting
  new items at the beginning.
2019-04-17 17:24:36 -04:00
miruka
8a3189df15 Add users currently typing in room bar 2019-04-14 16:12:07 -04:00
miruka
3ec51b9253 Fix room subtitle reloading
Replace the "reloadThis" ListModel hack by an actual signal,
works when the subtitle is displayed in more than one place
(e.g. two accounts in the same room connected).
2019-04-14 14:33:57 -04:00
miruka
5c8fd4500d Fix garbage collection of ListModelMap items
Prevent ListModel items from being deleted on the C++ side (specially
when using .get() from QML and a new ListModel is created)
by setting their parent to the ListModelMap.
2019-04-13 09:59:34 -04:00
miruka
13fca98838 Rooms and threads fixes
- Fix roomList height again, now based on model.count().
  All delegates are assumed to be the same height

- Properly update room list when a room is joined or left

- Catch exceptions happening in threads (futures), which previously
  passed silently

- Show "Empty room?" as "<i>Empty Room</i>" + gray [?] avatar
2019-04-13 08:59:10 -04:00
miruka
30514fb7db Show joined rooms, delete left rooms
To make the models update correctly in QML:
- ListModel and _QtModel merged
- Return a ListModelMap QObject from properties instead of
  a DefaultDict → QVariantMap
2019-04-12 13:18:46 -04:00
miruka
5d4c7b8520 Reorganize backend files, show accounts in UI 2019-04-12 04:33:09 -04:00