Philipp Hörist pushed to branch mainwindow at gajim / gajim
Commits:
2e264d42 by lovetox at 2021-01-31T22:25:45+01:00
Make quit work
- - - - -
4 changed files:
- gajim/app_actions.py
- gajim/application.py
- gajim/gtk/main.py
- gajim/roster_window.py
Changes:
=====================================
gajim/app_actions.py
=====================================
@@ -66,7 +66,7 @@ def on_bookmarks(_action, param):
def on_quit(_action, _param):
- interface.roster.on_quit_request()
+ app.window.quit()
def on_new_chat(_action, param):
=====================================
gajim/application.py
=====================================
@@ -590,3 +590,27 @@ def _on_feature_discovered(self, event):
elif event.feature == Namespace.BLOCKING:
action = '%s-blocking' % event.account
self.lookup_action(action).set_enabled(True)
+
+ def start_shutdown(self, *args, **kwargs):
+ accounts_to_disconnect = {}
+
+ for account, client in app.connections.items():
+ if app.account_is_available(account):
+ accounts_to_disconnect[account] = client
+
+ if not accounts_to_disconnect:
+ self.quit()
+ return
+
+ def _on_disconnect(event):
+ accounts_to_disconnect.pop(event.account)
+ if not accounts_to_disconnect:
+ self.quit()
+ return
+
+ app.ged.register_event_handler('account-disconnected',
+ ged.CORE,
+ _on_disconnect)
+
+ for client in accounts_to_disconnect.values():
+ client.change_status('offline', kwargs.get('message', ''))
=====================================
gajim/gtk/main.py
=====================================
@@ -4,6 +4,7 @@
from gi.repository import Gio
from gajim.common import app
+from gajim.common.i18n import _
from gajim.gui.util import get_builder
from gajim.gui.util import load_icon
from gajim.gui.account_page import AccountPage
@@ -12,6 +13,10 @@
from gajim.gui.account_side_bar import AccountSideBar
from gajim.gui.workspace_side_bar import WorkspaceSideBar
+from gajim.common.helpers import ask_for_status_message
+from gajim.gui.dialogs import DialogButton
+from gajim.gui.dialogs import ConfirmationDialog
+
from .util import open_window
@@ -215,3 +220,77 @@ def _on_start_chat_clicked(self, _button):
def _on_edit_workspace_clicked(self, _button):
open_window('WorkspaceDialog',
workspace_id=self.get_active_workspace())
+
+ def quit(self):
+ accounts = list(app.connections.keys())
+ get_msg = False
+ for acct in accounts:
+ if app.account_is_available(acct):
+ get_msg = True
+ break
+
+ def on_continue2(message):
+ if 'file_transfers' not in app.interface.instances:
+ app.app.start_shutdown(message=message)
+ return
+ # check if there is an active file transfer
+ from gajim.common.modules.bytestream import is_transfer_active
+ files_props = app.interface.instances['file_transfers'].\
+ files_props
+ transfer_active = False
+ for x in files_props:
+ for y in files_props[x]:
+ if is_transfer_active(files_props[x][y]):
+ transfer_active = True
+ break
+
+ if transfer_active:
+ ConfirmationDialog(
+ _('Stop File Transfers'),
+ _('You still have running file transfers'),
+ _('If you quit now, the file(s) being transferred will '
+ 'be lost.\n'
+ 'Do you still want to quit?'),
+ [DialogButton.make('Cancel'),
+ DialogButton.make('Remove',
+ text=_('_Quit'),
+ callback=app.app.start_shutdown,
+ kwargs={'message': message})]).show()
+ return
+ app.app.start_shutdown(message=message)
+
+ def on_continue(message):
+ if message is None:
+ # user pressed Cancel to change status message dialog
+ return
+ # check if we have unread messages
+ unread = app.events.get_nb_events()
+
+ for event in app.events.get_all_events(['printed_gc_msg']):
+ contact = app.contacts.get_groupchat_contact(event.account,
+ event.jid)
+ if contact is None or not contact.can_notify():
+ unread -= 1
+
+ if unread:
+ ConfirmationDialog(
+ _('Unread Messages'),
+ _('You still have unread messages'),
+ _('Messages will only be available for reading them later '
+ 'if storing chat history is enabled and if the contact '
+ 'is in your contact list.'),
+ [DialogButton.make('Cancel'),
+ DialogButton.make('Remove',
+ text=_('_Quit'),
+ callback=on_continue2,
+ args=[message])]).show()
+ return
+ on_continue2(message)
+
+ if get_msg and ask_for_status_message('offline'):
+ open_window('StatusChange',
+ status='offline',
+ callback=on_continue,
+ show_pep=False)
+ else:
+ on_continue('')
=====================================
gajim/roster_window.py
=====================================
@@ -2235,121 +2235,6 @@ def prepare_quit(self):
app.interface.hide_systray()
self.save_done = True
- def quit_gtkgui_interface(self):
- """
- When we quit the gtk interface - exit gtk
- """
- self.prepare_quit()
- self.application.quit()
-
- def on_quit_request(self, widget=None):
- """
- User wants to quit. Check if he should be warned about messages pending.
- Terminate all sessions and send offline to all connected account. We do
- NOT really quit gajim here
- """
- accounts = list(app.connections.keys())
- get_msg = False
- for acct in accounts:
- if app.account_is_available(acct):
- get_msg = True
- break
-
- def on_continue3(message):
- self.quit_on_next_offline = 0
- accounts_to_disconnect = []
- for acct in accounts:
- if app.account_is_available(acct):
- self.quit_on_next_offline += 1
- accounts_to_disconnect.append(acct)
-
- if not self.quit_on_next_offline:
- # all accounts offline, quit
- self.quit_gtkgui_interface()
- return
-
- for acct in accounts_to_disconnect:
- self.send_status(acct, 'offline', message)
-
- def on_continue2(message):
- if 'file_transfers' not in app.interface.instances:
- on_continue3(message)
- return
- # check if there is an active file transfer
- from gajim.common.modules.bytestream import is_transfer_active
- files_props = app.interface.instances['file_transfers'].\
- files_props
- transfer_active = False
- for x in files_props:
- for y in files_props[x]:
- if is_transfer_active(files_props[x][y]):
- transfer_active = True
- break
-
- if transfer_active:
- ConfirmationDialog(
- _('Stop File Transfers'),
- _('You still have running file transfers'),
- _('If you quit now, the file(s) being transferred will '
- 'be lost.\n'
- 'Do you still want to quit?'),
- [DialogButton.make('Cancel'),
- DialogButton.make('Remove',
- text=_('_Quit'),
- callback=on_continue3,
- args=[message])]).show()
- return
- on_continue3(message)
-
- def on_continue(message):
- if message is None:
- # user pressed Cancel to change status message dialog
- return
- # check if we have unread messages
- unread = app.events.get_nb_events()
-
- for event in app.events.get_all_events(['printed_gc_msg']):
- contact = app.contacts.get_groupchat_contact(event.account,
- event.jid)
- if contact is None or not contact.can_notify():
- unread -= 1
-
- # check if we have recent messages
- # recent = False
- # for win in app.interface.msg_win_mgr.windows():
- # for ctrl in win.controls():
- # fjid = ctrl.get_full_jid()
- # if fjid in app.last_message_time[ctrl.account]:
- # if time.time() - app.last_message_time[ctrl.account][
- # fjid] < 2:
- # recent = True
- # break
- # if recent:
- # break
-
- if unread:
- ConfirmationDialog(
- _('Unread Messages'),
- _('You still have unread messages'),
- _('Messages will only be available for reading them later '
- 'if storing chat history is enabled and if the contact '
- 'is in your contact list.'),
- [DialogButton.make('Cancel'),
- DialogButton.make('Remove',
- text=_('_Quit'),
- callback=on_continue2,
- args=[message])]).show()
- return
- on_continue2(message)
-
- if get_msg and ask_for_status_message('offline'):
- open_window('StatusChange',
- status='offline',
- callback=on_continue,
- show_pep=False)
- else:
- on_continue('')
-
def _nec_presence_received(self, obj):
account = obj.conn.name
jid = obj.jid
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2e264d42e51ee4b652f6d0487a186b94…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2e264d42e51ee4b652f6d0487a186b94…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch mainwindow at gajim / gajim
Commits:
bb913f53 by wurstsalat at 2021-01-27T22:57:21+01:00
Icons: Add missing 16px Feather icons
- - - - -
0e36656c by Philipp Hörist at 2021-01-27T23:34:12+01:00
Revert "Rename feather icons"
This reverts commit ab451489ac1ce78d8b5d3e097fec440a7c3e7b3f
- - - - -
8178de1a by Daniel Brötzmann at 2021-01-28T09:27:45+01:00
Icons: Generate symbolic feather checkmarks
Fixed size symbolic icons have to be generated from SVGs using
gtk-encode-symbolic-svg -o outpath feather-check-symbolic.svg 32x32
- - - - -
7ecda265 by Daniel Brötzmann at 2021-01-28T09:38:54+01:00
Icons: Convert feather camera and generate fixed size PNGs
- - - - -
63f6a954 by Daniel Brötzmann at 2021-01-28T17:55:59+01:00
Icons: Add missing feather PNG files
- - - - -
ab324891 by lovetox at 2021-01-31T20:42:39+01:00
Start
- - - - -
1709c898 by lovetox at 2021-01-31T20:42:39+01:00
Disable CI
- - - - -
1e6d3057 by lovetox at 2021-01-31T20:42:39+01:00
Really disable CI
- - - - -
62b9027f by lovetox at 2021-01-31T20:42:39+01:00
Add Workspace settings API
- - - - -
22110d6e by lovetox at 2021-01-31T20:42:39+01:00
Store and Open chats
- - - - -
e07eda0f by lovetox at 2021-01-31T20:42:39+01:00
Add remove_chat()
- - - - -
e0b258c2 by lovetox at 2021-01-31T20:42:39+01:00
Account Side Bar
- - - - -
dd0c2c03 by lovetox at 2021-01-31T20:42:39+01:00
Add Workspace Side Bar
- - - - -
39327394 by wurstsalat at 2021-01-31T20:42:39+01:00
ChatList: Add basic elements
- - - - -
f7968740 by wurstsalat at 2021-01-31T20:42:39+01:00
ChatListStack: Add Start Chat
- - - - -
de5b4a2e by wurstsalat at 2021-01-31T20:42:39+01:00
Add basic Sidebar styling
- - - - -
ad3d25fd by wurstsalat at 2021-01-31T20:42:39+01:00
Improve styling for Sidebar and ChatList
- - - - -
89cff7e3 by lovetox at 2021-01-31T20:42:39+01:00
Store chatlist on remove
- - - - -
cc819eb1 by lovetox at 2021-01-31T20:42:39+01:00
Add/Remove Workspaces
- - - - -
a9a7dffc by lovetox at 2021-01-31T20:42:39+01:00
Allow to add chats to different workspaces
- - - - -
f3e1cae8 by lovetox at 2021-01-31T20:42:39+01:00
Add transparent backgrounds
- - - - -
6981a4a1 by wurstsalat at 2021-01-31T20:42:39+01:00
AccountSideBar: Improve styling
- - - - -
a47c2361 by wurstsalat at 2021-01-31T20:42:39+01:00
WorkspaceSidebar: Improve styling
- - - - -
1fee9d4d by lovetox at 2021-01-31T20:42:39+01:00
Improve left sidebar
- - - - -
82eaed35 by lovetox at 2021-01-31T20:42:39+01:00
css
- - - - -
1e791fcd by lovetox at 2021-01-31T20:42:39+01:00
Dont fail when account is disabled
- - - - -
a139ebbe by lovetox at 2021-01-31T20:42:39+01:00
CSS
- - - - -
d57c3637 by wurstsalat at 2021-01-31T20:42:39+01:00
AvatarSelector: Add Load Image button
- - - - -
c2960145 by Daniel Brötzmann at 2021-01-31T20:42:39+01:00
Workspace: Add Workspace edit dialog
- - - - -
e03ec397 by wurstsalat at 2021-01-31T20:42:39+01:00
Workspace: Add title and editing functionality
- - - - -
8d206111 by wurstsalat at 2021-01-31T20:42:39+01:00
MainWindow: Add Paned for chat list and chat controls
- - - - -
d9228eb9 by lovetox at 2021-01-31T20:42:39+01:00
Store type for open chats
- - - - -
038473e1 by lovetox at 2021-01-31T20:42:39+01:00
Store workspace dialog settings
- - - - -
cbc0486b by lovetox at 2021-01-31T20:42:39+01:00
Fix adding new Workspace
- - - - -
f97f4915 by lovetox at 2021-01-31T20:42:39+01:00
Fix some selection bugs
- - - - -
ac62b6b0 by Daniel Brötzmann at 2021-01-31T20:42:39+01:00
ChatListStack: Wrap in ScrolledWindow
- - - - -
6129a85e by lovetox at 2021-01-31T20:42:39+01:00
Move scrolled window into gui xml
- - - - -
5025a0ef by lovetox at 2021-01-31T20:42:39+01:00
sytle chatlist
- - - - -
4b223e7a by wurstsalat at 2021-01-31T20:42:39+01:00
ChatList: Styling
- - - - -
86f1c6f2 by wurstsalat at 2021-01-31T20:42:39+01:00
MainWindow: Styling
- - - - -
8d608f18 by wurstsalat at 2021-01-31T20:42:39+01:00
Accounts: Add basic account page
- - - - -
7f24a61c by lovetox at 2021-01-31T20:42:39+01:00
Refactor Groupchats
- - - - -
30 changed files:
- − .gitlab-ci.yml
- gajim/chat_control_base.py
- gajim/common/app.py
- gajim/common/const.py
- gajim/common/helpers.py
- gajim/common/modules/bookmarks.py
- gajim/common/modules/httpupload.py
- gajim/common/modules/message.py
- gajim/common/modules/muc.py
- gajim/common/setting_values.py
- gajim/common/settings.py
- gajim/common/storage/archive.py
- + gajim/data/gui/main.ui
- + gajim/data/gui/workspace_dialog.ui
- + gajim/data/icons/hicolor/16x16/devices/feather-briefcase-symbolic.symbolic.png
- − gajim/data/icons/hicolor/16x16/devices/feather-camera-off-symbolic.png
- + gajim/data/icons/hicolor/16x16/devices/feather-camera-off-symbolic.symbolic.png
- − gajim/data/icons/hicolor/16x16/devices/feather-camera-symbolic.png
- + gajim/data/icons/hicolor/16x16/devices/feather-camera-symbolic.symbolic.png
- + gajim/data/icons/hicolor/16x16/devices/feather-check-double-symbolic.symbolic.png
- + gajim/data/icons/hicolor/16x16/devices/feather-check-symbolic.symbolic.png
- gajim/data/icons/hicolor/16x16/devices/feather-clock-symbolic.png → gajim/data/icons/hicolor/16x16/devices/feather-clock-symbolic.symbolic.png
- gajim/data/icons/hicolor/16x16/devices/feather-eye-off-symbolic.png → gajim/data/icons/hicolor/16x16/devices/feather-eye-off-symbolic.symbolic.png
- gajim/data/icons/hicolor/16x16/devices/feather-eye-symbolic.png → gajim/data/icons/hicolor/16x16/devices/feather-eye-symbolic.symbolic.png
- gajim/data/icons/hicolor/16x16/devices/feather-globe-symbolic.png → gajim/data/icons/hicolor/16x16/devices/feather-globe-symbolic.symbolic.png
- gajim/data/icons/hicolor/16x16/devices/feather-hard-drive-symbolic.png → gajim/data/icons/hicolor/16x16/devices/feather-hard-drive-symbolic.symbolic.png
- + gajim/data/icons/hicolor/16x16/devices/feather-hash-symbolic.symbolic.png
- + gajim/data/icons/hicolor/16x16/devices/feather-home-symbolic.symbolic.png
- gajim/data/icons/hicolor/16x16/devices/feather-lock-symbolic.png → gajim/data/icons/hicolor/16x16/devices/feather-lock-symbolic.symbolic.png
- gajim/data/icons/hicolor/16x16/devices/feather-mic-off-symbolic.png → gajim/data/icons/hicolor/16x16/devices/feather-mic-off-symbolic.symbolic.png
The diff was not included because it is too large.
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/c8e6c93ce47944b7b9e9c1ad8db27eb…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/c8e6c93ce47944b7b9e9c1ad8db27eb…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch nbxmpp_2.0 at gajim / python-nbxmpp
Commits:
82c266e5 by lovetox at 2021-01-30T10:52:40+01:00
Resolver: Don’t fail on invalid websocket uris
- - - - -
1 changed file:
- nbxmpp/addresses.py
Changes:
=====================================
nbxmpp/addresses.py
=====================================
@@ -172,6 +172,7 @@ class ServerAddresses(Observable):
type_ = ConnectionType.PLAIN
else:
log.warning('Invalid websocket uri: %s', uri)
+ self._on_request_resolved()
return
addr = ServerAddress(domain=self._domain,
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/82c266e5bc850be9b3554b3f…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/82c266e5bc850be9b3554b3f…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
cf2b471a by lovetox at 2021-01-30T10:44:24+01:00
Resolver: Don’t fail on invalid websocket uris
- - - - -
1 changed file:
- nbxmpp/addresses.py
Changes:
=====================================
nbxmpp/addresses.py
=====================================
@@ -172,6 +172,7 @@ class ServerAddresses(Observable):
type_ = ConnectionType.PLAIN
else:
log.warning('Invalid websocket uri: %s', uri)
+ self._on_request_resolved()
return
addr = ServerAddress(domain=self._domain,
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/cf2b471a6d002f3fa93f4699…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/cf2b471a6d002f3fa93f4699…
You're receiving this email because of your account on dev.gajim.org.