From e9c84a3d2d9fd3a0457f256a908cb5bce9351682 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 1 Oct 2013 15:02:09 -0400 Subject: remove duplicated method definition --- src/leap/bitmask/gui/eip_status.py | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'src/leap/bitmask/gui/eip_status.py') diff --git a/src/leap/bitmask/gui/eip_status.py b/src/leap/bitmask/gui/eip_status.py index f7408b13..6b1235a6 100644 --- a/src/leap/bitmask/gui/eip_status.py +++ b/src/leap/bitmask/gui/eip_status.py @@ -216,22 +216,6 @@ class EIPStatusWidget(QtGui.QWidget): leap_assert_type(eip_status_menu, QtGui.QMenu) self._eip_status_menu = eip_status_menu - def set_eip_status(self, status, error=False): - """ - Sets the global status label. - - :param status: status message - :type status: str or unicode - :param error: if the status is an erroneous one, then set this - to True - :type error: bool - """ - leap_assert_type(error, bool) - if error: - status = "%s" % (status,) - self.ui.lblEIPStatus.setText(status) - self.ui.lblEIPStatus.show() - # EIP status --- @property @@ -261,9 +245,7 @@ class EIPStatusWidget(QtGui.QWidget): :type error: bool """ leap_assert_type(error, bool) - self._eip_status = status - if error: status = "%s" % (status,) self.ui.lblEIPStatus.setText(status) -- cgit v1.2.3 From 689c716b831047c8fe18945956e809b74e4250a3 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 1 Oct 2013 17:34:24 -0400 Subject: Disable EIP on/off button and action when login required. Also adds an explicit should_autostart flag in config. --- src/leap/bitmask/gui/eip_status.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/leap/bitmask/gui/eip_status.py') diff --git a/src/leap/bitmask/gui/eip_status.py b/src/leap/bitmask/gui/eip_status.py index 6b1235a6..946eaa4e 100644 --- a/src/leap/bitmask/gui/eip_status.py +++ b/src/leap/bitmask/gui/eip_status.py @@ -233,6 +233,30 @@ class EIPStatusWidget(QtGui.QWidget): """ self.set_startstop_enabled(False) + @QtCore.Slot() + def disable_eip_start(self): + """ + Triggered when a default provider_config has not been found. + Disables the start button and adds instructions to the user. + """ + logger.debug('Hiding EIP start button') + # you might be tempted to change this for a .setEnabled(False). + # it won't work. it's under the claws of the state machine. + # probably the best thing would be to make a transitional + # transition there, but that's more involved. + self.eip_button.hide() + msg = self.tr("You must login to use Encrypted Internet") + self.eip_label.setText(msg) + + @QtCore.Slot() + def enable_eip_start(self): + """ + Triggered after a successful login. + Enables the start button. + """ + logger.debug('Showing EIP start button') + self.eip_button.show() + # XXX disable (later) -------------------------- def set_eip_status(self, status, error=False): """ @@ -261,6 +285,8 @@ class EIPStatusWidget(QtGui.QWidget): :param value: True for enabled, False otherwise :type value: bool """ + # TODO use disable_eip_start instead + # this should be handled by the state machine leap_assert_type(value, bool) self.ui.btnEipStartStop.setEnabled(value) self._action_eip_startstop.setEnabled(value) -- cgit v1.2.3