From 5f6e44241b4858f1c407f0babfc41f40a06405f1 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 29 May 2014 12:45:46 -0500 Subject: display restart error after SIGTERM[soft,tls-error] - fix tls-error: is SIGTERM now - connect to connection-died signal - display error to user --- src/leap/bitmask/gui/eip_status.py | 21 +++++++++++++++++---- src/leap/bitmask/gui/mainwindow.py | 2 +- src/leap/bitmask/gui/statemachines.py | 4 ---- 3 files changed, 18 insertions(+), 9 deletions(-) (limited to 'src/leap/bitmask/gui') diff --git a/src/leap/bitmask/gui/eip_status.py b/src/leap/bitmask/gui/eip_status.py index ca209d6a..04acc167 100644 --- a/src/leap/bitmask/gui/eip_status.py +++ b/src/leap/bitmask/gui/eip_status.py @@ -361,7 +361,7 @@ class EIPStatusWidget(QtGui.QWidget): self.eipconnection.qtsigs.do_connect_signal) @QtCore.Slot(dict) - def eip_stopped(self, restart=False): + def eip_stopped(self, restart=False, failed=False): """ TRIGGERS: EIPConductor.qtsigs.disconnected_signal @@ -378,16 +378,29 @@ class EIPStatusWidget(QtGui.QWidget): # status positively. # Or better call it from the conductor... - clear_traffic = self.tr("Traffic is being routed in the clear") - unreachable_net = self.tr("Network is unreachable") + clear_traffic = self.tr("Traffic is being routed in the clear.") + unreachable_net = self.tr("Network is unreachable.") + failed_msg = self.tr("Cannot start Encrypted Proxy.") if restart: msg = unreachable_net + elif failed: + msg = failed_msg else: msg = clear_traffic self.ui.lblEIPMessage.setText(msg) self.ui.lblEIPStatus.show() + def eip_failed_to_restart(self): + """ + Update EIP messages. + """ + msg = self.tr("Could not restart Encrypted Proxy") + self.ui.lblEIPMessage.setText(msg) + self.ui.lblEIPStatus.show() + + self.set_eip_status(self.tr("You can start the service manually.")) + @QtCore.Slot(dict) def update_vpn_status(self, data=None): """ @@ -530,7 +543,7 @@ class EIPStatusWidget(QtGui.QWidget): self.set_eip_status(eip_status_label, error=True) # signal connection_aborted to state machine: - qtsigs = self._eip_connection.qtsigs + qtsigs = self._eipconnection.qtsigs qtsigs.connection_aborted_signal.emit() def _on_eip_openvpn_already_running(self): diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index aa317d96..98d9fb8b 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -1764,7 +1764,7 @@ class MainWindow(QtGui.QMainWindow): if self._systray is not None: self._systray.showMessage( self.tr('Quitting...'), - self.tr('The app is quitting, please wait.')) + self.tr('Bitmask is quitting, please wait.')) # explicitly process events to display tooltip immediately QtCore.QCoreApplication.processEvents(0, 10) diff --git a/src/leap/bitmask/gui/statemachines.py b/src/leap/bitmask/gui/statemachines.py index 2a876b83..f8e5479d 100644 --- a/src/leap/bitmask/gui/statemachines.py +++ b/src/leap/bitmask/gui/statemachines.py @@ -55,10 +55,6 @@ class SignallingState(QState): """ Emits the signal on entry. """ - print "IIIIIIIIIIIIIIIIIII" - print "TO STATE", self._name, self.objectName() - print "IIIIIIIIIIIIIIIIIII" - logger.debug('State %s::%s entered. Emitting signal ...' % (self._name, self.objectName())) if self._signal is not None: -- cgit v1.2.3