summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/services
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2014-05-16 16:17:14 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2014-05-21 15:31:20 -0300
commit10cf84e5f8be978574b7a7e1a145903b37801753 (patch)
tree971abb9fe2340ad9dced74c0fc6d1d313ed175a9 /src/leap/bitmask/services
parentf0951ad92cb0bf2116a333b8df8279918c5febd6 (diff)
Move waiting logic for imap stop to the backend.
Also, improve quit and cleanup calls.
Diffstat (limited to 'src/leap/bitmask/services')
-rw-r--r--src/leap/bitmask/services/mail/conductor.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/leap/bitmask/services/mail/conductor.py b/src/leap/bitmask/services/mail/conductor.py
index 67bc007e..87c4621e 100644
--- a/src/leap/bitmask/services/mail/conductor.py
+++ b/src/leap/bitmask/services/mail/conductor.py
@@ -66,18 +66,14 @@ class IMAPControl(object):
"""
self._backend.start_imap_service(self.userid, flags.OFFLINE)
- def stop_imap_service(self, cv):
+ def stop_imap_service(self):
"""
Stop imap service.
-
- :param cv: A condition variable to which we can signal when imap
- indeed stops.
- :type cv: threading.Condition
"""
self.imap_connection.qtsigs.disconnecting_signal.emit()
logger.debug('Stopping imap service.')
- self._backend.stop_imap_service(cv)
+ self._backend.stop_imap_service()
def _handle_imap_events(self, req):
"""
@@ -249,6 +245,13 @@ class MailConductor(IMAPControl, SMTPControl):
self._smtp_machine = smtp
self._smtp_machine.start()
+ def stop_mail_services(self):
+ """
+ Stop the IMAP and SMTP services.
+ """
+ self.stop_imap_service()
+ self.stop_smtp_service()
+
def connect_mail_signals(self, widget):
"""
Connects the mail signals to the mail_status widget slots.