diff options
-rw-r--r-- | changes/feature-3574_use-dirspec-instead-of-plain-xdg | 1 | ||||
-rw-r--r-- | docs/checklist_for_leap_client_release.wiki | 45 | ||||
-rw-r--r-- | docs/release_checklist.wiki | 34 | ||||
-rw-r--r-- | src/leap/bitmask/config/leapsettings.py | 9 | ||||
-rw-r--r-- | src/leap/bitmask/gui/mainwindow.py | 12 | ||||
-rw-r--r-- | src/leap/bitmask/gui/preferenceswindow.py | 39 | ||||
-rw-r--r-- | src/leap/bitmask/gui/ui/mainwindow.ui | 2 | ||||
-rw-r--r-- | src/leap/bitmask/gui/ui/preferences.ui | 3 | ||||
-rw-r--r-- | src/leap/bitmask/gui/wizard.py | 25 | ||||
-rw-r--r-- | src/leap/bitmask/services/__init__.py | 35 |
10 files changed, 111 insertions, 94 deletions
diff --git a/changes/feature-3574_use-dirspec-instead-of-plain-xdg b/changes/feature-3574_use-dirspec-instead-of-plain-xdg new file mode 100644 index 00000000..9bdc5071 --- /dev/null +++ b/changes/feature-3574_use-dirspec-instead-of-plain-xdg @@ -0,0 +1 @@ + o Use dirspec instead of plain xdg. Closes #3574. diff --git a/docs/checklist_for_leap_client_release.wiki b/docs/checklist_for_leap_client_release.wiki deleted file mode 100644 index d3bdf1ee..00000000 --- a/docs/checklist_for_leap_client_release.wiki +++ /dev/null @@ -1,45 +0,0 @@ -= LEAP CLient Release Checklist (*) = - - * [ ] validate rc - * [ ] all rc-critical closed! - * [ ] all bbots green - * [ ] uploaded translations: make translations - * [ ] re-generate pyside resources - - * [ ] update docs - * [ ] CREDITS - * [ ] relnotes.txt - * [ ] docs/known_issues.rst - * [ ] NEWS.rst: Add release name and date to top-most item in NEWS. - - * [ ] change docs/quickstart.rst to point to just the current - leap-client-X.Y.Z.deb binaries and .tar.gz source code files - * [ ] on release/vX.Y.Z branch: git pull - * [ ] git tag X.Y.Z - * [ ] build locally to make sure the release is reporting itself as the - intended version (FIXME!) - * [ ] make sure buildbot is green - * [ ] make sure other people aren't committing at that moment - * [ ] FUTURE: push tag along with some other documentation-only patch (typically to - relnotes.txt) to trigger buildslaves - * [ ] git push --tags official; git push official - * [ ] that will build tarballs - * [ ] make sure buildbot is green (in a parallel universe, he) - * [ ] download tarballs, sign with "gpg -ba -u deadbeef TAR", upload *.asc - * [ ] symlink the release tarball on leap.se downloads page: - /var/www/source/leap-client/releases/ CHANGEME XXX - - * [ ] update news pages. release notes. - * [ ] send out relnotes.txt to internal list. - * [ ] wait ...? - - * [ ] PYPI UPLOAD: with "python ./setup.py sdist upload register" - - * [ ] make an "announcement of new release" on leap.se - * [ ] close the Milestone on the chili Roadmap - * [ ] send out relnotes.txt to: - * [ ] mailing lists... - -notes ------ -(*) this checklist kindly borrowed from tahoe-lafs documentation =) diff --git a/docs/release_checklist.wiki b/docs/release_checklist.wiki new file mode 100644 index 00000000..8987f0b8 --- /dev/null +++ b/docs/release_checklist.wiki @@ -0,0 +1,34 @@ += Bitmask Release Checklist (*) = + * [ ] Tag everything + * Should be done for the following packages, in order: + 1. leap.common + 2. leap.keymanager + 3. leap.soledad + 4. leap.mail + 5. leap.bitmask + 6. leap.mx + * NOTE: It's assumed that origin is the leap.se repo + * [ ] git fetch origin + * [ ] git tag -l, and see the latest tagged version (unless it's not a minor version bump, in which case, just bump to it) + * [ ] Checkout release-X.Y.Z (locally, never pushed) + * [ ] Fold in changes files into the CHANGELOG + - NOTE: For leap.soledad, the CHANGELOG entries should be divided per package (common, client, server). See older releases for reference. + - Helper bash line: for i in $(ls changes); do cat changes/$i; echo; done + * [ ] Update relnotes.txt if needed. + * [ ] git rm changes/* + * [ ] git commit -av + * [ ] Update dependencies on the current package in the packages that remain if needed (that's why the order). + * [ ] git tag -s X.Y.Z (note the -s so that it's a signed tag) The message should be something like: Tag <package> version X.Y.Z + * [ ] git push origin X.Y.Z + * [ ] git checkout master && git pull origin master && git merge release-X.Y.Z && git push origin master + * [ ] git checkout develop && git pull origin develop && git merge release-X.Y.Z && git push origin develop + * [ ] Build bundles + * [ ] Use the scripts under pkg/<os>/ to build the the bundles. + * [ ] Sign them with gpg -a <path/to/bundle> + * [ ] Upload bundle and signature to web-uploads@salmon.leap.se:~/public/client/<os>/ + * [ ] Announce + * [ ] Mail leap@lists.riseup.net + +Notes +----- +(*) this checklist kindly borrowed from tahoe-lafs documentation =) diff --git a/src/leap/bitmask/config/leapsettings.py b/src/leap/bitmask/config/leapsettings.py index c1fabd9c..ca94129e 100644 --- a/src/leap/bitmask/config/leapsettings.py +++ b/src/leap/bitmask/config/leapsettings.py @@ -24,7 +24,7 @@ import logging from PySide import QtCore from leap.common.check import leap_assert, leap_assert_type -from leap.common.config.prefixers import get_platform_prefixer +from leap.common.config import get_path_prefix logger = logging.getLogger(__name__) @@ -75,10 +75,9 @@ class LeapSettings(object): the config :type standalone: bool """ - self._path_prefix = get_platform_prefixer().get_path_prefix( - standalone=standalone) settings_path = os.path.join( - self._path_prefix, "leap", self.CONFIG_NAME) + get_path_prefix(standalone=standalone), "leap", self.CONFIG_NAME) + self._settings = QtCore.QSettings(settings_path, QtCore.QSettings.IniFormat) @@ -130,7 +129,7 @@ class LeapSettings(object): providers = [] try: providers_path = os.path.join( - self._path_prefix, "leap", "providers") + get_path_prefix(), "leap", "providers") providers = os.listdir(providers_path) except Exception as e: logger.debug("Error listing providers, assume there are none. %r" diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index 25747785..34451928 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -288,17 +288,12 @@ class MainWindow(QtGui.QMainWindow): ################################# end Qt Signals connection ######## - # Enable the password change when soledad is ready - self.soledad_ready.connect( - partial(self.ui.btnPreferences.setEnabled, True)) - init_platform() self._wizard = None self._wizard_firstrun = False self._logger_window = None - self._preferences_window = None self._bypass_checks = bypass_checks @@ -419,8 +414,11 @@ class MainWindow(QtGui.QMainWindow): Displays the preferences window. """ - PreferencesWindow( - self, self._srp_auth, self._soledad, self._settings).show() + preferences_window = PreferencesWindow( + self, self._srp_auth, self._soledad, + self._settings, self._standalone) + + preferences_window.show() def _uncheck_logger_button(self): """ diff --git a/src/leap/bitmask/gui/preferenceswindow.py b/src/leap/bitmask/gui/preferenceswindow.py index 2b48b54c..05f616b0 100644 --- a/src/leap/bitmask/gui/preferenceswindow.py +++ b/src/leap/bitmask/gui/preferenceswindow.py @@ -30,6 +30,7 @@ from leap.bitmask.crypto.srpauth import SRPAuthBadPassword from leap.bitmask.util.password import basic_password_checks from leap.bitmask.services import get_supported from leap.bitmask.config.providerconfig import ProviderConfig +from leap.bitmask.services import get_service_display_name logger = logging.getLogger(__name__) @@ -41,7 +42,7 @@ class PreferencesWindow(QtGui.QDialog): WEAK_PASSWORDS = ("123456", "qweasd", "qwerty", "password") - def __init__(self, parent, srp_auth, soledad, leap_settings): + def __init__(self, parent, srp_auth, soledad, leap_settings, standalone): """ :param parent: parent object of the PreferencesWindow. :parent type: QWidget @@ -49,12 +50,17 @@ class PreferencesWindow(QtGui.QDialog): :type srp_auth: SRPAuth :param soledad: Soledad object configured in the main app. :type soledad: Soledad + :param standalone: If True, the application is running as standalone + and the preferences dialog should display some + messages according to this. + :type standalone: bool """ QtGui.QDialog.__init__(self, parent) self._srp_auth = srp_auth self._soledad = soledad self._settings = leap_settings + self._standalone = standalone # Load UI self.ui = Ui_Preferences() @@ -62,19 +68,6 @@ class PreferencesWindow(QtGui.QDialog): self.ui.lblPasswordChangeStatus.setVisible(False) self.ui.lblProvidersServicesStatus.setVisible(False) - # Correspondence for services and their name to display - EIP_LABEL = self.tr("Encrypted Internet") - MX_LABEL = self.tr("Encrypted Mail") - - self.SERVICE_DISPLAY = [ - EIP_LABEL, - MX_LABEL - ] - self.SERVICE_CONFIG = [ - "openvpn", - "mx" - ] - self._selected_services = set() self._provider_config = ProviderConfig() @@ -83,11 +76,23 @@ class PreferencesWindow(QtGui.QDialog): self.ui.cbProvidersServices.currentIndexChanged[unicode].connect( self._populate_services) + parent.soledad_ready.connect(self._soledad_ready) + if not self._settings.get_configured_providers(): self.ui.gbEnabledServices.setEnabled(False) else: self._add_configured_providers() + def _soledad_ready(self): + """ + SLOT + TRIGGERS: + parent.soledad_ready + It sets the soledad object as ready to use. + """ + self._soledad_ready = True + self.ui.gbPasswordChange.setEnabled(True) + def _set_password_change_status(self, status, error=False, success=False): """ Sets the status label for the password change. @@ -283,8 +288,10 @@ class PreferencesWindow(QtGui.QDialog): for service in services: try: checkbox = QtGui.QCheckBox(self) - service_index = self.SERVICE_CONFIG.index(service) - checkbox.setText(self.SERVICE_DISPLAY[service_index]) + service_label = get_service_display_name( + service, self._standalone) + checkbox.setText(service_label) + self.ui.vlServices.addWidget(checkbox) checkbox.stateChanged.connect( partial(self._service_selection_changed, service)) diff --git a/src/leap/bitmask/gui/ui/mainwindow.ui b/src/leap/bitmask/gui/ui/mainwindow.ui index 834a562e..17837642 100644 --- a/src/leap/bitmask/gui/ui/mainwindow.ui +++ b/src/leap/bitmask/gui/ui/mainwindow.ui @@ -217,7 +217,7 @@ <item> <widget class="QPushButton" name="btnPreferences"> <property name="enabled"> - <bool>false</bool> + <bool>true</bool> </property> <property name="text"> <string>Preferences</string> diff --git a/src/leap/bitmask/gui/ui/preferences.ui b/src/leap/bitmask/gui/ui/preferences.ui index 1f9ef4c4..b59990b1 100644 --- a/src/leap/bitmask/gui/ui/preferences.ui +++ b/src/leap/bitmask/gui/ui/preferences.ui @@ -20,6 +20,9 @@ <layout class="QGridLayout" name="gridLayout_3"> <item row="0" column="0"> <widget class="QGroupBox" name="gbPasswordChange"> + <property name="enabled"> + <bool>false</bool> + </property> <property name="title"> <string>Password Change</string> </property> diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py index e3f0085b..ac0f032f 100644 --- a/src/leap/bitmask/gui/wizard.py +++ b/src/leap/bitmask/gui/wizard.py @@ -34,7 +34,7 @@ from leap.bitmask.util.request_helpers import get_content from leap.bitmask.util.keyring_helpers import has_keyring from leap.bitmask.util.password import basic_password_checks from leap.bitmask.services.eip.providerbootstrapper import ProviderBootstrapper -from leap.bitmask.services import get_supported +from leap.bitmask.services import get_service_display_name, get_supported from ui_wizard import Ui_Wizard @@ -84,23 +84,6 @@ class Wizard(QtGui.QWizard): self.ERROR_ICON = QtGui.QPixmap(":/images/Dialog-error.png") self.OK_ICON = QtGui.QPixmap(":/images/Dialog-accept.png") - # Correspondence for services and their name to display - EIP_LABEL = self.tr("Encrypted Internet") - MX_LABEL = self.tr("Encrypted Mail") - - if self._is_need_eip_password_warning(): - EIP_LABEL += " " + self.tr( - "(will need admin password to start)") - - self.SERVICE_DISPLAY = [ - EIP_LABEL, - MX_LABEL - ] - self.SERVICE_CONFIG = [ - "openvpn", - "mx" - ] - self._selected_services = set() self._shown_services = set() @@ -507,8 +490,10 @@ class Wizard(QtGui.QWizard): try: if service not in self._shown_services: checkbox = QtGui.QCheckBox(self) - service_index = self.SERVICE_CONFIG.index(service) - checkbox.setText(self.SERVICE_DISPLAY[service_index]) + service_label = get_service_display_name( + service, self.standalone) + checkbox.setText(service_label) + self.ui.serviceListLayout.addWidget(checkbox) checkbox.stateChanged.connect( partial(self._service_selection_changed, service)) diff --git a/src/leap/bitmask/services/__init__.py b/src/leap/bitmask/services/__init__.py index 253359cd..924ca547 100644 --- a/src/leap/bitmask/services/__init__.py +++ b/src/leap/bitmask/services/__init__.py @@ -17,9 +17,44 @@ """ Services module. """ +from PySide import QtCore +from leap.bitmask.util.privilege_policies import is_missing_policy_permissions + DEPLOYED = ["openvpn", "mx"] +def get_service_display_name(service, standalone=False): + """ + Returns the name to display of the given service. + + :param service: the 'machine' service name + :type service: str + :param standalone: True if the app is running in a standalone mode, used + to display messages according that. + :type standalone: bool + + :rtype: str + """ + # qt translator method helper + _tr = QtCore.QObject().tr + + # Correspondence for services and their name to display + EIP_LABEL = _tr("Encrypted Internet") + MX_LABEL = _tr("Encrypted Mail") + + service_display = [EIP_LABEL, MX_LABEL] + service_config = ["openvpn", "mx"] + + # If we need to add a warning about eip needing + # administrative permissions to start. That can be either + # because we are running in standalone mode, or because we could + # not find the needed privilege escalation mechanisms being operative. + if standalone or is_missing_policy_permissions(): + EIP_LABEL += " " + _tr("(will need admin password to start)") + + return service_display[service_config.index(service)] + + def get_supported(services): """ Returns a list of the available services. |