Commit graph libervia-backend/sat_frontends
Author SHA1 Message Date
Goffi
36ccde03b9 jp: password is now prompted if needed:
if password is not specified on command line, it is now prompted if it is needed to start
a profile session or connect it. The password is prompted with echo disabled, so somebody
seing the computer screen can't see the password.

fix 207
2019-10-01 22:49:11 +02:00
Goffi
5a2d7e2943 jp (debug): new "theme" command to print colour theme according to background value:
fix 321
2019-10-01 22:49:11 +02:00
Goffi
1efb60a429 jp: dark and light theme:
- `background` setting can now be used in sat.conf to indicate if the terminal use a
  `dark` or a `light` colour
- if `background` is not set or set to `auto`, the background colour is autodetected
- Jp.get_config (or CommandBase.get_config) method can now be used to retrieve a setting
2019-10-01 22:49:10 +02:00
Goffi
c61f6237a4 jp: handle dbus bridge with asyncio:
D-Bus bridge is now working again, using the new AsyncIO version. To make it work, the
GLib loop is run in a separated thread.

Loops have been moved to the `loops` module.
2019-10-01 22:49:10 +02:00
Goffi
92cb7ed130 bridge (dbus): AsyncIO version of D-Bus bridge:
The frontends D-Bus bridge has now an AIOBridge version which can be instantiated to use asyncio (the loop must be managed by frontends).
2019-10-01 22:49:10 +02:00
Goffi
76aadbb3fb jp: jp asyncio port:
/!\ this commit is huge. Jp is temporarily not working with `dbus` bridge /!\

This patch implements the port of jp to asyncio, so it is now correctly using the bridge
asynchronously, and it can be used with bridges like `pb`. This also simplify the code,
notably for things which were previously implemented with many callbacks (like pagination
with RSM).

During the process, some behaviours have been modified/fixed, in jp and backends, check
diff for details.
2019-09-25 08:56:41 +02:00
Goffi
5cee4fbab7 bridge (pb): implemented an asyncio compatible bridge:
`pb` bridge can now be used with asyncio by instantiating AIOBridge.
2019-09-25 08:53:38 +02:00
Goffi
b8e9212b8d jp (common): fixed draft path use in BaseEdit 2019-08-26 09:14:58 +02:00
Goffi
fbfe96c505 Python 3 port:
/!\ this is a huge commit
/!\ starting from this commit, SàT is needs Python 3.6+
/!\ SàT maybe be instable or some feature may not work anymore, this will improve with time

This patch port backend, bridge and frontends to Python 3.

Roughly this has been done this way:

