diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-10-18 09:34:47 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-10-18 09:34:47 -0300 |
commit | a06b5719f028e619a4b3800fb346ed3c984e4d25 (patch) | |
tree | b177a28201d647731797efb25c19fd9b3a311c9a /src/leap/bitmask/gui | |
parent | 932dcf596177b93c0b0f9e876be74be314fb6037 (diff) | |
parent | f673b84a9a9b0fea3f6bbfefbb38cbd3d311cf3c (diff) |
Merge branch 'release-0.3.5'
Diffstat (limited to 'src/leap/bitmask/gui')
-rw-r--r-- | src/leap/bitmask/gui/eip_status.py | 2 | ||||
-rw-r--r-- | src/leap/bitmask/gui/login.py | 4 | ||||
-rw-r--r-- | src/leap/bitmask/gui/mail_status.py | 19 | ||||
-rw-r--r-- | src/leap/bitmask/gui/mainwindow.py | 337 | ||||
-rw-r--r-- | src/leap/bitmask/gui/ui/eip_status.ui | 4 | ||||
-rw-r--r-- | src/leap/bitmask/gui/ui/eippreferences.ui | 10 | ||||
-rw-r--r-- | src/leap/bitmask/gui/ui/login.ui | 230 | ||||
-rw-r--r-- | src/leap/bitmask/gui/ui/mail_status.ui | 73 | ||||
-rw-r--r-- | src/leap/bitmask/gui/ui/mainwindow.ui | 44 | ||||
-rw-r--r-- | src/leap/bitmask/gui/ui/wizard.ui | 8 | ||||
-rw-r--r-- | src/leap/bitmask/gui/wizard.py | 3 |
11 files changed, 449 insertions, 285 deletions
diff --git a/src/leap/bitmask/gui/eip_status.py b/src/leap/bitmask/gui/eip_status.py index 946eaa4e..77685cd3 100644 --- a/src/leap/bitmask/gui/eip_status.py +++ b/src/leap/bitmask/gui/eip_status.py @@ -424,6 +424,8 @@ class EIPStatusWidget(QtGui.QWidget): tray_message = self.tr("Encrypted Internet: ON") selected_pixmap = self.CONNECTED_ICON selected_pixmap_tray = self.CONNECTED_ICON_TRAY + self._eip_status = 'ON' + self._update_systray_tooltip() self.set_eip_icon(selected_pixmap) self._systray.setIcon(QtGui.QIcon(selected_pixmap_tray)) diff --git a/src/leap/bitmask/gui/login.py b/src/leap/bitmask/gui/login.py index 582f26be..ac34fe23 100644 --- a/src/leap/bitmask/gui/login.py +++ b/src/leap/bitmask/gui/login.py @@ -94,6 +94,9 @@ class LoginWidget(QtGui.QWidget): self.ui.clblErrorMsg.hide() self.ui.clblErrorMsg.clicked.connect(self.ui.clblErrorMsg.hide) + self.ui.lnUser.textEdited.connect(self.ui.clblErrorMsg.hide) + self.ui.lnPassword.textEdited.connect(self.ui.clblErrorMsg.hide) + def _remember_state_changed(self, state): """ Saves the remember state in the LeapSettings @@ -294,6 +297,7 @@ class LoginWidget(QtGui.QWidget): self.set_enabled(False) self.ui.clblErrorMsg.hide() + self._settings.set_provider(provider) if self.get_remember() and has_keyring(): # in the keyring and in the settings # we store the value 'usename@provider' diff --git a/src/leap/bitmask/gui/mail_status.py b/src/leap/bitmask/gui/mail_status.py index ab9052d7..83533666 100644 --- a/src/leap/bitmask/gui/mail_status.py +++ b/src/leap/bitmask/gui/mail_status.py @@ -35,7 +35,6 @@ class MailStatusWidget(QtGui.QWidget): """ Status widget that displays the state of the LEAP Mail service """ - eip_connection_connected = QtCore.Signal() _soledad_event = QtCore.Signal(object) _smtp_event = QtCore.Signal(object) _imap_event = QtCore.Signal(object) @@ -193,6 +192,17 @@ class MailStatusWidget(QtGui.QWidget): leap_assert_type(action_mail_status, QtGui.QAction) self._action_mail_status = action_mail_status + def set_soledad_failed(self): + """ + SLOT + TRIGGER: + SoledadBootstrapper.soledad_failed + + This method is called whenever soledad has a failure. + """ + msg = self.tr("There was an unexpected problem with Soledad.") + self._set_mail_status(msg, ready=-1) + def _set_mail_status(self, status, ready=0): """ Sets the Mail status in the label and in the tray icon. @@ -377,8 +387,11 @@ class MailStatusWidget(QtGui.QWidget): self._set_mail_status(self.tr("Failed")) elif req.event == proto.IMAP_UNREAD_MAIL: if self._smtp_started and self._imap_started: - self._set_mail_status(self.tr("%s Unread Emails") % - (req.content), ready=2) + if req.content != "0": + self._set_mail_status(self.tr("%s Unread Emails") % + (req.content,), ready=2) + else: + self._set_mail_status("", ready=2) else: leap_assert(False, # XXX ??? "Don't know how to handle this state: %s" diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index 84f09fd9..f5631c69 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -174,10 +174,12 @@ class MainWindow(QtGui.QMainWindow): self._eip_connection = EIPConnection() + # XXX this should be handled by EIP Conductor self._eip_connection.qtsigs.connecting_signal.connect( self._start_eip) self._eip_connection.qtsigs.disconnecting_signal.connect( self._stop_eip) + self._eip_status.eip_connection_connected.connect( self._on_eip_connected) self.eip_needs_login.connect( @@ -228,13 +230,22 @@ class MainWindow(QtGui.QMainWindow): self._eip_intermediate_stage) self._eip_bootstrapper.download_client_certificate.connect( self._finish_eip_bootstrap) + self._vpn = VPN(openvpn_verb=openvpn_verb) + + # connect vpn process signals self._vpn.qtsigs.state_changed.connect( self._eip_status.update_vpn_state) self._vpn.qtsigs.status_changed.connect( self._eip_status.update_vpn_status) self._vpn.qtsigs.process_finished.connect( self._eip_finished) + self._vpn.qtsigs.network_unreachable.connect( + self._on_eip_network_unreachable) + self._vpn.qtsigs.process_restart_tls.connect( + self._do_eip_restart) + self._vpn.qtsigs.process_restart_ping.connect( + self._do_eip_restart) self._soledad_bootstrapper = SoledadBootstrapper() self._soledad_bootstrapper.download_config.connect( @@ -243,8 +254,8 @@ class MainWindow(QtGui.QMainWindow): self._soledad_bootstrapped_stage) self._soledad_bootstrapper.soledad_timeout.connect( self._retry_soledad_connection) - # XXX missing connect to soledad_failed (signal unrecoverable to user) - # TODO wait until chiiph ui refactor. + self._soledad_bootstrapper.soledad_failed.connect( + self._mail_status.set_soledad_failed) self._smtp_bootstrapper = SMTPBootstrapper() self._smtp_bootstrapper.download_config.connect( @@ -258,7 +269,7 @@ class MainWindow(QtGui.QMainWindow): self._launch_wizard) if IS_MAC: - self.ui.menuFile.menuAction().setText(self.tr("Util")) + self.ui.menuFile.menuAction().setText(self.tr("File")) self.raise_window.connect(self._do_raise_mainwindow) @@ -267,8 +278,9 @@ class MainWindow(QtGui.QMainWindow): self._systray = None + # XXX separate actions into a different + # module. self._action_mail_status = QtGui.QAction(self.tr("Mail is OFF"), self) - self._action_mail_status.setEnabled(False) self._mail_status.set_action_mail_status(self._action_mail_status) self._action_eip_startstop = QtGui.QAction("", self) @@ -286,6 +298,11 @@ class MainWindow(QtGui.QMainWindow): self.ui.lblNewUpdates.setVisible(False) self.ui.btnMore.setVisible(False) + ######################################### + # We hide this in height temporarily too + self.ui.lblNewUpdates.resize(0, 0) + self.ui.btnMore.resize(0, 0) + ######################################### self.ui.btnMore.clicked.connect(self._updates_details) # Services signals/slots connection @@ -352,8 +369,12 @@ class MainWindow(QtGui.QMainWindow): finishing. """ if self._wizard_firstrun: - self._settings.set_properprovider(False) - self.quit() + providers = self._settings.get_configured_providers() + has_provider_on_disk = len(providers) != 0 + if not has_provider_on_disk: + # if we don't have any provider configured (included a pinned + # one) we can't use the application, so quit. + self.quit() else: self._finish_init() @@ -381,6 +402,7 @@ class MainWindow(QtGui.QMainWindow): if IS_MAC: self._wizard.raise_() self._wizard.finished.connect(self._wizard_finished) + self._settings.set_skip_first_run(True) def _wizard_finished(self): """ @@ -399,6 +421,8 @@ class MainWindow(QtGui.QMainWindow): :return: a logging handler or None :rtype: LeapLogHandler or None """ + # TODO this can be a function, does not need + # to be a method. leap_logger = logging.getLogger('leap') for h in leap_logger.handlers: if isinstance(h, LeapLogHandler): @@ -464,6 +488,10 @@ class MainWindow(QtGui.QMainWindow): """ self._soledad_ready = True + # + # updates + # + def _new_updates_available(self, req): """ Callback for the new updates event @@ -553,9 +581,13 @@ class MainWindow(QtGui.QMainWindow): self._login_widget.set_password(possible_password) self._login() self._wizard = None - self._settings.set_properprovider(True) else: self._try_autostart_eip() + + domain = self._settings.get_provider() + if domain is not None: + self._login_widget.select_provider_by_name(domain) + if not self._settings.get_remember(): # nothing to do here return @@ -573,9 +605,6 @@ class MainWindow(QtGui.QMainWindow): # fill the username self._login_widget.set_user(username) - # select the configured provider in the combo box - self._login_widget.select_provider_by_name(domain) - self._login_widget.set_remember(True) saved_password = None @@ -591,43 +620,9 @@ class MainWindow(QtGui.QMainWindow): saved_password.decode("utf8")) self._login() - def _try_autostart_eip(self): - """ - Tries to autostart EIP - """ - settings = self._settings - - should_autostart = settings.get_autostart_eip() - if not should_autostart: - logger.debug('Will not autostart EIP since it is setup ' - 'to not to do it') - self.eip_needs_login.emit() - return - - default_provider = settings.get_defaultprovider() - - if default_provider is None: - logger.info("Cannot autostart Encrypted Internet because there is " - "no default provider configured") - self.eip_needs_login.emit() - return - - self._enabled_services = settings.get_enabled_services( - default_provider) - - loaded = self._provisional_provider_config.load( - provider.get_provider_path(default_provider)) - if loaded: - # XXX I think we should not try to re-download config every time, - # it adds some delay. - # Maybe if it's the first run in a session, - # or we can try only if it fails. - self._download_eip_config() - else: - # XXX: Display a proper message to the user - self.eip_needs_login.emit() - logger.error("Unable to load %s config, cannot autostart." % - (default_provider,)) + # + # systray + # def _show_systray(self): """ @@ -649,7 +644,7 @@ class MainWindow(QtGui.QMainWindow): eip_menu = systrayMenu.addMenu(self.tr("Encrypted Internet: OFF")) eip_menu.addAction(self._action_eip_startstop) self._eip_status.set_eip_status_menu(eip_menu) - + systrayMenu.addSeparator() systrayMenu.addAction(self._action_mail_status) systrayMenu.addSeparator() systrayMenu.addAction(self.ui.action_quit) @@ -799,8 +794,8 @@ class MainWindow(QtGui.QMainWindow): """ providers = self._settings.get_configured_providers() has_provider_on_disk = len(providers) != 0 - is_proper_provider = self._settings.get_properprovider() - return not (has_provider_on_disk and is_proper_provider) + skip_first_run = self._settings.get_skip_first_run() + return not (has_provider_on_disk and skip_first_run) def _download_provider_config(self): """ @@ -951,6 +946,7 @@ class MainWindow(QtGui.QMainWindow): """ self._login_widget.logged_in() + self.ui.lblLoginProvider.setText(self._provider_config.get_name()) self._enabled_services = self._settings.get_enabled_services( self._provider_config.get_domain()) @@ -971,7 +967,11 @@ class MainWindow(QtGui.QMainWindow): self._download_eip_config() + ################################################################### + # Service control methods: soledad + def _soledad_intermediate_stage(self, data): + # TODO missing param docstring """ SLOT TRIGGERS: @@ -1222,16 +1222,53 @@ class MainWindow(QtGui.QMainWindow): signal that currently is beeing processed under status_panel. After the refactor to EIPConductor this should not be necessary. """ - logger.debug('EIP connected signal received ...') self._eip_connection.qtsigs.connected_signal.emit() + def _try_autostart_eip(self): + """ + Tries to autostart EIP + """ + settings = self._settings + + should_autostart = settings.get_autostart_eip() + if not should_autostart: + logger.debug('Will not autostart EIP since it is setup ' + 'to not to do it') + self.eip_needs_login.emit() + return + + default_provider = settings.get_defaultprovider() + + if default_provider is None: + logger.info("Cannot autostart Encrypted Internet because there is " + "no default provider configured") + self.eip_needs_login.emit() + return + + self._enabled_services = settings.get_enabled_services( + default_provider) + + loaded = self._provisional_provider_config.load( + provider.get_provider_path(default_provider)) + if loaded: + # XXX I think we should not try to re-download config every time, + # it adds some delay. + # Maybe if it's the first run in a session, + # or we can try only if it fails. + self._download_eip_config() + else: + # XXX: Display a proper message to the user + self.eip_needs_login.emit() + logger.error("Unable to load %s config, cannot autostart." % + (default_provider,)) + @QtCore.Slot() def _start_eip(self): """ SLOT TRIGGERS: - self._eip_status.start_eip - self._action_eip_startstop.triggered + self._eip_connection.qtsigs.do_connect_signal + (via state machine) or called from _finish_eip_bootstrap Starts EIP @@ -1332,8 +1369,8 @@ class MainWindow(QtGui.QMainWindow): """ SLOT TRIGGERS: - self._eip_status.stop_eip - self._action_eip_startstop.triggered + self._eip_connection.qtsigs.do_disconnect_signal + (via state machine) or called from _eip_finished Stops vpn process and makes gui adjustments to reflect @@ -1357,14 +1394,100 @@ class MainWindow(QtGui.QMainWindow): self._get_best_provider_config().get_domain())) self._eip_status.eip_stopped() + @QtCore.Slot() + def _on_eip_network_unreachable(self): + # XXX Should move to EIP Conductor + """ + SLOT + TRIGGERS: + self._eip_connection.qtsigs.network_unreachable + + Displays a "network unreachable" error in the EIP status panel. + """ + self._eip_status.set_eip_status(self.tr("Network is unreachable"), + error=True) + self._eip_status.set_eip_status_icon("error") + + @QtCore.Slot() + def _do_eip_restart(self): + # XXX Should move to EIP Conductor + """ + SLOT + self._eip_connection.qtsigs.process_restart + + Restart the connection. + """ + # for some reason, emitting the do_disconnect/do_connect + # signals hangs the UI. + self._stop_eip() + QtCore.QTimer.singleShot(2000, self._start_eip) + def _set_eipstatus_off(self, error=True): """ Sets eip status to off """ + # XXX this should be handled by the state machine. self._eip_status.set_eip_status(self.tr("EIP has stopped"), error=error) self._eip_status.set_eip_status_icon("error") + def _eip_finished(self, exitCode): + """ + SLOT + TRIGGERS: + self._vpn.process_finished + + Triggered when the EIP/VPN process finishes to set the UI + accordingly. + + Ideally we would have the right exit code here, + but the use of different wrappers (pkexec, cocoasudo) swallows + the openvpn exit code so we get zero exit in some cases where we + shouldn't. As a workaround we just use a flag to indicate + a purposeful switch off, and mark everything else as unexpected. + + In the near future we should trigger a native notification from here, + since the user really really wants to know she is unprotected asap. + And the right thing to do will be to fail-close. + + :param exitCode: the exit code of the eip process. + :type exitCode: int + """ + # TODO move to EIPConductor. + # TODO Add error catching to the openvpn log observer + # so we can have a more precise idea of which type + # of error did we have (server side, local problem, etc) + + logger.info("VPN process finished with exitCode %s..." + % (exitCode,)) + + qtsigs = self._eip_connection.qtsigs + signal = qtsigs.disconnected_signal + + # XXX check if these exitCodes are pkexec/cocoasudo specific + if exitCode in (126, 127): + self._eip_status.set_eip_status( + self.tr("Encrypted Internet could not be launched " + "because you did not authenticate properly."), + error=True) + self._vpn.killit() + signal = qtsigs.connection_aborted_signal + + elif exitCode != 0 or not self.user_stopped_eip: + self._eip_status.set_eip_status( + self.tr("Encrypted Internet finished in an " + "unexpected manner!"), error=True) + signal = qtsigs.connection_died_signal + + if exitCode == 0 and IS_MAC: + # XXX remove this warning after I fix cocoasudo. + logger.warning("The above exit code MIGHT BE WRONG.") + + # We emit signals to trigger transitions in the state machine: + signal.emit() + + # eip boostrapping, config etc... + def _download_eip_config(self): """ Starts the EIP bootstrapping sequence @@ -1426,7 +1549,25 @@ class MainWindow(QtGui.QMainWindow): "Configuration."), error=True) - # end eip methods ------------------------------------------- + def _eip_intermediate_stage(self, data): + # TODO missing param + """ + SLOT + TRIGGERS: + self._eip_bootstrapper.download_config + + If there was a problem, displays it, otherwise it does nothing. + This is used for intermediate bootstrapping stages, in case + they fail. + """ + passed = data[self._provider_bootstrapper.PASSED_KEY] + if not passed: + self._login_widget.set_status( + self.tr("Unable to connect: Problem with provider")) + logger.error(data[self._provider_bootstrapper.ERROR_KEY]) + self._already_started_eip = False + + # end of EIP methods --------------------------------------------- def _get_best_provider_config(self): """ @@ -1469,6 +1610,7 @@ class MainWindow(QtGui.QMainWindow): self.logout.emit() def _done_logging_out(self, ok, message): + # TODO missing params in docstring """ SLOT TRIGGER: self._srp_auth.logout_finished @@ -1477,6 +1619,7 @@ class MainWindow(QtGui.QMainWindow): logging out """ self._login_widget.done_logout() + self.ui.lblLoginProvider.setText(self.tr("Login")) if ok: self._logged_user = None @@ -1489,6 +1632,7 @@ class MainWindow(QtGui.QMainWindow): error=True) def _intermediate_stage(self, data): + # TODO this method name is confusing as hell. """ SLOT TRIGGERS: @@ -1508,80 +1652,9 @@ class MainWindow(QtGui.QMainWindow): self.tr("Unable to connect: Problem with provider")) logger.error(data[self._provider_bootstrapper.ERROR_KEY]) - def _eip_intermediate_stage(self, data): - """ - SLOT - TRIGGERS: - self._eip_bootstrapper.download_config - - If there was a problem, displays it, otherwise it does nothing. - This is used for intermediate bootstrapping stages, in case - they fail. - """ - passed = data[self._provider_bootstrapper.PASSED_KEY] - if not passed: - self._login_widget.set_status( - self.tr("Unable to connect: Problem with provider")) - logger.error(data[self._provider_bootstrapper.ERROR_KEY]) - self._already_started_eip = False - - def _eip_finished(self, exitCode): - """ - SLOT - TRIGGERS: - self._vpn.process_finished - - Triggered when the EIP/VPN process finishes to set the UI - accordingly. - """ - # TODO move to EIPConductor. - logger.info("VPN process finished with exitCode %s..." - % (exitCode,)) - - # Ideally we would have the right exit code here, - # but the use of different wrappers (pkexec, cocoasudo) swallows - # the openvpn exit code so we get zero exit in some cases where we - # shouldn't. As a workaround we just use a flag to indicate - # a purposeful switch off, and mark everything else as unexpected. - - # In the near future we should trigger a native notification from here, - # since the user really really wants to know she is unprotected asap. - # And the right thing to do will be to fail-close. - - # TODO we should have a way of parsing the latest lines in the vpn - # log buffer so we can have a more precise idea of which type - # of error did we have (server side, local problem, etc) - - qtsigs = self._eip_connection.qtsigs - signal = qtsigs.disconnected_signal - - # XXX check if these exitCodes are pkexec/cocoasudo specific - if exitCode in (126, 127): - self._eip_status.set_eip_status( - self.tr("Encrypted Internet could not be launched " - "because you did not authenticate properly."), - error=True) - self._vpn.killit() - signal = qtsigs.connection_aborted_signal - - elif exitCode != 0 or not self.user_stopped_eip: - self._eip_status.set_eip_status( - self.tr("Encrypted Internet finished in an " - "unexpected manner!"), error=True) - signal = qtsigs.connection_died_signal - - if exitCode == 0 and IS_MAC: - # XXX remove this warning after I fix cocoasudo. - logger.warning("The above exit code MIGHT BE WRONG.") - - # XXX verify that the logic kees the same w/o the abnormal flag - # after the refactor to EIPConnection has been completed - # (eipconductor taking the most of the logic under transitions - # that right now are handled under status_panel) - #self._stop_eip(abnormal) - - # We emit signals to trigger transitions in the state machine: - signal.emit() + # + # window handling methods + # def _on_raise_window_event(self, req): """ @@ -1607,6 +1680,10 @@ class MainWindow(QtGui.QMainWindow): if IS_MAC: self.raise_() + # + # cleanup and quit methods + # + def _cleanup_pidfiles(self): """ Removes lockfiles on a clean shutdown. diff --git a/src/leap/bitmask/gui/ui/eip_status.ui b/src/leap/bitmask/gui/ui/eip_status.ui index 27df3f31..25831118 100644 --- a/src/leap/bitmask/gui/ui/eip_status.ui +++ b/src/leap/bitmask/gui/ui/eip_status.ui @@ -94,8 +94,8 @@ <widget class="QLabel" name="lblVPNStatusIcon"> <property name="maximumSize"> <size> - <width>16</width> - <height>16</height> + <width>24</width> + <height>24</height> </size> </property> <property name="text"> diff --git a/src/leap/bitmask/gui/ui/eippreferences.ui b/src/leap/bitmask/gui/ui/eippreferences.ui index 9493d330..cc77c82e 100644 --- a/src/leap/bitmask/gui/ui/eippreferences.ui +++ b/src/leap/bitmask/gui/ui/eippreferences.ui @@ -6,12 +6,12 @@ <rect> <x>0</x> <y>0</y> - <width>398</width> - <height>262</height> + <width>435</width> + <height>273</height> </rect> </property> <property name="windowTitle"> - <string>EIP Preferences</string> + <string>Encrypted Internet Preferences</string> </property> <property name="windowIcon"> <iconset resource="../../../../../data/resources/mainwindow.qrc"> @@ -88,7 +88,7 @@ <item row="0" column="0"> <widget class="QGroupBox" name="gbAutomaticEIP"> <property name="title"> - <string>Automatic EIP start</string> + <string>Automatic Encrypted Internet start</string> </property> <layout class="QGridLayout" name="gridLayout_3"> <item row="3" column="0"> @@ -126,7 +126,7 @@ <enum>Qt::LeftToRight</enum> </property> <property name="text"> - <string>Enable Automatic start of EIP</string> + <string>Enable Automatic start:</string> </property> <property name="checked"> <bool>true</bool> diff --git a/src/leap/bitmask/gui/ui/login.ui b/src/leap/bitmask/gui/ui/login.ui index a1842608..e7ca1652 100644 --- a/src/leap/bitmask/gui/ui/login.ui +++ b/src/leap/bitmask/gui/ui/login.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>468</width> - <height>350</height> + <height>363</height> </rect> </property> <property name="sizePolicy"> @@ -32,104 +32,26 @@ <property name="margin"> <number>0</number> </property> - <item row="2" column="2" colspan="2"> - <widget class="QWidget" name="logged_widget" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> + <property name="verticalSpacing"> + <number>-1</number> + </property> + <item row="2" column="0"> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> </property> - <layout class="QGridLayout" name="gridLayout_5"> - <property name="bottomMargin"> - <number>24</number> - </property> - <item row="0" column="0" colspan="2"> - <widget class="QLabel" name="lblUser"> - <property name="font"> - <font> - <pointsize>15</pointsize> - <weight>75</weight> - <bold>true</bold> - </font> - </property> - <property name="text"> - <string>...</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QPushButton" name="btnLogout"> - <property name="text"> - <string>Logout</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="2" column="0" colspan="2"> - <widget class="QLabel" name="lblLoginStatus"> - <property name="styleSheet"> - <string notr="true">color: rgb(132, 132, 132); -font: 75 12pt "Lucida Grande";</string> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="1" column="1" rowspan="2"> - <widget class="QLabel" name="label"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <property name="sizeType"> + <enum>QSizePolicy::Maximum</enum> </property> - <property name="maximumSize"> + <property name="sizeHint" stdset="0"> <size> - <width>16777215</width> - <height>800</height> + <width>12</width> + <height>0</height> </size> </property> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../../../../data/resources/mainwindow.qrc">:/images/black/32/user.png</pixmap> - </property> - <property name="scaledContents"> - <bool>false</bool> - </property> - <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - <property name="margin"> - <number>0</number> - </property> - </widget> + </spacer> </item> - <item row="1" column="2" colspan="2"> + <item row="2" column="2" colspan="2"> <widget class="QWidget" name="login_widget" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> @@ -224,21 +146,36 @@ font: 75 12pt "Lucida Grande";</string> </layout> </widget> </item> - <item row="1" column="0"> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Maximum</enum> + <item row="2" column="1" rowspan="2"> + <widget class="QLabel" name="label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="sizeHint" stdset="0"> + <property name="maximumSize"> <size> - <width>12</width> - <height>0</height> + <width>16777215</width> + <height>800</height> </size> </property> - </spacer> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="../../../../../data/resources/mainwindow.qrc">:/images/black/32/user.png</pixmap> + </property> + <property name="scaledContents"> + <bool>false</bool> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + <property name="margin"> + <number>0</number> + </property> + </widget> </item> <item row="0" column="0" colspan="4"> <widget class="ClickableLabel" name="clblErrorMsg"> @@ -259,6 +196,91 @@ font: 75 12pt "Lucida Grande";</string> </property> </widget> </item> + <item row="3" column="2" colspan="2"> + <widget class="QWidget" name="logged_widget" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <layout class="QGridLayout" name="gridLayout_5"> + <property name="topMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>24</number> + </property> + <item row="1" column="1"> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="1" column="0"> + <widget class="QPushButton" name="btnLogout"> + <property name="text"> + <string>Logout</string> + </property> + </widget> + </item> + <item row="0" column="0" colspan="2"> + <widget class="QLabel" name="lblUser"> + <property name="font"> + <font> + <pointsize>15</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>...</string> + </property> + </widget> + </item> + <item row="2" column="0" colspan="2"> + <widget class="QLabel" name="lblLoginStatus"> + <property name="styleSheet"> + <string notr="true">color: rgb(132, 132, 132); +font: 75 12pt "Lucida Grande";</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="1" column="0"> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>5</height> + </size> + </property> + </spacer> + </item> </layout> </widget> <customwidgets> diff --git a/src/leap/bitmask/gui/ui/mail_status.ui b/src/leap/bitmask/gui/ui/mail_status.ui index 1327f9e7..22976f39 100644 --- a/src/leap/bitmask/gui/ui/mail_status.ui +++ b/src/leap/bitmask/gui/ui/mail_status.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>400</width> - <height>72</height> + <height>79</height> </rect> </property> <property name="sizePolicy"> @@ -20,9 +20,25 @@ <string>Form</string> </property> <layout class="QGridLayout" name="gridLayout"> + <property name="topMargin"> + <number>0</number> + </property> <item row="0" column="1" rowspan="2"> <layout class="QGridLayout" name="gridLayout_3"> - <item row="1" column="0" colspan="3"> + <item row="1" column="1"> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="2" column="0" colspan="3"> <widget class="QLabel" name="lblMailStatus"> <property name="styleSheet"> <string notr="true">color: rgb(80, 80, 80);</string> @@ -32,7 +48,26 @@ </property> </widget> </item> - <item row="0" column="0"> + <item row="1" column="3"> + <widget class="QLabel" name="lblMailStatusIcon"> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="../../../../../data/resources/mainwindow.qrc">:/images/black/32/off.png</pixmap> + </property> + <property name="scaledContents"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="1" column="0"> <widget class="QLabel" name="label_4"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> @@ -45,38 +80,22 @@ </property> </widget> </item> - <item row="0" column="1"> - <spacer name="horizontalSpacer_4"> + <item row="0" column="0"> + <spacer name="verticalSpacer"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> - <height>20</height> + <width>0</width> + <height>5</height> </size> </property> </spacer> </item> - <item row="0" column="3"> - <widget class="QLabel" name="lblMailStatusIcon"> - <property name="maximumSize"> - <size> - <width>16</width> - <height>16</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../../../../data/resources/mainwindow.qrc">:/images/black/32/off.png</pixmap> - </property> - <property name="scaledContents"> - <bool>true</bool> - </property> - </widget> - </item> </layout> </item> <item row="0" column="0"> diff --git a/src/leap/bitmask/gui/ui/mainwindow.ui b/src/leap/bitmask/gui/ui/mainwindow.ui index 920160b8..10c77057 100644 --- a/src/leap/bitmask/gui/ui/mainwindow.ui +++ b/src/leap/bitmask/gui/ui/mainwindow.ui @@ -86,13 +86,16 @@ <number>0</number> </property> <item> - <widget class="QWidget" name="widget_2" native="true"> + <widget class="QFrame" name="frame_2"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> + <property name="styleSheet"> + <string notr="true">QFrame{background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 rgba(160, 160, 160, 128), stop:1 rgba(255, 255, 255, 0));}</string> + </property> <layout class="QHBoxLayout" name="horizontalLayout_3"> <property name="leftMargin"> <number>24</number> @@ -109,6 +112,9 @@ <bold>true</bold> </font> </property> + <property name="styleSheet"> + <string notr="true">background-color: rgba(255, 255, 255, 0);</string> + </property> <property name="text"> <string>Encrypted Internet</string> </property> @@ -122,6 +128,9 @@ <height>20</height> </size> </property> + <property name="styleSheet"> + <string notr="true"/> + </property> <property name="text"> <string/> </property> @@ -167,13 +176,21 @@ </widget> </item> <item> - <widget class="QWidget" name="widget" native="true"> + <widget class="QFrame" name="frame"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="styleSheet"> + <string notr="true">QFrame{ +background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 rgba(160, 160, 160, 128), stop:1 rgba(255, 255, 255, 0)); +}</string> + </property> <layout class="QHBoxLayout" name="horizontalLayout"> <property name="leftMargin"> <number>24</number> @@ -190,6 +207,9 @@ <bold>true</bold> </font> </property> + <property name="styleSheet"> + <string notr="true">background-color: rgba(255, 255, 255, 0);</string> + </property> <property name="text"> <string>Login</string> </property> @@ -203,6 +223,9 @@ <height>20</height> </size> </property> + <property name="styleSheet"> + <string notr="true"/> + </property> <property name="text"> <string/> </property> @@ -216,7 +239,11 @@ </widget> </item> <item> - <layout class="QVBoxLayout" name="loginLayout"/> + <layout class="QVBoxLayout" name="loginLayout"> + <property name="topMargin"> + <number>12</number> + </property> + </layout> </item> <item> <widget class="Line" name="line_2"> @@ -226,7 +253,10 @@ </widget> </item> <item> - <layout class="QVBoxLayout" name="mailLayout"> + <layout class="QVBoxLayout" name="mailLayout" stretch=""> + <property name="spacing"> + <number>-1</number> + </property> <property name="margin"> <number>12</number> </property> @@ -269,7 +299,7 @@ <property name="sizeHint" stdset="0"> <size> <width>40</width> - <height>20</height> + <height>0</height> </size> </property> </spacer> @@ -290,7 +320,7 @@ <item row="1" column="2"> <widget class="QPushButton" name="btnMore"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -311,7 +341,7 @@ <property name="sizeHint" stdset="0"> <size> <width>40</width> - <height>20</height> + <height>0</height> </size> </property> </spacer> diff --git a/src/leap/bitmask/gui/ui/wizard.ui b/src/leap/bitmask/gui/ui/wizard.ui index 0f6eef6e..cf591470 100644 --- a/src/leap/bitmask/gui/ui/wizard.ui +++ b/src/leap/bitmask/gui/ui/wizard.ui @@ -7,19 +7,19 @@ <x>0</x> <y>0</y> <width>536</width> - <height>490</height> + <height>510</height> </rect> </property> <property name="minimumSize"> <size> <width>536</width> - <height>490</height> + <height>510</height> </size> </property> <property name="maximumSize"> <size> <width>536</width> - <height>490</height> + <height>510</height> </size> </property> <property name="windowTitle"> @@ -124,7 +124,7 @@ <enum>Qt::Vertical</enum> </property> <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> + <enum>QSizePolicy::Expanding</enum> </property> <property name="sizeHint" stdset="0"> <size> diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py index e3f5904e..6ba65410 100644 --- a/src/leap/bitmask/gui/wizard.py +++ b/src/leap/bitmask/gui/wizard.py @@ -53,9 +53,6 @@ class Wizard(QtGui.QWizard): REGISTER_USER_PAGE = 4 SERVICES_PAGE = 5 - WEAK_PASSWORDS = ("123456", "qweasd", "qwerty", - "password") - BARE_USERNAME_REGEX = r"^[A-Za-z\d_]+$" def __init__(self, bypass_checks=False): |