- 2to3 tools has been applied (with python 3.7)
- all references to python2 have been replaced with python3 (notably shebangs)
- fixed files not handled by 2to3 (notably the shell script)
- several manual fixes
- fixed issues reported by Python 3 that where not handled in Python 2
- replaced "async" with "async_" when needed (it's a reserved word from Python 3.7)
- replaced zope's "implements" with @implementer decorator
- temporary hack to handle data pickled in database, as str or bytes may be returned,
  to be checked later
- fixed hash comparison for password
- removed some code which is not needed anymore with Python 3
- deactivated some code which needs to be checked (notably certificate validation)
- tested with jp, fixed reported issues until some basic commands worked
- ported Primitivus (after porting dependencies like urwid satext)
- more manual fixes
2019-08-13 19:08:41 +02:00
Goffi
cf83f04af4 quick frontend (app): show an info log if avatar is not found instead of raising exception
fix 288
2019-07-20 16:03:28 +02:00
Goffi
d2064fc175 core: fixed handling of button callback in popups:
Button use themselve as callback, and this was causing troubles in the removePopUp method.
This patch work around this by considering a Button widget in the same way as None (we
never use Button directly in popups).

fix 183
2019-07-19 23:04:35 +02:00
Goffi
1c862e7c3f primitivus: fixed status popup's cancel button
fix 329
2019-07-17 09:28:34 +02:00
Goffi
36f87054d1 quick frontends (app): setSpecial is now called before getOrCreateWidget in mucRoomJoinedHandler:
this avoid a issue in Primitivus where the contact list selection is done
before the room is actually added to the contact list.
2019-07-14 21:19:47 +02:00
Goffi
3b21a727dd primitivus: better popup sizing:
- showPopUp now takes absolute height and width, this makes more sense than the relative
  ones used before
- if height or width is not set, a default is used which depend of the type of the widget
  (it's smaller if the widget is a note)
- size is set to a low value for widget alerts
- size is bigger else

fix 324
2019-07-14 20:42:14 +02:00
Goffi
8fc78a71f0 primitivus: select the widget even if an other one is selected when the selection comes from an user action:
new `user_action` arguments has been added to newWidget to specify when the new widget
comes from a direct user action.
2019-07-14 20:38:34 +02:00
Goffi
7459275a68 primitivus: don't focus on new widget if one is already selected:
new widgets were getting focus even when one was already selected.

fix 326
2019-07-14 11:23:23 +02:00
Goffi
fb58a375f8 jp (blog/preview): fixed watch restoring when file is moved/deleted:
with some editors (e.g. vim), when file is written it is actually replaced with a buffered
one. In this case, jp replace the watch to check the new file, but it was not working
anymore with latest version of inotify module. This patch fixes it by removing the old watch
before adding a new one.
2019-07-12 11:29:05 +02:00
Goffi
1e327c01e1 Backed out changeset cf0dda0d4cda
check_output can't be used as it's waiting for command to return, blocking the edition.
2019-07-12 09:04:45 +02:00
Goffi
a6b4c9c56a jp (blog/edit): fail and show error message if --preview is not working 2019-07-12 08:55:41 +02:00
Goffi
80be7cddb9 frontends (xmlui): fixed crash when CURRENT_LABEL is None:
fix 323
2019-07-11 09:21:10 +02:00
Goffi
90fcacd4bd primitivus (contact list): fixed notifications counter for mentions:
notifications counter was not properly counting mentions and was not changing colour as
expected, this patch fixes this and changed colour to the more readable light red when not focused.

fixes 319
2019-07-08 19:11:29 +02:00
Goffi
48173b1961 primitivus (chat): don't show minor notifications (all but mentions) when printing history
fix 316
2019-07-08 09:20:06 +02:00
Goffi
31a9e2bd09 quick frontend (chat), primitivus(chat): properly clear occupants on resync:
occupants widgets were not cleared in Primitivus on resync while occupants dictionary was, resulting in nicknames sometimes apearing doubled in Primitivus MUC rooms.

A new occupantsClear method has been added in QuickChat, so it can be overriden by frontends to clear widgets or other representations of occupants.

fix 304
2019-07-06 12:22:25 +02:00
Goffi
fa50789710 quick_frontend (contact list): fixed nick use for groupchat:
during the profile connection workflow, joined rooms are retrieved, then presence are
filled, all asynchronously. In some cases, all rooms may not be joined when presence are
filled, resulting in cache being already filled with a `nick` when cache is set for the
room itself. Because of that, a `nick` may be displayed in contact list instead of MUC local
part. This patch fixes it by removing `nick` if it exists when cache a MUC room.

fix 305
2019-07-05 15:58:15 +02:00
Goffi
1250f1a8ac quick frontends (contact list): ignore roster entities with a resource:
cache uses bare entities, as a result when a jid with a resource is used in roster, it is not handled properly.
As this case is rare and probably resulting from bugs in clients, entities with resources are ignored and a warning is logged when this happens.

fix 306
2019-06-30 15:52:27 +02:00
Goffi
e14e69c883 quick frontends (app, chat): disabled the 2 most verbose logs, as they are barely useful and make reading logs difficult. 2019-06-30 15:41:59 +02:00
Goffi
cdba0078b8 jp (blog/preview): fixed call to getCurrentFile 2019-06-27 20:24:14 +02:00
Goffi
540c95f133 jp (xmlui): check root read_only status in addition to widget one 2019-06-14 12:49:45 +02:00
Goffi
700e46e737 jp (xmlui): fixed encoding for raw_input in StringWidget 2019-06-14 12:49:44 +02:00
Goffi
481ce4c379 plugins schema, tickets, merge_requests: use serialised data for extra dict + some cosmetic changes 2019-06-14 12:37:34 +02:00
Goffi
d694599d69 jp (blog/edit): fixed --last-item after recent change in defaut value of --item 2019-05-05 18:50:38 +02:00
Goffi
9a50da7f07 jp (blog/set): fixed missing current_syntax 2019-05-05 18:50:35 +02:00
Goffi
987d808896 jp (blog): fixed the deserialisation issue when using template output 2019-05-05 18:50:32 +02:00
Goffi
4f9f003075 jp (xmlui manager): basic handling of multi-lines text in TextBoxWidget 2019-05-03 20:49:27 +02:00
Goffi
bf9284cf06 jp (file/invite): added a --thumbnail argument 2019-05-03 13:05:47 +02:00
Goffi
97563c3f25 jp (file/share): added invite command to invite an entity to a file sharing repository 2019-04-14 08:21:51 +02:00
Goffi
d85f1b364f jp, plugin merge-requests: used u'' as default for item id in pubsub arguments + fixed some required arguments:
u"" is now used as defaut item id instead of node, as it needs to be serialised anyway. This is temporary solution, as empty string can be used for item id (not forbidden by XEP-0060), but for now this is not handled correctly in jp/SàT (see https://bugs.goffi.org/bugs/view/289). Correct solution will probably need to use a special key in extra to mark empty string in id.
Added/removed some required values for node or item when it made sense.
2019-04-14 08:21:51 +02:00
Goffi
5dda9f6857 jp (common): publish is now a boolean 2019-04-10 22:15:29 +02:00
Goffi
4a0d1701fc primitivus (chat): fixed crash when removing focus_marker after a :search or :history command 2019-04-10 21:07:47 +02:00
Goffi
29bb633914 primitivus: don't call chatStateComposing when host is out of sync:
if host is out of sync, that means that server is not connected and it makes no sense to call this method. Furthermore, this was resulting in a crash because profile is not found.
2019-04-07 21:09:51 +02:00
Goffi
fc41d45039 quick frontend (app): (un)set sync state on (dis)connect:
when connected signal is received, a whole (re)connection has happened, meaning that everything is potentially out of sync (opened widget and contact lists), so host.sync is set accordingly.
It's a temporary option, as (dis)connect is a per-profile signal, and host.sync is global. Methods similar to sync workflow must be implemented on a per-profile basis.
2019-04-07 21:09:49 +02:00
Goffi
9f147f1c36 quick frontend (app): added debug logs on sync state change + refill contact lists on resync when AUTO_RESYNC is set 2019-04-07 21:06:57 +02:00
Goffi
a9fc7c9650 quick frontend (contact list): fixed profile filtering in fill() 2019-04-07 20:59:34 +02:00
Goffi
f0c567d949 quick_frontend (app): fixed filters serialisation before calling bridge.historyGet 2019-04-07 20:58:15 +02:00
Goffi
5a90f9d407 core, quick_frontend(app): fixed connected signal handling 2019-04-07 20:55:27 +02:00
Goffi
8c6be44375 jp (roster): added resync command to do a full roster resynchronisation 2019-04-07 18:50:13 +02:00
Goffi
f51e924eb6 core: added a rosterResync method to bridge:
rosterResync do a full resynchronisation of roster with server. This should not be needed, but may be useful if user suspect a sync issue for whatever reason.
2019-04-07 18:49:41 +02:00
Goffi
34207a8969 quick_frontend (widgets): fixed crash on getWidgets when target doesn't correspond to any widget 2019-04-07 15:04:28 +02:00
Goffi
2f4651d22b jp (avatar/get): fixed avatar being displayed 2 times in a corner case:
when avatar is shown by ImageMagick's display and it is terminated using SIGINT, the return code is 2 and not 0.
Before this patch, jp was interpreting the 2 as an image not displayed and so was trying with the next available command
Now it is stopping when exit code 2 is received.
2019-04-05 21:22:05 +02:00
Goffi
47bd1495df primitivus (chat): use the factorised code for user moved info messages. 2019-03-28 08:40:38 +01:00